Skip to content

Commit ec941d5

Browse files
Merge pull request #140 from GPUOpen-LibrariesAndSDKs/update_wk10
Update for wk10 / 2019
2 parents 6613abc + 806e937 commit ec941d5

553 files changed

Lines changed: 25583 additions & 9066 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (NOT ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB)
2121
endif()
2222

2323
# Do not modify anything after this line, unless you know what you're doing.
24+
2425
configure_file("include/config.h.in" "include/config.h")
2526

2627
include_directories("${Anvil_BINARY_DIR}/include"
@@ -65,7 +66,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
6566
"${Anvil_SOURCE_DIR}/include/misc/debug.h"
6667
"${Anvil_SOURCE_DIR}/include/misc/debug_marker.h"
6768
"${Anvil_SOURCE_DIR}/include/misc/debug_messenger_create_info.h"
69+
"${Anvil_SOURCE_DIR}/include/misc/descriptor_pool_create_info.h"
6870
"${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h"
71+
"${Anvil_SOURCE_DIR}/include/misc/device_create_info.h"
6972
"${Anvil_SOURCE_DIR}/include/misc/dummy_window.h"
7073
"${Anvil_SOURCE_DIR}/include/misc/event_create_info.h"
7174
"${Anvil_SOURCE_DIR}/include/misc/extensions.h"
@@ -88,7 +91,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
8891
"${Anvil_SOURCE_DIR}/include/misc/pools.h"
8992
"${Anvil_SOURCE_DIR}/include/misc/ref_counter.h"
9093
"${Anvil_SOURCE_DIR}/include/misc/render_pass_create_info.h"
94+
"${Anvil_SOURCE_DIR}/include/misc/rendering_surface_create_info.h"
9195
"${Anvil_SOURCE_DIR}/include/misc/sampler_create_info.h"
96+
"${Anvil_SOURCE_DIR}/include/misc/sampler_ycbcr_conversion_create_info.h"
9297
"${Anvil_SOURCE_DIR}/include/misc/semaphore_create_info.h"
9398
"${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h"
9499
"${Anvil_SOURCE_DIR}/include/misc/struct_chainer.h"
@@ -133,6 +138,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
133138
"${Anvil_SOURCE_DIR}/include/wrappers/render_pass.h"
134139
"${Anvil_SOURCE_DIR}/include/wrappers/rendering_surface.h"
135140
"${Anvil_SOURCE_DIR}/include/wrappers/sampler.h"
141+
"${Anvil_SOURCE_DIR}/include/wrappers/sampler_ycbcr_conversion.h"
136142
"${Anvil_SOURCE_DIR}/include/wrappers/semaphore.h"
137143
"${Anvil_SOURCE_DIR}/include/wrappers/shader_module.h"
138144
"${Anvil_SOURCE_DIR}/include/wrappers/swapchain.h"
@@ -147,7 +153,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
147153
"${Anvil_SOURCE_DIR}/src/misc/debug.cpp"
148154
"${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp"
149155
"${Anvil_SOURCE_DIR}/src/misc/debug_messenger_create_info.cpp"
156+
"${Anvil_SOURCE_DIR}/src/misc/descriptor_pool_create_info.cpp"
150157
"${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp"
158+
"${Anvil_SOURCE_DIR}/src/misc/device_create_info.cpp"
151159
"${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp"
152160
"${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp"
153161
"${Anvil_SOURCE_DIR}/src/misc/event_create_info.cpp"
@@ -167,7 +175,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
167175
"${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp"
168176
"${Anvil_SOURCE_DIR}/src/misc/pools.cpp"
169177
"${Anvil_SOURCE_DIR}/src/misc/render_pass_create_info.cpp"
178+
"${Anvil_SOURCE_DIR}/src/misc/rendering_surface_create_info.cpp"
170179
"${Anvil_SOURCE_DIR}/src/misc/sampler_create_info.cpp"
180+
"${Anvil_SOURCE_DIR}/src/misc/sampler_ycbcr_conversion_create_info.cpp"
171181
"${Anvil_SOURCE_DIR}/src/misc/semaphore_create_info.cpp"
172182
"${Anvil_SOURCE_DIR}/src/misc/shader_module_cache.cpp"
173183
"${Anvil_SOURCE_DIR}/src/misc/swapchain_create_info.cpp"
@@ -209,12 +219,14 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
209219
"${Anvil_SOURCE_DIR}/src/wrappers/render_pass.cpp"
210220
"${Anvil_SOURCE_DIR}/src/wrappers/rendering_surface.cpp"
211221
"${Anvil_SOURCE_DIR}/src/wrappers/sampler.cpp"
222+
"${Anvil_SOURCE_DIR}/src/wrappers/sampler_ycbcr_conversion.cpp"
212223
"${Anvil_SOURCE_DIR}/src/wrappers/semaphore.cpp"
213224
"${Anvil_SOURCE_DIR}/src/wrappers/shader_module.cpp"
214225
"${Anvil_SOURCE_DIR}/src/wrappers/swapchain.cpp"
215226

216227
# Vulkan Memory Allocator dependency
217228
"${Anvil_SOURCE_DIR}/deps/VulkanMemoryAllocator/vk_mem_alloc.h"
229+
# <--
218230
)
219231

