vkGetInstanceProcAddr(3)
C Specification
Function pointers for all Vulkan commandscan be obtained by calling:
// Provided by VK_VERSION_1_0PFN_vkVoidFunction vkGetInstanceProcAddr( VkInstance instance, const char* pName);Parameters
instanceis the instance that the function pointer will becompatible with, orNULLfor commands not dependent on any instance.pNameis the name of the command to obtain.
Description
vkGetInstanceProcAddr itself is obtained in a platform- and loader-specific manner.Typically, the loader library will export this command as a function symbol,so applicationscan link against the loader library, or load it dynamicallyand look up the symbol using platform-specific APIs.
The table below defines the various use cases forvkGetInstanceProcAddr and expected return value (“fp” is “functionpointer”) for each case.A valid returned function pointer (“fp”)must not beNULL.
The returned function pointer is of typePFN_vkVoidFunction, andmustbe cast to the type of the command being queried before use.
instance | pName | return value |
|---|---|---|
*1 |
| undefined |
invalid non- | *1 | undefined |
| global command2 | fp |
| fp5 | |
instance | fp | |
instance | coredispatchable command | fp3 |
instance | enabled instance extension dispatchable command for | fp3 |
instance | available device extension4 dispatchable command for | fp3 |
any other case, not covered above |
| |
- 1
"*" means any representable value for the parameter (including validvalues, invalid values, and
NULL).- 2
The global commands are:vkEnumerateInstanceVersion,vkEnumerateInstanceExtensionProperties,vkEnumerateInstanceLayerProperties, andvkCreateInstance. Dispatchable commands are all other commands which are not global.
- 3
The returned function pointermust only be called with a dispatchableobject (the first parameter) that is
instanceor a child ofinstance, e.g.VkInstance,VkPhysicalDevice,VkDevice,VkQueue, orVkCommandBuffer.- 4
An “available device extension” is a device extension supported by anyphysical device enumerated by
instance.- 5
Starting with Vulkan 1.2,
vkGetInstanceProcAddrcan resolve itself with aNULLinstance pointer.
VUID-vkGetInstanceProcAddr-instance-parameter
Ifinstanceis notNULL,instancemust be a validVkInstance handleVUID-vkGetInstanceProcAddr-pName-parameter
pNamemust be a null-terminated UTF-8 string
Document Notes
For more information, see theVulkan Specification.
This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.