Vulkan-Hpp
Vulkan-Hpp copied to clipboard
C++20 Module: Fixing dynamic dispatch on Windows MSVC
Under Windows, we need to export the defaultDispatchLoaderDynamic symbol, as simply importing vulkan_hpp will not provide it without including the macro header in every .cppm file that imports vulkan_hpp. I'm actually suprised it worked under Clang. It wasn't caught by the tests, as they manually include vulkan_hpp_macros.hpp for dynamic storage, so the symbol will always be present in that single .cppm source.
This also enables the storage placement with modules to be handled without the macro header inclusion:
import vulkan_hpp;
namespace vk::detail {
DispatchLoaderDynamic defaultDispatchLoaderDynamic;
}