220232
if (ANVIL_LINK_WITH_GLSLANG)
@@ -231,8 +243,7 @@ if(WIN32)
231243
endif()
232244
else()
233245
if (ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT)
234-
list (APPEND SRC_LIST
235-
"${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h"
246+
list (APPEND SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h"
236247
"${Anvil_SOURCE_DIR}/src/misc/xcb_loader.cpp"
237248
"${Anvil_SOURCE_DIR}/include/misc/window_xcb.h"
238249
"${Anvil_SOURCE_DIR}/src/misc/window_xcb.cpp")
@@ -246,7 +257,7 @@ if (WIN32)
246257
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY})
247258
else()
248259
target_link_libraries(Anvil ${VULKAN_LIBRARY})
249-
endif()
260+
endif()
250261
else()
251262
if (ANVIL_LINK_WITH_GLSLANG)
252263
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread)
@@ -273,7 +284,6 @@ if (ANVIL_LINK_WITH_GLSLANG)
273284
endif()
274285
endif()
275286

276-
277287
if (ANVIL_LINK_EXAMPLES)
278288
add_subdirectory("examples/DynamicBuffers")
279289
add_subdirectory("examples/MultiViewport")

README.md

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Anvil
22

3-
This is a README file for Anvil v1.3.1, a framework for Vulkan&trade;.
3+
This is a README file for Anvil, a framework for Vulkan&trade;.
44
The README is organized as a FAQ.
55

66
|Toolchain|Status|
@@ -15,8 +15,9 @@ MIT. See `LICENSE.txt`.
1515

1616
What is this?
1717
------
18-
Anvil is a framework for Vulkan v1.0, which we have been using internally for
19-
quite some time now, in order to develop various Vulkan applications.
18+
Anvil is a framework for Vulkan v1.0 and v1.1, which we have been using internally for
19+
quite some time now, in order to develop various Vulkan applications. This guarantees
20+
that vast majority of the functionality exposed by the library is regularly tested.
2021

2122
The general idea we started from was to have a cross-platform tool, which would
2223
reduce the amount of time required to write portable Vulkan-based apps from
@@ -34,16 +35,10 @@ Anvil was designed with the following goals in mind:
3435
using Vulkan, without hiding the API behind thick abstraction layers.
3536
- Simplify validation layer usage. All you have to do is specify which function
3637
you would like to be called if a debug call-back is made, and that's it.
37-
- Provide a reasonable level of deferred approach to baking objects, in order
38-
to emulate mutability of certain Vulkan objects to a certain degree. Note
39-
that this is an optional feature - you are free to request baking of any
40-
object at any time, in order to ensure it will never happen at draw time.
4138
- Provide a simple cross-platform implementation for areas unrelated to Vulkan
4239
(eg. window management)
43-
44-
Anvil can be thought of as a toolbox. You are free to use any of its parts you
45-
like, and write your own code for everything else. Any Anvil wrapper for an
46-
actual Vulkan object can be queried to retrieve the raw Vulkan handle.
40+
- Provide a simple way (with optional flexibility) to manage memory allocations
41+
and memory bindings.
4742

4843
Anvil is **not** the right choice for developers who do not have a reasonable
4944
understanding of how Vulkan works. Its goal is not to provide a glBegin/glEnd-like
@@ -61,8 +56,7 @@ What are Anvil's requirements?
6156
In order to build Anvil, you will need the following software:
6257
- C++11 compiler.
6358
- CMake
64-
- Vulkan RT 1.0.39.1 or newer.
65-
- Vulkan SDK 1.0.13.0 or newer.
59+
- Vulkan SDK (the latest available version is highly recommended)
6660

6761
To build Anvil on Linux, additional packages should be installed:
6862
- libxcb-keysyms (For ubuntu, use "apt-get install libxcb-keysyms1-dev")
@@ -78,54 +72,9 @@ implementation and on AMDGPU-PRO Vulkan implementation on Linux.
7872

