vkGetDeviceProcAddr
In order to support systems with multiple Vulkan implementations, the function pointers returned by vkGetInstanceProcAddr may point to dispatch code that calls a different real implementation for different VkDevice objects or their child objects. The overhead of the internal dispatch for VkDevice objects can be avoided by obtaining device-specific function pointers for any commands that use a device or device-child object as their dispatchable object. Such function pointers can be obtained by calling:
PFN_vkVoidFunction vkGetDeviceProcAddr(
VkDevice device,
const char* pName);
pub fn get_device_proc_addr(
device: vk::Device,
p_name: *const c_char,
) -> PFN_vkVoidFunction;
The table below defines the various use cases for vkGetDeviceProcAddr
and expected return value (fp is function pointer) for each case.
A valid returned function pointer (fp) must not be NULL.
The returned function pointer is of type PFN_vkVoidFunction, and must
be cast to the type of the command being queried before use.
The function pointer must only be called with a dispatchable object (the
first parameter) that is device or a child of device.
device | pName | return value |
|---|---|---|
| *1 | undefined |
invalid device | *1 | undefined |
device |
| undefined |
device | requested core version2 device-level dispatchable command3 | fp4 |
device | enabled extension device-level dispatchable command3 | fp4 |
any other case, not covered above |
| |
Valid Usage (Implicit)
VUID-vkGetDeviceProcAddr-device-parameter
device must be a valid VkDevice handle
VUID-vkGetDeviceProcAddr-pName-parameter
pName must be a null-terminated UTF-8 string