Hello everyone,
I get an access violation exception when execute vkCreateWin32SurfaceKHR: Exception thrown at 0x0000000000000000 in MIO_Vulkan_Cookbook.exe: 0xC0000005: Access violation executing location 0x0000000000000000.
that is strange because every parameters seems ok:
What I mean is that you are probably calling function pointer that has a value of nullptr. Which may happen if you are using third-party Vulkan loader…
I’m using vulkan-1.dll.
I had disable the function prototypes defined in the vulkan.h header file and loaded function pointers dynamically. So you think that I have problems loading fuction pointer? How can I check?
Dunno, show me yer code.
Maybe typo in the command name, for which the vkGetInstanceProcAddr would return nullptr.
Or you do not have VK_KHR_win32_surface extension enabled.
Solved! It Was a vkGetInstanceProcAddr problem, I thought that I called this function but it seems that I forgot.
Anyway thank you very much krOoze, you helped me a lot!
The problem is that I use #define macro and somewhere I forgot to call it.
Anyway I don’t understand a thing, I’m following Vulkan cookbook examples, and I have (for example) in header file: #define EXPORTED_VULKAN_FUNCTION( name ) extern PFN_##name name;
and then in cpp file #define EXPORTED_VULKAN_FUNCTION( name ) PFN_##name name;
Why I can’t define in header file like in cpp? If I put directly in head#define EXPORTED_VULKAN_FUNCTION( name ) PFN_##name name; I got LNK2005 error, like “functions already defined in file.obj”