Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vulkan vkCreateWin32SurfaceKHR fails to load

Tags:

c++

vulkan

Hey I'm trying to create a Windows Surface with Vulkan but the somehow vkGetInstanceProcAddr fails to load the vkCreateWin32SurfaceKHR function even though the extension is loaded properly.

Edit: here I try to get the function pointer:

vkCreateWin32SurfaceKHR =
(PFN_vkCreateWin32SurfaceKHR)vkGetInstanceProcAddr(vulkanInstance.instance, 
"vkCreateWin32SurfaceKHR");
like image 707
Erik Simon Avatar asked Sep 05 '25 03:09

Erik Simon


1 Answers

Did you enable the appropriate extension using e.g. the const VK_KHR_WIN32_SURFACE_EXTENSION_NAME at instance creation time?

Also note that you don't need to manually get the function pointer for vkCreateWin32SurfaceKHR unless you define VK_NO_PROTOTYPES as it's part of the core.

If you have enabled the extension and still don't get a valid function pointer, check if your drivers are properly installed, esp. that there is no old ICD registered that may cause problems. The LunarG Vulkan SDK contains a tool called "via" (in the bin folder) to check your Vulkan installation.

like image 197
Sascha Willems Avatar answered Sep 08 '25 00:09

Sascha Willems