zeux/volk

vkCreateWin32SurfaceKHR initialized to nullptr

corporateshark opened this issue · 2 comments

(PFN_vkCreateWin32SurfaceKHR)vkGetInstanceProcAddr( vk.Instance, "vkCreateWin32SurfaceKHR" ); always returns nullptr.

Extensions functions like vkCreateWin32SurfaceKHR etc can be obtained only by static linking or using dlsym / GetProcAddress.

zeux commented

Have you enabled VK_KHR_surface and VK_KHR_win32_surface when creating the instance? In Vulkan, you have to specify all extensions that you want to use up front.

Loader does expose extensions via dlsym but it's not required by the spec - as per spec, the only required functions that the loader must expose is vkGetInstanceProcAddr, and every other entrypoint has to be retrieved using that.

Mea culpa. Adding those extensions actually fixed the issue.