mellinoe / vk

Low-level Vulkan bindings for .NET.
Other
176 stars 35 forks source link

Use vkGetInstanceProcAddr and vkGetDeviceProcAddr #17

Open amerkoleci opened 6 years ago

amerkoleci commented 6 years ago

At the moment vulkan symbols are loaded used GetProcAddress on Windows and dlsym on other platforms, I think it makes sense to replace with above as volk loader for example:

https://github.com/zeux/volk

mellinoe commented 6 years ago

I actually have a branch where I tried out vkGetDeviceProcAddr, since it's supposed to be measurably faster. However, I found that it was only about 1% faster. That kind of discouraged me, so I put the branch aside and haven't looked at it in a bit. I would like to support that in some way, though.

amerkoleci commented 6 years ago

I see, anyway I think it makes sense go throught standard way of loading vulkan proc entries, I can send PR if you want?

PJB3005 commented 5 years ago

I'm trying to use vkCreateDebugReportCallbackEXT with this library, but it's causing a segfault. The symbol isn't available in /lib/libvulkan.so.1 so the library fails to load it (and tries to jump into a null pointer) but it is available through vkGetInstanceProcAddr.

I figured this is relevant to this issue.

mellinoe commented 5 years ago

@PJB3005 Yes, that's definitely an issue. Any extension functions generally need to be loaded manually as they aren't statically exported. Veldrid has to do this for the debug extension and a handful of other extension functions.