glad icon indicating copy to clipboard operation
glad copied to clipboard

Rust: Method to query if a function is a `device` or `instance` function

Open Qwinci opened this issue 2 years ago • 3 comments

Support for getting global/per-instance/per-device function pointers in Rust Vulkan generator, eg. instead of a single glad_vulkan::vk::load have specific ones for the per-instance and per-device function loading like C has gladLoaderLoadVulkan which can take an instance and a device.

Qwinci avatar Feb 12 '23 12:02 Qwinci

Can you explain why the current signature is not enough? The load function takes an FnMut which should allow you to capture a device/instance and manipulate it if necessary.

Dav1dde avatar Feb 12 '23 13:02 Dav1dde

Yeah I guess the current load function works fine, maybe there should be some kind of function which you can use to check if a specific function is device specific so you could use vkGetDeviceProcAddr instead of vkGetInstanceProcAddr to get the device specific functions for those if you have a specific device?

Qwinci avatar Feb 12 '23 13:02 Qwinci

Agreed that would be useful, since this is somewhat tricky ... due to some driver bugs ...

Dav1dde avatar Feb 12 '23 13:02 Dav1dde