YaaZ / VulkanMemoryAllocator-Hpp

C++ bindings for VulkanMemoryAllocator
Creative Commons Zero v1.0 Universal
55 stars 29 forks source link

add support for using Vulkan-Hpp C++20 module #43

Open qbojj opened 2 months ago

qbojj commented 2 months ago

Closes: #33

I have found a way to add support for pulling vulkan-hpp as a module.

I have also changed CMakeLists to test this solution.

VMA_BUILD_CXX_MODULE builds the module and VMA_BUILD_WITH_VULKAN_MODULE uses vulkan module as a dependency.

As Vulkan-Hpp (or CMake) is yet to supply a stable module installation, those changes are not meant to be installed but to showcase the usage.

qbojj commented 2 months ago

There are currently 2 problems:

I will see what is happening with the second case when the first part gets fixed

qbojj commented 1 month ago

As it is planned to totally remove vk::detail:: from c++ module (https://github.com/KhronosGroup/Vulkan-Hpp/pull/1931) i have pulled the required functions into this repo. The worst part of it is throwResultException but we could strip it of any error codes that are not going to be returned from VMA, but for now I have just pulled the current implementation.

Also currently getDispatchLoaderStatic is not exported and it looks like it may also be pulled into the detail (https://github.com/KhronosGroup/Vulkan-Hpp/issues/1927). As such I have removed the only instance of project (potentially) referencing it: default parameter of functionsFromDispatcher.