Skip to content

Commit

Permalink
Merge pull request #140 from GPUOpen-LibrariesAndSDKs/update_wk10
Browse files Browse the repository at this point in the history
Update for wk10 / 2019
  • Loading branch information
DominikWitczakAMD authored Mar 8, 2019
2 parents 6613abc + 806e937 commit ec941d5
Show file tree
Hide file tree
Showing 553 changed files with 25,583 additions and 9,066 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (NOT ANVIL_LINK_STATICALLY_WITH_VULKAN_LIB)
endif()

# Do not modify anything after this line, unless you know what you're doing.

configure_file("include/config.h.in" "include/config.h")

include_directories("${Anvil_BINARY_DIR}/include"
Expand Down Expand Up @@ -65,7 +66,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/include/misc/debug.h"
"${Anvil_SOURCE_DIR}/include/misc/debug_marker.h"
"${Anvil_SOURCE_DIR}/include/misc/debug_messenger_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/descriptor_pool_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/device_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/dummy_window.h"
"${Anvil_SOURCE_DIR}/include/misc/event_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/extensions.h"
Expand All @@ -88,7 +91,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/include/misc/pools.h"
"${Anvil_SOURCE_DIR}/include/misc/ref_counter.h"
"${Anvil_SOURCE_DIR}/include/misc/render_pass_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/rendering_surface_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/sampler_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/sampler_ycbcr_conversion_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/semaphore_create_info.h"
"${Anvil_SOURCE_DIR}/include/misc/shader_module_cache.h"
"${Anvil_SOURCE_DIR}/include/misc/struct_chainer.h"
Expand Down Expand Up @@ -133,6 +138,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/include/wrappers/render_pass.h"
"${Anvil_SOURCE_DIR}/include/wrappers/rendering_surface.h"
"${Anvil_SOURCE_DIR}/include/wrappers/sampler.h"
"${Anvil_SOURCE_DIR}/include/wrappers/sampler_ycbcr_conversion.h"
"${Anvil_SOURCE_DIR}/include/wrappers/semaphore.h"
"${Anvil_SOURCE_DIR}/include/wrappers/shader_module.h"
"${Anvil_SOURCE_DIR}/include/wrappers/swapchain.h"
Expand All @@ -147,7 +153,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/src/misc/debug.cpp"
"${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp"
"${Anvil_SOURCE_DIR}/src/misc/debug_messenger_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/descriptor_pool_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/device_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp"
"${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp"
"${Anvil_SOURCE_DIR}/src/misc/event_create_info.cpp"
Expand All @@ -167,7 +175,9 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/src/misc/page_tracker.cpp"
"${Anvil_SOURCE_DIR}/src/misc/pools.cpp"
"${Anvil_SOURCE_DIR}/src/misc/render_pass_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/rendering_surface_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/sampler_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/sampler_ycbcr_conversion_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/semaphore_create_info.cpp"
"${Anvil_SOURCE_DIR}/src/misc/shader_module_cache.cpp"
"${Anvil_SOURCE_DIR}/src/misc/swapchain_create_info.cpp"
Expand Down Expand Up @@ -209,12 +219,14 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
"${Anvil_SOURCE_DIR}/src/wrappers/render_pass.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/rendering_surface.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/sampler.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/sampler_ycbcr_conversion.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/semaphore.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/shader_module.cpp"
"${Anvil_SOURCE_DIR}/src/wrappers/swapchain.cpp"

# Vulkan Memory Allocator dependency
"${Anvil_SOURCE_DIR}/deps/VulkanMemoryAllocator/vk_mem_alloc.h"
# <--
)

if (ANVIL_LINK_WITH_GLSLANG)
Expand All @@ -231,8 +243,7 @@ if(WIN32)
endif()
else()
if (ANVIL_INCLUDE_XCB_WINDOW_SYSTEM_SUPPORT)
list (APPEND SRC_LIST
"${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h"
list (APPEND SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/xcb_loader.h"
"${Anvil_SOURCE_DIR}/src/misc/xcb_loader.cpp"
"${Anvil_SOURCE_DIR}/include/misc/window_xcb.h"
"${Anvil_SOURCE_DIR}/src/misc/window_xcb.cpp")
Expand All @@ -246,7 +257,7 @@ if (WIN32)
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY})
else()
target_link_libraries(Anvil ${VULKAN_LIBRARY})
endif()
endif()
else()
if (ANVIL_LINK_WITH_GLSLANG)
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread)
Expand All @@ -273,7 +284,6 @@ if (ANVIL_LINK_WITH_GLSLANG)
endif()
endif()


