Skip to content

Commit

Permalink
Use vk::detail::DynamicLoader instead of vk::DynamicLoader (wheremyfo…
Browse files Browse the repository at this point in the history
…odat#710)

* Use vk::detail::DynamicLoader instead of vk::DynamicLoader

* Update renderer_vk.cpp
  • Loading branch information
wheremyfoodat authored Jan 6, 2025
1 parent b559725 commit d30f264
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/core/renderer_vk/renderer_vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,17 @@ void RendererVK::display() {
}
}

// DynamicLoader is in a different namespace in different versions of Vulkan-Hpp
#if VK_HEADER_VERSION >= 301
using VulkanDynamicLoader = vk::detail::DynamicLoader
#else
using VulkanDynamicLoader = vk::DynamicLoader;
#endif

void RendererVK::initGraphicsContext(SDL_Window* window) {
targetWindow = window;
// Resolve all instance function pointers
static vk::DynamicLoader dl;
static VulkanDynamicLoader dl;
VULKAN_HPP_DEFAULT_DISPATCHER.init(dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr"));

// Create Instance
Expand Down Expand Up @@ -1588,4 +1595,4 @@ void RendererVK::deinitGraphicsContext() {

// TODO: Make it so that depth and colour buffers get written back to 3DS memory
printf("RendererVK::DeinitGraphicsContext called\n");
}
}

0 comments on commit d30f264

Please sign in to comment.