ndk
ndk copied to clipboard
[FR] Include vulkan/vulkan.hpp C++ wrappers
The vulkan header files included in <ndk-root>/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/vulkan do not include the vulkan.hpp C++ wrapper.
The feature request is to add a vulkan.hpp header file compatible with the Vulkan version used by the NDK.
Additional context
Currently in NDK r19c and r20-beta1, there is a vulkan.hpp header at <ndk-root>/sources/third_party/vulkan/src/include/vulkan. However, this header file is not compatible with the C header file included in <ndk-root>/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/vulkan as the header versions are different.
For NDK r19c, the C header at <ndk-root>/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/vulkan/vulkan.h, line 46 dfines:
// Version of this file
#define VK_HEADER_VERSION 82
while the C++ wrapper at <ndk-root>/sources/third_party/vulkan/src/include/vulkan/vulkan.hpp, line 39, expects a different version:
static_assert( VK_HEADER_VERSION == 69 , "Wrong VK_HEADER_VERSION!" );
Using this wrapper version will trigger the static_assert.
Alternative solutions
One alternative solution is to copy the compatible vulkan.hpp from the LunarG SDK to <ndk-root>/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/vulkan/. For NDK r19c, LunarG 1.1.82.1 contains a compatible header.
(I'll leave this open to track the work since I'm currently collecting a handful of "please make an AAR for this" requests here, but just FYI that this won't actually be tied to any particular NDK release)