if (ANVIL_LINK_EXAMPLES)
add_subdirectory("examples/DynamicBuffers")
add_subdirectory("examples/MultiViewport")
Expand Down
78 changes: 11 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Anvil

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

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

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

The general idea we started from was to have a cross-platform tool, which would
reduce the amount of time required to write portable Vulkan-based apps from
Expand All @@ -34,16 +35,10 @@ Anvil was designed with the following goals in mind:
using Vulkan, without hiding the API behind thick abstraction layers.
- Simplify validation layer usage. All you have to do is specify which function
you would like to be called if a debug call-back is made, and that's it.
- Provide a reasonable level of deferred approach to baking objects, in order
to emulate mutability of certain Vulkan objects to a certain degree. Note
that this is an optional feature - you are free to request baking of any
object at any time, in order to ensure it will never happen at draw time.
- Provide a simple cross-platform implementation for areas unrelated to Vulkan
(eg. window management)

Anvil can be thought of as a toolbox. You are free to use any of its parts you
like, and write your own code for everything else. Any Anvil wrapper for an
actual Vulkan object can be queried to retrieve the raw Vulkan handle.
- Provide a simple way (with optional flexibility) to manage memory allocations
and memory bindings.

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

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

What can it do?
------
This version of Anvil provides:

* Low-level ref-counted wrappers for the following Vulkan v1.0 features:
- Buffer objects (sparse and non-sparse)
- Buffer views
- Command buffers
- Command pools
- Descriptor pools
- Descriptor sets
- Descriptor set layouts
- Devices
- Events
- Fences
- Framebuffers
- Image objects (sparse, sparse bindings, PRT)
- Image views
- Instances
- Physical devices
- Pipeline cache
- Pipeline layouts
- Query pools
- Queues
- Renderpasses
- Rendering surfaces
- Samplers
- Semaphores
- Shader modules
- Swapchains

* More complicated wrappers:
- Compute / graphics pipeline managers: provide a way to create regular/derivative pipelines with automatic pipeline layout re-use.
- Descriptor set groups: simplify descriptor set configuration, management and updates.
- Memory allocator: implements a memory allocator with two back-ends: one that is more appropriate for one-shot
mem alloc requests, and one that can be used for dynamic memory allocation purposes.
- Pipeline layout manager: caches all created pipeline layouts to avoid instantiating duplicate layout instances.

* Miscellaneous functionality:
- Debug markers: names and tags can be optionally assigned to any of the created objects. If VK_EXT_debug_marker is enabled, these
will be automatically patched through to layers that implement the extension on the running platform.
- Format info reflection: provides information about format properties.
- 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.
- 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
been converted to SPIR-V before.
- IO: provides a number of functions to simplify directory- and file-related operations.
- Object tracker: tracks object allocations and helps detect object leakage.
- Shader module cache: re-uses shader module instances across Instance lifetime. Improve execution time if your application instantiates shader modules with
exactly the same configuration during its runtime.
- Time: provides a way to query current time using high-performance system queries.
Anvil provides full support for functionality exposed in Vulkan 1.0 and Vulkan 1.1.
We also try to do our best to keep it up to date with any extensions our Vulkan implementations
expose.

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

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

What are the known issues?
------
Just a handful:
* All command queues are currently assigned a priority of 1.0.
* DescriptorSetGroup wrapper does not leverage the <releaseable_sets> flag at
baking time.

These will be addressed at some point in the future.
Please observe the "Issues" tab for more details.

Who made it?
------
Expand Down
14 changes: 7 additions & 7 deletions deps/glslang/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
*.txt text

# source code can be native and normalized, but simpler if lf everywhere; will try that way
*.h text eof=lf
*.c text eof=lf
*.cpp text eof=lf
*.y text eof=lf
*.out text eof=lf
*.conf text eof=lf
*.err text eof=lf
*.h text eol=lf
*.c text eol=lf
*.cpp text eol=lf
*.y text eol=lf
*.out text eol=lf
*.conf text eol=lf
*.err text eol=lf
100 changes: 100 additions & 0 deletions deps/glslang/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
LOCAL_PATH := $(call my-dir)

GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
# AMD and NV extensions are turned on by default in upstream Glslang.
GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS)