7973
What can it do?
8074
------
81-
This version of Anvil provides:
82-
83-
* Low-level ref-counted wrappers for the following Vulkan v1.0 features:
84-
- Buffer objects (sparse and non-sparse)
85-
- Buffer views
86-
- Command buffers
87-
- Command pools
88-
- Descriptor pools
89-
- Descriptor sets
90-
- Descriptor set layouts
91-
- Devices
92-
- Events
93-
- Fences
94-
- Framebuffers
95-
- Image objects (sparse, sparse bindings, PRT)
96-
- Image views
97-
- Instances
98-
- Physical devices
99-
- Pipeline cache
100-
- Pipeline layouts
101-
- Query pools
102-
- Queues
103-
- Renderpasses
104-
- Rendering surfaces
105-
- Samplers
106-
- Semaphores
107-
- Shader modules
108-
- Swapchains
109-
110-
* More complicated wrappers:
111-
- Compute / graphics pipeline managers: provide a way to create regular/derivative pipelines with automatic pipeline layout re-use.
112-
- Descriptor set groups: simplify descriptor set configuration, management and updates.
113-
- Memory allocator: implements a memory allocator with two back-ends: one that is more appropriate for one-shot
114-
mem alloc requests, and one that can be used for dynamic memory allocation purposes.
115-
- Pipeline layout manager: caches all created pipeline layouts to avoid instantiating duplicate layout instances.
116-
117-
* Miscellaneous functionality:
118-
- Debug markers: names and tags can be optionally assigned to any of the created objects. If VK_EXT_debug_marker is enabled, these
119-
will be automatically patched through to layers that implement the extension on the running platform.
120-
- Format info reflection: provides information about format properties.
121-
- GLSL -> SPIR-V conversion: provides glslang-based GLSL->SPIR-V conversion. The conversion is performed in run-time. Disassembly can also be retrieved, if needed.
122-
- GLSL -> SPIR-V conversion cache: re-uses SPIR-V blobs throughout Instance's lifetime if GLSL->SPIR-V conversion is requested for GLSL source code which has already
123-
been converted to SPIR-V before.
124-
- IO: provides a number of functions to simplify directory- and file-related operations.
125-
- Object tracker: tracks object allocations and helps detect object leakage.
126-
- Shader module cache: re-uses shader module instances across Instance lifetime. Improve execution time if your application instantiates shader modules with
127-
exactly the same configuration during its runtime.
128-
- Time: provides a way to query current time using high-performance system queries.
75+
Anvil provides full support for functionality exposed in Vulkan 1.0 and Vulkan 1.1.
76+
We also try to do our best to keep it up to date with any extensions our Vulkan implementations
77+
expose.
12978

13079
We are planning to keep adding new features in the future.
13180

@@ -143,12 +92,7 @@ OutOfOrderRasterization and the other example applications are located in the
14392

14493
What are the known issues?
14594
------
146-
Just a handful:
147-
* All command queues are currently assigned a priority of 1.0.
148-
* DescriptorSetGroup wrapper does not leverage the <releaseable_sets> flag at
149-
baking time.
150-
151-
These will be addressed at some point in the future.
95+
Please observe the "Issues" tab for more details.
15296

15397
Who made it?
15498
------

deps/glslang/.gitattributes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
*.txt text
99

1010
# source code can be native and normalized, but simpler if lf everywhere; will try that way
11-
*.h text eof=lf
12-
*.c text eof=lf
13-
*.cpp text eof=lf
14-
*.y text eof=lf
15-
*.out text eof=lf
16-
*.conf text eof=lf
17-
*.err text eof=lf
11+
*.h text eol=lf
12+
*.c text eol=lf
13+
*.cpp text eol=lf
14+
*.y text eol=lf
15+
*.out text eol=lf
16+
*.conf text eol=lf
17+
*.err text eol=lf

