Function Prototype

vkGetDeviceProcAddr

Return a function pointer for a command

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);

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.

Table 1. vkGetDeviceProcAddr behavior
devicepNamereturn value

NULL

*1

undefined:

invalid device

*1

undefined:

device

NULL

undefined:

device

requested core version2 device-level dispatchable command3

fp4

device

enabled extension device-level dispatchable command3

fp4

any other case, not covered above

NULL

Valid Usage (Implicit)

VUID-vkGetDeviceProcAddr-pName-parameter

pName must be a null-terminated UTF-8 string