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

Heads-up re vk::DynamicLoader namespace change in vulkan.hpp >= v301 #1269

Open
SRSaunders opened this issue Feb 3, 2025 · 0 comments · May be fixed by #1281
Open

Heads-up re vk::DynamicLoader namespace change in vulkan.hpp >= v301 #1269

SRSaunders opened this issue Feb 3, 2025 · 0 comments · May be fixed by #1281

Comments

@SRSaunders
Copy link
Contributor

SRSaunders commented Feb 3, 2025

Starting with VK_HEADER_VERSION >= 301, there is a namespace change for DynamicLoader which will affect vulkan_sample.h and hpp_hello_triangle.cpp in this project:

vk::DynamicLoader becomes vk::detail::DynamicLoader, and project build will fail once Vulkan Headers are updated to this new version or later.

In a different project I will likely use the following code to address this:

#if VK_HEADER_VERSION >= 301
	using VulkanDynamicLoader = vk::detail::DynamicLoader;
#else
	using VulkanDynamicLoader = vk::DynamicLoader;
#endif

I am not sure if the project team is aware or preparing for this change, or if this is even the correct way to handle it. I would be interested in feedback since I believe @asuessenbach made this change in the Vulkan-Hpp project.

Also I noticed that VK_HEADER_VERSION >= 304 brings another change:

vk::DebugReportCallbackCreateInfoEXT() now wants a callback type of vk::PFN_DebugReportCallbackEXT vs PFN_vkDebugReportCallbackEXT (which is now deprecated). This is a non-breaking change, but to eliminate the deprecation warning and retain backwards compatibility for earlier SDKs, you will have to convert the callback to vk::Bool32, etc. and do something like this in hpp_instance.cpp:

debug_report_create_info = vk::DebugReportCallbackCreateInfoEXT()
...
#if VK_HEADER_VERSION >= 304
	.setPfnCallback( debug_callback )
#else
	.setPfnCallback( reinterpret_cast<PFN_vkDebugReportCallbackEXT>( debug_callback ) )
#endif
...
@asuessenbach asuessenbach linked a pull request Feb 25, 2025 that will close this issue
20 tasks
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

Successfully merging a pull request may close this issue.

1 participant