khronosgroup / vulkan-utility-libraries Goto Github PK
View Code? Open in Web Editor NEWUtility libraries for Vulkan developers
License: Other
Utility libraries for Vulkan developers
License: Other
Currently these files live in https://github.com/KhronosGroup/Vulkan-Headers
They should live here instead in the future.
Currently possible to modify python scripts and not check in new generated code. Causing a mismatch.
Or vice versa modifying the C++ code which then gets overwritten by the python scripts.
Avoid issues like this:
#81
VkPushDescriptorSetWithTemplateInfoKHR
is part of VK_KHR_maintenance6 which appeared in the 1.1.274 header.
Currently stubbed out so we can build, but it needs a custom constructor which can copy pData
correctly.
(Codegen assumed there was a dataCount
member to get the length of pData
and it failed to compile)
template<typename T> VkObjectType GetObjectType()
It is implemented for 64 bit environment (VK_USE_64_BIT_PTR_DEFINES
) but there is also a default specialization which is enabled both in 32/64 bits:
template<typename T> VkObjectType GetObjectType() {
static_assert(sizeof(T) == 0, "GetObjectType() is being used with an unsupported Type! Is the code-gen up to date?");
return VK_OBJECT_TYPE_UNKNOWN;
}
when used in 32 bit mode this error message is confusing. The suggestion is to have a separate static assert for 32 bit that will say GetObjectType<>
template is not supported and then the above version for 64 bit that will detect unsupported types.
I recently just did this for Vulkan-Headers
and it wasn't too difficult to figure out. It should be pretty easy to add to this repo as well.
Currently VulkanTools consumes VVL as a dependency:
{
"name": "Vulkan-ValidationLayers",
"url": "https://github.com/KhronosGroup/Vulkan-ValidationLayers.git",
"sub_dir": "Vulkan-ValidationLayers",
"build_dir": "Vulkan-ValidationLayers/build",
"install_dir": "Vulkan-ValidationLayers/build/install",
"commit": "e6bdb8d71409a96a4174589ea195d0dc1e920625",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
"repo_name": "Vulkan-Headers"
},
{
"var_name": "VULKAN_LOADER_INSTALL_DIR",
"repo_name": "Vulkan-Loader"
}
],
"cmake_options": [
"-DBUILD_LAYERS=OFF",
"-DBUILD_LAYER_SUPPORT_FILES=ON",
"-DUSE_ROBIN_HOOD_HASHING=OFF"
]
},
Looks like one of the GetObjectType commits on Oct 4 introduced this. Some of our builds are ok, but multiple builds are failing.
https://ci.chromium.org/ui/p/angle/builders/try/win-x86-test/15700/overview
https://logs.chromium.org/logs/angle/buildbucket/cr-buildbucket/8768076008413092417/+/u/compile/stdout
../../third_party/vulkan-deps/vulkan-utility-libraries/src/include\vulkan/utility/vk_struct_helper.hpp(1179,32): error: redefinition of 'GetObjectType<unsigned long long>'
1179 | template<> inline VkObjectType GetObjectType<VkImage>() { return VK_OBJECT_TYPE_IMAGE; }
| ^
../../third_party/vulkan-deps/vulkan-utility-libraries/src/include\vulkan/utility/vk_struct_helper.hpp(1178,32): note: previous definition is here
1178 | template<> inline VkObjectType GetObjectType<VkBuffer>() { return VK_OBJECT_TYPE_BUFFER; }
(and other errors)
See #103 for context
This shows a clear path toward standardizing compiler / linker options across our repositories and reducing a lot of duplicate CMake code.
Because the testing in this repo doesn't require an APK. We can test the executable directly 🎉 without a bunch of hassle.
Currently this file is shipped as it is for backwards compatibility to not break SDK users.
We should deprecate this file. Since it can't conform to coding standards, prefixing, etc.
It's also confusingly placed in the Vulkan include directory. Which causes confusion (KhronosGroup/Vulkan-Headers#414).
EX:
#include <vulkan/vk_enum_string_helper.h>
Also it has questionable functionality not everyone needs. The std::string
functionality in particular.
For similar scenario see this vulkan headers issue: KhronosGroup/Vulkan-Headers#316
Obviously the functionality is still useful. But we should offer something akin to
#include <vulkan/utility/vk_enum_reflection.h>
and for C++ usage (If needed).
#include <vulkan/utility/vk_enum_reflection.hpp>
A frequently requested ask from developers is these 2 files:
Instead of offering a cpp file though it should likely be header only for better adoption. And be C compatible.
Goal: Cause less trouble for @mikes-lunarg
Then spread this practice to the other repos.
VulkanUtilityLibrariesConfig.cmake
contains the following now.
# Create imported target Vulkan::LayerSettings
add_library(Vulkan::LayerSettings STATIC IMPORTED)
set_target_properties(Vulkan::LayerSettings PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN"
INTERFACE_COMPILE_OPTIONS "/W4;/we5038;/permissive-;\$<\$<BOOL:0>:/MP>"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "Vulkan::Headers"
)
# Create imported target Vulkan::UtilityHeaders
add_library(Vulkan::UtilityHeaders INTERFACE IMPORTED)
set_target_properties(Vulkan::UtilityHeaders PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN"
INTERFACE_COMPILE_OPTIONS "/W4;/we5038;/permissive-;\$<\$<BOOL:0>:/MP>"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "Vulkan::Headers"
)
This was added in a3235b3 by @christophe-lunarg.
FYI @charles-lunarg
Currently this header file is generated in the vulkan validation layers. The code generation will be moved here instead.
The ultimate goal of this repo is that the validation layers will no longer need to install header/source files anymore.
The vulkan validation layer repo was never meant for shipping header / source files.
It's only deliverables are a shared library, and a json file. All other files are unintended artifacts resulting from the days everything was in a mono repo.
Instead of the validation layers facilitating code sharing across vulkan repos, it will now be the responsibility of the utility libraries.
This is better for all parties since validation layers developers won't have to worry about unintentionally breaking downstream users. And users get proper source deliverables.
I'm getting a lot of undeclared identifier errors and duplicate case value errors when I try to use the headers (vk_enum_string_helper.h and utility/vk_format_utils.h) from Vulkan Utilities as opposed the system installed headers. Have I done something wrong here, or is there something else I need to include and/or configure? In this case I am compiling for Android.
vk_enum_string_helper.h
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android33 -DLANCZOS_TYPE="" -I/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include -I/Users/rrauwend/test_project/C -I"/Program Files/RenderDoc" -I/Users/rrauwend/test_project/. -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -g -fno-limit-debug-info -std=gnu++20 -MD -MT CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o -MF CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o.d -o CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o -c /Users/rrauwend/test_project/src/main.cpp
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:81:14: error: use of undeclared identifier 'VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR'
case VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:83:14: error: use of undeclared identifier 'VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR'
case VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:85:14: error: use of undeclared identifier 'VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR'
case VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:87:14: error: use of undeclared identifier 'VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR'
case VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:89:14: error: use of undeclared identifier 'VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR'
case VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:91:14: error: use of undeclared identifier 'VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR'
case VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:107:14: error: use of undeclared identifier 'VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR'
case VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:111:14: error: use of undeclared identifier 'VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT'
case VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:593:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:851:5: note: 'VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR' declared here
VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR = 1000269001,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:595:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR'; did you mean 'VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:669:5: note: 'VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR' declared here
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:597:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1166:5: note: 'VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR' declared here
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:599:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR'
case VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:601:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR'
case VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:603:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:440:5: note: 'VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR' declared here
VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:605:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:712:5: note: 'VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR' declared here
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = 1000150017,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:607:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:712:5: note: 'VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR' declared here
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = 1000150017,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:609:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR'
case VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:611:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR'; did you mean 'VK_STRUCTURE_TYPE_RENDERING_INFO_KHR'?
case VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_STRUCTURE_TYPE_RENDERING_INFO_KHR
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1081:5: note: 'VK_STRUCTURE_TYPE_RENDERING_INFO_KHR' declared here
VK_STRUCTURE_TYPE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INFO,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:2:
In file included from /Users/rrauwend/test_project/./util/vkUtil.h:13:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/vk_enum_string_helper.h:613:14: error: use of undeclared identifier 'VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR'
case VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR:
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
vk_format_utils.h
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android33 -DLANCZOS_TYPE="" -I/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include -I/Users/rrauwend/test_project/C -I"/Program Files/RenderDoc" -I/Users/rrauwend/test_project/. -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -g -fno-limit-debug-info -std=gnu++20 -MD -MT CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o -MF CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o.d -o CMakeFiles/test_project32_debug_android.dir/src/main.cpp.o -c /Users/rrauwend/test_project/src/main.cpp
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:379:14: error: use of undeclared identifier 'VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR'; did you mean 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'?
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR: {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_A1R5G5B5_UNORM_PACK16
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1404:5: note: 'VK_FORMAT_A1R5G5B5_UNORM_PACK16' declared here
VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:382:14: error: use of undeclared identifier 'VK_FORMAT_A8_UNORM_KHR'; did you mean 'VK_FORMAT_R8_UNORM'?
case VK_FORMAT_A8_UNORM_KHR: {
^~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_R8_UNORM
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1405:5: note: 'VK_FORMAT_R8_UNORM' declared here
VK_FORMAT_R8_UNORM = 9,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:379:14: error: duplicate case value 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR: {
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:376:14: note: previous case defined here
case VK_FORMAT_A1R5G5B5_UNORM_PACK16: {
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:385:14: error: duplicate case value 'VK_FORMAT_R8_UNORM'
case VK_FORMAT_R8_UNORM: {
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:382:14: note: previous case defined here
case VK_FORMAT_A8_UNORM_KHR: {
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1415:14: error: use of undeclared identifier 'VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR'; did you mean 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'?
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_A1R5G5B5_UNORM_PACK16
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1404:5: note: 'VK_FORMAT_A1R5G5B5_UNORM_PACK16' declared here
VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1416:14: error: use of undeclared identifier 'VK_FORMAT_A8_UNORM_KHR'; did you mean 'VK_FORMAT_R8_UNORM'?
case VK_FORMAT_A8_UNORM_KHR:
^~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_R8_UNORM
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1405:5: note: 'VK_FORMAT_R8_UNORM' declared here
VK_FORMAT_R8_UNORM = 9,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1415:14: error: duplicate case value 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1414:14: note: previous case defined here
case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1417:14: error: duplicate case value 'VK_FORMAT_R8_UNORM'
case VK_FORMAT_R8_UNORM:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1416:14: note: previous case defined here
case VK_FORMAT_A8_UNORM_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1800:14: error: use of undeclared identifier 'VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR'; did you mean 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'?
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_A1R5G5B5_UNORM_PACK16
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1404:5: note: 'VK_FORMAT_A1R5G5B5_UNORM_PACK16' declared here
VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1800:14: error: duplicate case value 'VK_FORMAT_A1R5G5B5_UNORM_PACK16'
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:1799:14: note: previous case defined here
case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:2069:14: error: use of undeclared identifier 'VK_FORMAT_A8_UNORM_KHR'; did you mean 'VK_FORMAT_R8_UNORM'?
case VK_FORMAT_A8_UNORM_KHR:
^~~~~~~~~~~~~~~~~~~~~~
VK_FORMAT_R8_UNORM
/Users/rrauwend/Library/Android/sdk/ndk/26.1.10909125//toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/include/vulkan/vulkan_core.h:1405:5: note: 'VK_FORMAT_R8_UNORM' declared here
VK_FORMAT_R8_UNORM = 9,
^
In file included from /Users/rrauwend/test_project/src/main.cpp:8:
In file included from /Users/rrauwend/test_project/./util/vkPrintPixelUtil.h:7:
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:2070:14: error: duplicate case value 'VK_FORMAT_R8_UNORM'
case VK_FORMAT_R8_UNORM:
^
/Users/rrauwend/test_project/./util/ext/Vulkan-Utility-Libraries/include/vulkan/utility/vk_format_utils.h:2069:14: note: previous case defined here
case VK_FORMAT_A8_UNORM_KHR:
^
12 errors generated.
ninja: build stopped: subcommand failed.
In order to avoid adding another build system to the utility libraries, I've been working on completely removing the Android.mk build system from the validation layers.
This will make the work much simpler for the utility libraries moving forward.
We need to be a lot more careful of how we deliver things for the Vulkan SDK.
Currently only vk_enum_string_helper.h and vk_format_utils.h should be shipped for now.
Due to CMake's built in clang-tidy functionality only working on Ninja / Makefile generators using the built in functionality is problematic.
However, it's still straightforward to make sure that at the least the files we are installing follow proper conventions and coding guidelines.
IE the header files we ship will be consistent in quality. With the exception of vk_enum_string_helper.h due to legacy reasons.
Some application vendors configure the validation layer programmatically (i.e. via switches like -vulkan_enable_validation -vulkan_enable_sync_validation
etc.).
For local analysis, it would be very helpful to know exactly how the validation layer is actually being configured in these cases.
Defining an environment variable VK_VALIDATION_SAVE_SETTINGS=/path/to/file/to/save/settings
that caused VVL to write a settings file to the given location would make it easy.
Disclaimer: I am not an expert on CMake usage.
TL;DR: Acquiring this library with FetchContent
prevents Vulkan SDK from building.
I took the example from tests/add_subdirectory
and modified it to use FetchContent
instead of add_subdirectory
. Running this works, but when you add a call to find_package
, it fails:
CMake Error at CMakeLists.txt:34 (find_package):
By not providing "FindVulkanUtilityLibraries.cmake" in CMAKE_MODULE_PATH
this project has asked CMake to find a package configuration file provided
by "VulkanUtilityLibraries", but CMake did not find one.
Could not find a package configuration file provided by
"VulkanUtilityLibraries" with any of the following names:
VulkanUtilityLibrariesConfig.cmake
vulkanutilitylibraries-config.cmake
Add the installation prefix of "VulkanUtilityLibraries" to
CMAKE_PREFIX_PATH or set "VulkanUtilityLibraries_DIR" to a directory
containing one of the above files. If "VulkanUtilityLibraries" provides a
separate development package or SDK, be sure it has been installed.
This is important, because most projects, like the Vulkan SDK, will use find_package
to locate this library. So, projects that use FetchContent
for their Vulkan dependencies do not work.
I don't know how to solve this yet. I'm looking into this answer to figure out what may need to be done. Any help would be appreciated.
Command used to run sample: cmake -B build -G Ninja && cmake --build build
Modified CMakeLists.txt
:
# Copyright 2023 The Khronos Group Inc. Copyright 2023 Valve Corporation
# Copyright 2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Modified by Tyler Kropp
cmake_minimum_required(VERSION 3.17)
project(TEST_ADD_SUBDIRECTORY LANGUAGES C)
add_library(add_subdirectory_example STATIC)
# Test c99 support
target_compile_features(add_subdirectory_example PRIVATE c_std_99)
target_sources(add_subdirectory_example
PRIVATE client.c vk_enum_string_helper.c vul_dispatch_table.c)
include(FetchContent)
FetchContent_Declare(
vulkan-headers
GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Headers.git"
GIT_TAG "2634c96" # latest as of writing
)
FetchContent_Declare(
vulkan-utility
GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git"
GIT_TAG "87801a6" # latest as of writing
)
FetchContent_MakeAvailable(vulkan-headers vulkan-utility)
# Vulkan SDK uses find_package to look for this library
find_package(VulkanUtilityLibraries REQUIRED) # <<< this call fails
if(NOT TARGET Vulkan::LayerSettings)
message(FATAL_ERROR "Vulkan::LayerSettings target not defined!")
endif()
if(NOT TARGET Vulkan::UtilityHeaders)
message(FATAL_ERROR "Vulkan::UtilityHeaders target not defined!")
endif()
target_link_libraries(add_subdirectory_example PRIVATE Vulkan::LayerSettings
Vulkan::UtilityHeaders)
Both VVL and VEL use very similar generated code:
VVL
VEL
Investigate the support of either flags or string flags to be passed using VK_EXT_layer_settings
for the same setting.
Under no circumstances should .clang-format be installed.
install
├───include
│ └───vulkan
│ │ vk_enum_string_helper.h
│ │
│ ├───layer
│ │ vk_layer_settings.h
│ │ vk_layer_settings.hpp
│ │ vk_layer_settings_ext.h
│ │
│ └───utility
│ .clang-format
│ vk_dispatch_table.h
│ vk_format_utils.h
│ vk_struct_helper.hpp
│
└───lib
│ VulkanLayerSettings.lib
│
└───cmake
└───VulkanUtilityLibraries
VulkanUtilityLibrariesConfig-relwithdebinfo.cmake
VulkanUtilityLibrariesConfig.cmake
In Mesa CI, we run VVL with khronos_validation.message_id_filter = <a billion exceptions>
. This has to be on a single line, which is annoying since it both scrolls way offscreen and doesn't allow for documentation.
I'd like to see this improved so I could do something like
# comment explaining
khronos_validation.message_id_filter =
# comment explaining
khronos_validation.message_id_filter += VUID1
# comment explaining
khronos_validation.message_id_filter += VUID2
# comment explaining
khronos_validation.message_id_filter += VUID3
PS D:\projects\vul> git diff
warning: in the working copy of 'include/vulkan/utility/vk_dispatch_table.h', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'include/vulkan/utility/vk_format_utils.h', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'include/vulkan/vk_enum_string_helper.h', LF will be replaced by CRLF the next time Git touches it
See how VVL currently deals with this:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/1b0a375df5f724b870868d678b7ac4bf71344ed0/.gitattributes#L17
Instead of -D VUL_WERROR=ON -D BUILD_TESTS=ON -D UPDATE_DEPS=ON
etc.
Have 1 build option that sets it all up.
-D VLK_DEV=ON
IE the intent is to streamline the workflow for developers.
All public facing headers should use the vku prefix for functions, structs, etc.
With the exception of vk_enum_string_helper.h
see #96 for rational. And vk_layer_settings_ext.h
which will eventually be added to vulkan headers.
In order to integrate this repo into VVL this repo will require chromium build
FYI @mikes-lunarg
Blocker for: KhronosGroup/Vulkan-ValidationLayers#6088
Context:
KhronosGroup/Vulkan-Profiles#399 (comment)
Note in order to fully remove the dependency on the validation layers it looks like we need to add functionality that covers:
Since KhronosGroup/Vulkan-ValidationLayers@3348709 which is included in v1.3.263 this is a requirement to build Vulkan-ValidationLayers now, however essential parts are missing, no tag, no proper description in README.md or Project "About". It would have been really nice to have had these things addressed before tagging a new version depending on it.
The computation for the size of the buffer used to store a copy of the source host buffer is dubious, especially because the memcpy used to be wrong. It needs investigation.
A recent issue was only present in 32 bit builds, which the CI for this repo lacks.
The primary 32 bit platform is Windows, so I recommend only adding 32 bit builds for that platform. Apple lacks it, and its very rare on linux. Not sure about Android, since I don't have a great grasp of the ecosystem there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.