Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared Identifiers & duplicate case values #178

Open
randallrvr opened this issue Jan 17, 2024 · 14 comments
Open

Undeclared Identifiers & duplicate case values #178

randallrvr opened this issue Jan 17, 2024 · 14 comments

Comments

@randallrvr
Copy link

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.
@ziga-lunarg
Copy link
Contributor

Which version of Vulkan-Headers are you using? It looks to me like your version is older than 1.3.275, which is the current version that Vulkan-Utility-Libraries are using.

The enums in your error messages are only found in the latest Vulkan-Headers.

@randallrvr
Copy link
Author

I believe its 1.3.268, whatever was installed with the SDK. Do I have use the headers from the Vulkan-Headers repo in order to get the Vulkan-Utility-Libraries to work?

@randallrvr
Copy link
Author

I see that a new SDK was released same day as my question, I've updated, but it doesn't help with my Android builds which are utilizing the headers inside the NDK which are still at 1.3.237 on the latest release. Should I be redirecting my builds to use different headers?

@ziga-lunarg
Copy link
Contributor

I think you will have to use the headers that come with the SDK, the only alternative I see is that you build the repository yourself with the header version you want. The tags on this repository only go down to 1.3.250, as before it didn't exist.

@randallrvr
Copy link
Author

That's too bad, I was primarily wanting to use vk_format_utils.h, which has few enough errors I've just made a local copy and #ifdef'd out the troublesome defines.
There's way too many in vk_format_utils.h to do the same there, though I am assuming these files are auto-generated? Perhaps it would be a good idea to auto-generate #ifdef guards, would increase version compatibility at the cost of readability, but I'm not sure how interesting it is to read a giant switch statement.

@ziga-lunarg
Copy link
Contributor

The filed are auto-generated, but I don't know what you mean with the #ifdefs. You can just set the header version you want in scripts/known_good.json and generate the files, and you will have only the extensions for you header version.

@randallrvr
Copy link
Author

I just mean, putting #ifdef's around #define's that were not actually defined, e.g.

#ifdef VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR
        case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR: {
            struct VKU_FORMAT_INFO out = {VKU_FORMAT_COMPATIBILITY_CLASS_16BIT, 2, 1, {1, 1, 1}, 4, {{VKU_FORMAT_COMPONENT_TYPE_A, 1}, {VKU_FORMAT_COMPONENT_TYPE_B, 5}, {VKU_FORMAT_COMPONENT_TYPE_G, 5}, {VKU_FORMAT_COMPONENT_TYPE_R, 5}}};
            return out; }
#endif

Having to generate these headers to each version of an SDK is going to severely limit ability to distribute them.

@charles-lunarg
Copy link
Collaborator

If you are getting Vulkan-Utility-Libraries from github, then you should also be getting the Vulkan-Headers from github. That way you'll have the latest version and all of these versioning issues go away.

Having to generate these headers to each version of an SDK is going to severely limit ability to distribute them.

This library requires a specific header version (or higher) to function, which is located in the scripts/known_good.json Vulkan-Headers object. While it is possible to add ifdefs to every declaration, I can tell you that its not as simple as that, as there are a number of situations that make the logic complex, or when the API was changed (typically, a major mistake in a new extension gets fixed before people start using it).

@randallrvr
Copy link
Author

If you are getting Vulkan-Utility-Libraries from github, then you should also be getting the Vulkan-Headers from github

This goes back to my earlier question, is this still true for Android development?
Should I be using the headers from Vulkan-Headers over the headers shipped with latest NDK which are still at 1.3.237?

@charles-lunarg
Copy link
Collaborator

Yes, that is my understanding. The headers are just header code and should be backwards compatible (and generally are for applications, its libraries trying to allow using of multiple header versions that get broken).

@randallrvr
Copy link
Author

Got it, thanks, I'll have to give a try then.

@charles-lunarg
Copy link
Collaborator

For more context, this is the code-gen file I use to generate a dispatch table for vk-bootstrap. https://github.com/charles-lunarg/vk-bootstrap/blob/0af4cb5055a4a3a841d5dd42afa20f294c87ea7c/script/generate_dispatch.py#L106

Since the API added functions to extensions after the extension was released (like, extension version 1 added a new function) I couldn't just use ifdef to guard the function, but had to special case them as I found them. The other case was that a function changed its parameters in a subsequent header update (which is valid, the old parameters were a mistake). Just causes pain for me where there isn't an easy way to detect such a case in vk.xml.

On top of that, there is extensive logic to figure out the exact combinations of ifdef's to use, as some things came come from a vulkan version or an extension (and sometimes both???) which gets very confusing.

@randallrvr
Copy link
Author

Is the intention that people use Vulkan-Utility-Libraries instead of the files included with SDKs? My main motivation was to avoid the platform #ifdef that was required because vk_enum_string_helper.h was missing from the Android ndk.

@charles-lunarg
Copy link
Collaborator

Is the intention that people use Vulkan-Utility-Libraries instead of the files included with SDKs?

The answer to this question depends on how you are grabbing dependencies. The SDK includes some of the headers in this repo, although not all of them from the looks of it. It is a new repo, only being created around 1.3.250 header timeframe, so there aren't versions older than this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants