# vkGetDeviceProcAddr(3) Manual Page

## Name

vkGetDeviceProcAddr - Return a function pointer for a command

## C Specification

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 with the command:

    PFN_vkVoidFunction vkGetDeviceProcAddr(
        VkDevice                                    device,
        const char*                                 pName);

## Parameters

The table below defines the various use cases for `vkGetDeviceProcAddr` and expected return value for each case.

## Description

The returned function pointer is of type PFN_vkVoidFunction, and must be cast to the type of the command being queried. 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
`device` | `pName` | return value
--- | --- | ---
`NULL` | *1 | undefined
invalid device | *1 | undefined
device | `NULL` | undefined
device | core device-level Vulkan command | fp2
device | enabled extension device-level commands | 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 `device` or a child of `device` e.g. VkDevice, VkQueue, or VkCommandBuffer.

Valid Usage (Implicit)

- `device` must be a valid VkDevice handle

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

## See Also

PFN_vkVoidFunction, VkDevice

## 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.