deps/glslang/Android.mk

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
4+
# AMD and NV extensions are turned on by default in upstream Glslang.
5+
GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
6+
7+
include $(CLEAR_VARS)
8+
LOCAL_MODULE:=OSDependent
9+
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
10+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
11+
LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
12+
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
13+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/
14+
include $(BUILD_STATIC_LIBRARY)
15+
16+
include $(CLEAR_VARS)
17+
LOCAL_MODULE:=OGLCompiler
18+
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
19+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
20+
LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
21+
LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
22+
LOCAL_STATIC_LIBRARIES:=OSDependent
23+
include $(BUILD_STATIC_LIBRARY)
24+
25+
# Build Glslang's HLSL parser library.
26+
include $(CLEAR_VARS)
27+
LOCAL_MODULE:=HLSL
28+
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
29+
LOCAL_SRC_FILES:= \
30+
hlsl/hlslAttributes.cpp \
31+
hlsl/hlslGrammar.cpp \
32+
hlsl/hlslOpMap.cpp \
33+
hlsl/hlslParseables.cpp \
34+
hlsl/hlslParseHelper.cpp \
35+
hlsl/hlslScanContext.cpp \
36+
hlsl/hlslTokenStream.cpp
37+
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
38+
$(LOCAL_PATH)/hlsl
39+
include $(BUILD_STATIC_LIBRARY)
40+
41+
include $(CLEAR_VARS)
42+
GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))
43+
44+
LOCAL_MODULE:=glslang
45+
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
46+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
47+
LOCAL_SRC_FILES:= \
48+
glslang/GenericCodeGen/CodeGen.cpp \
49+
glslang/GenericCodeGen/Link.cpp \
50+
glslang/MachineIndependent/attribute.cpp \
51+
glslang/MachineIndependent/Constant.cpp \
52+
glslang/MachineIndependent/glslang_tab.cpp \
53+
glslang/MachineIndependent/InfoSink.cpp \
54+
glslang/MachineIndependent/Initialize.cpp \
55+
glslang/MachineIndependent/Intermediate.cpp \
56+
glslang/MachineIndependent/intermOut.cpp \
57+
glslang/MachineIndependent/IntermTraverse.cpp \
58+
glslang/MachineIndependent/iomapper.cpp \
59+
glslang/MachineIndependent/limits.cpp \
60+
glslang/MachineIndependent/linkValidate.cpp \
61+
glslang/MachineIndependent/parseConst.cpp \
62+
glslang/MachineIndependent/ParseContextBase.cpp \
63+
glslang/MachineIndependent/ParseHelper.cpp \
64+
glslang/MachineIndependent/PoolAlloc.cpp \
65+
glslang/MachineIndependent/propagateNoContraction.cpp \
66+
glslang/MachineIndependent/reflection.cpp \
67+
glslang/MachineIndependent/RemoveTree.cpp \
68+
glslang/MachineIndependent/Scan.cpp \
69+
glslang/MachineIndependent/ShaderLang.cpp \
70+
glslang/MachineIndependent/SymbolTable.cpp \
71+
glslang/MachineIndependent/Versions.cpp \
72+
glslang/MachineIndependent/preprocessor/PpAtom.cpp \
73+
glslang/MachineIndependent/preprocessor/PpContext.cpp \
74+
glslang/MachineIndependent/preprocessor/Pp.cpp \
75+
glslang/MachineIndependent/preprocessor/PpScanner.cpp \
76+
glslang/MachineIndependent/preprocessor/PpTokens.cpp
77+
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
78+
$(LOCAL_PATH)/glslang/MachineIndependent \
79+
$(GLSLANG_OUT_PATH)
80+
LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL
81+
include $(BUILD_STATIC_LIBRARY)
82+
83+
include $(CLEAR_VARS)
84+
LOCAL_MODULE:=SPIRV
85+
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
86+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
87+
LOCAL_SRC_FILES:= \
88+
SPIRV/GlslangToSpv.cpp \
89+
SPIRV/InReadableOrder.cpp \
90+
SPIRV/Logger.cpp \
91+
SPIRV/SPVRemapper.cpp \
92+
SPIRV/SpvBuilder.cpp \
93+
SPIRV/SpvPostProcess.cpp \
94+
SPIRV/SpvTools.cpp \
95+
SPIRV/disassemble.cpp \
96+
SPIRV/doc.cpp
97+
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/SPIRV
98+
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/SPIRV
99+
LOCAL_STATIC_LIBRARIES:=glslang
100+
include $(BUILD_STATIC_LIBRARY)

deps/glslang/BUILD.gn

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,45 @@ source_set("glslang_sources") {
141141

142142
if (is_clang) {
143143
cflags_cc = [
144-
"-Wno-implicit-fallthrough",
144+
"-Wno-extra-semi",
145145
"-Wno-ignored-qualifiers",
146+
"-Wno-implicit-fallthrough",
147+
"-Wno-inconsistent-missing-override",
148+
"-Wno-sign-compare",
146149
"-Wno-unused-variable",
147150
]
148151
}
152+
if (is_win && !is_clang) {
153+
cflags = [
154+
"/wd4018", # signed/unsigned mismatch
155+
]
156+
}
149157

150158
deps = [
151159
"${spirv_tools_dir}:spvtools_opt",
152160
]
153161
}
162+
163+
source_set("glslang_default_resource_limits_sources") {
164+
sources = [
165+
"StandAlone/ResourceLimits.cpp",
166+
"StandAlone/ResourceLimits.h",
167+
]
168+
deps = [ ":glslang_sources" ]
169+
public_configs = [ ":glslang_public" ]
170+
}
171+
172+
source_set("glslang_validator") {
173+
sources = [
174+
"StandAlone/DirStackFileIncluder.h",
175+
"StandAlone/StandAlone.cpp",
176+
]
177+
if (!is_win) {
178+
cflags = [ "-Woverflow" ]
179+
}
180+
defines = [ "ENABLE_OPT=0" ]
181+
deps = [
182+
":glslang_default_resource_limits_sources",
183+
":glslang_sources",
184+
]
185+
}

0 commit comments

Comments
 (0)