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

vk::DispatchLoaderDynamic::init(vk::VkInstance) overwrites vkGetInstanceProcAddr with NULL #1108

Closed
dneto0 opened this issue Oct 22, 2021 · 1 comment · Fixed by #1109
Closed

Comments

@dneto0
Copy link
Contributor

dneto0 commented Oct 22, 2021

The vk::DispatchLoaderDynamic::init(vk::VkInstance) method uses vkGetInstanceProcAddr to overwrite vkGetInstanceProcAddr itself.

See https://github.com/KhronosGroup/Vulkan-Headers/blob/d594f70127b4198286b3472a48bee56e341259cd/include/vulkan/vulkan.hpp#L11864

      vkGetInstanceProcAddr = PFN_vkGetInstanceProcAddr( vkGetInstanceProcAddr( instance, "vkGetInstanceProcAddr" ) );

But the value is NULL, because a valid 'instance' is provided and so it falls into the last row in the table in 4.1 "Command Function Pointers" https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#initialization-functionpointers

But then that causes a crash in the very next function pointer initialization call.

This bad behaviour was uncovered by a recent fix in the loader: KhronosGroup/Vulkan-Loader#692

@asuessenbach
Copy link
Contributor

That was really tricky to get from the spec!
Thanks for providing a fix for this issue.

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.

2 participants