include $(CLEAR_VARS)
LOCAL_MODULE:=OSDependent
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:=OGLCompiler
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
LOCAL_STATIC_LIBRARIES:=OSDependent
include $(BUILD_STATIC_LIBRARY)

# Build Glslang's HLSL parser library.
include $(CLEAR_VARS)
LOCAL_MODULE:=HLSL
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_SRC_FILES:= \
hlsl/hlslAttributes.cpp \
hlsl/hlslGrammar.cpp \
hlsl/hlslOpMap.cpp \
hlsl/hlslParseables.cpp \
hlsl/hlslParseHelper.cpp \
hlsl/hlslScanContext.cpp \
hlsl/hlslTokenStream.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
$(LOCAL_PATH)/hlsl
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))

LOCAL_MODULE:=glslang
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:= \
glslang/GenericCodeGen/CodeGen.cpp \
glslang/GenericCodeGen/Link.cpp \
glslang/MachineIndependent/attribute.cpp \
glslang/MachineIndependent/Constant.cpp \
glslang/MachineIndependent/glslang_tab.cpp \
glslang/MachineIndependent/InfoSink.cpp \
glslang/MachineIndependent/Initialize.cpp \
glslang/MachineIndependent/Intermediate.cpp \
glslang/MachineIndependent/intermOut.cpp \
glslang/MachineIndependent/IntermTraverse.cpp \
glslang/MachineIndependent/iomapper.cpp \
glslang/MachineIndependent/limits.cpp \
glslang/MachineIndependent/linkValidate.cpp \
glslang/MachineIndependent/parseConst.cpp \
glslang/MachineIndependent/ParseContextBase.cpp \
glslang/MachineIndependent/ParseHelper.cpp \
glslang/MachineIndependent/PoolAlloc.cpp \
glslang/MachineIndependent/propagateNoContraction.cpp \
glslang/MachineIndependent/reflection.cpp \
glslang/MachineIndependent/RemoveTree.cpp \
glslang/MachineIndependent/Scan.cpp \
glslang/MachineIndependent/ShaderLang.cpp \
glslang/MachineIndependent/SymbolTable.cpp \
glslang/MachineIndependent/Versions.cpp \
glslang/MachineIndependent/preprocessor/PpAtom.cpp \
glslang/MachineIndependent/preprocessor/PpContext.cpp \
glslang/MachineIndependent/preprocessor/Pp.cpp \
glslang/MachineIndependent/preprocessor/PpScanner.cpp \
glslang/MachineIndependent/preprocessor/PpTokens.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
$(LOCAL_PATH)/glslang/MachineIndependent \
$(GLSLANG_OUT_PATH)
LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:=SPIRV
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:= \
SPIRV/GlslangToSpv.cpp \
SPIRV/InReadableOrder.cpp \
SPIRV/Logger.cpp \
SPIRV/SPVRemapper.cpp \
SPIRV/SpvBuilder.cpp \
SPIRV/SpvPostProcess.cpp \
SPIRV/SpvTools.cpp \
SPIRV/disassemble.cpp \
SPIRV/doc.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/SPIRV
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/SPIRV
LOCAL_STATIC_LIBRARIES:=glslang
include $(BUILD_STATIC_LIBRARY)
34 changes: 33 additions & 1 deletion deps/glslang/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,45 @@ source_set("glslang_sources") {

if (is_clang) {
cflags_cc = [
"-Wno-implicit-fallthrough",
"-Wno-extra-semi",
"-Wno-ignored-qualifiers",
"-Wno-implicit-fallthrough",
"-Wno-inconsistent-missing-override",
"-Wno-sign-compare",
"-Wno-unused-variable",
]
}
if (is_win && !is_clang) {
cflags = [
"/wd4018", # signed/unsigned mismatch
]
}

deps = [
"${spirv_tools_dir}:spvtools_opt",
]
}

source_set("glslang_default_resource_limits_sources") {
sources = [
"StandAlone/ResourceLimits.cpp",
"StandAlone/ResourceLimits.h",
]
deps = [ ":glslang_sources" ]
public_configs = [ ":glslang_public" ]
}

source_set("glslang_validator") {
sources = [
"StandAlone/DirStackFileIncluder.h",
"StandAlone/StandAlone.cpp",
]
if (!is_win) {
cflags = [ "-Woverflow" ]
}
defines = [ "ENABLE_OPT=0" ]
deps = [
":glslang_default_resource_limits_sources",
":glslang_sources",
]
}
Loading

0 comments on commit ec941d5

Please sign in to comment.