# vkGetInstanceProcAddr(3) Manual Page

## Name

vkGetInstanceProcAddr - Return a function pointer for a command

## C Specification

Function pointers for all Vulkan commands can be obtained with the command:

    PFN_vkVoidFunction vkGetInstanceProcAddr(
        VkInstance                                  instance,
        const char*                                 pName);

## Parameters

- `instance` is the instance that the function pointer will be compatible with, or `NULL` for commands not dependent on any instance.

- `pName` is 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 applications can link against the loader library, or load it dynamically and look up the symbol using platform-specific APIs.

The table below defines the various use cases for `vkGetInstanceProcAddr` and expected return value (“fp” is “function pointer”) for each case.

The returned function pointer is of type PFN_vkVoidFunction, and must be cast to the type of the command being queried.

Table 1. vkGetInstanceProcAddr behavior
`instance` | `pName` | return value
--- | --- | ---
*1 | `NULL` | undefined
invalid non-`NULL` instance | *1 | undefined
`NULL` | vkEnumerateInstanceVersion | fp
`NULL` | vkEnumerateInstanceExtensionProperties | fp
`NULL` | vkEnumerateInstanceLayerProperties | fp
`NULL` | vkCreateInstance | fp
instance | core Vulkan command | fp2
instance | enabled instance extension commands for `instance` | fp2
instance | available device extension3 commands for `instance` | fp2
any other case, not covered above | `NULL`

1

  "*" means any representable value for the parameter (including valid values, invalid values, and `NULL`).

2

  The returned function pointer must only be called with a dispatchable object (the first parameter) that is `instance` or a child of `instance`, e.g. VkInstance, VkPhysicalDevice, VkDevice, VkQueue, or VkCommandBuffer.

3

  An “available device extension” is a device extension supported by any physical device enumerated by `instance`.

Valid Usage (Implicit)

- If `instance` is not `NULL`, `instance` must be a valid VkInstance handle

- `pName` must be a null-terminated UTF-8 string

## See Also

PFN_vkVoidFunction, VkInstance

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.