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

Add a way to force use of the static loader, even with VK_NO_PROTOTYPES #1705

Open
HildarTheDorf opened this issue Oct 18, 2023 · 1 comment

Comments

@HildarTheDorf
Copy link

HildarTheDorf commented Oct 18, 2023

I was trying to use vulkan.hpp in an application that already uses volk.h for function loading.
By including volk.h, but then undefining VK_NO_PROTOTYPES, I can make the vulkan.hpp static loader be defined and used by default, and consume the volk function pointers. Doing it this way feels wrong, as I still want vulkan.h to not define prototypes if it's included again.

I'm not sure exactly what define should trigger the definition of the static loader, but my suggestion would be #if !defined( VK_NO_PROTOTYPES ) || (defined(VULKAN_HPP_DISPATCH_LOADER_DYNAMIC) && VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 0).
Currently VK_NO_PROTOTYPES being defined and VULKAN_HPP_DISPATCH_LOADER_DYNAMIC being defined to 0 results in a header that fails to compile as vk::DispatchLoaderStatic is referenced but not defined.

@asuessenbach
Copy link
Contributor

Would you mind to provide a PR with a change that runs with your environment?

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

No branches or pull requests

2 participants