# vkGetPipelineBinaryDataKHR(3) Manual Page

## Name

vkGetPipelineBinaryDataKHR - Get the data store from a pipeline binary

Loading… please wait.

## C Specification

Data can be retrieved from a pipeline binary object using the command:

    // Provided by VK_KHR_pipeline_binary
    VkResult vkGetPipelineBinaryDataKHR(
        VkDevice                                    device,
        const VkPipelineBinaryDataInfoKHR*          pInfo,
        VkPipelineBinaryKeyKHR*                     pPipelineBinaryKey,
        size_t*                                     pPipelineBinaryDataSize,
        void*                                       pPipelineBinaryData);

## Parameters

- `device` is the logical device that created the pipeline binary.

- `pInfo` is a pointer to a VkPipelineBinaryDataInfoKHR structure which describes the pipeline binary to get data from.

- `pPipelineBinaryKey` is a pointer to a VkPipelineBinaryKeyKHR structure where the key for this binary will be written.

- `pPipelineBinaryDataSize` is a pointer to a `size_t` value related to the amount of data in the pipeline binary, as described below.

- `pPipelineBinaryData` is either `NULL` or a pointer to a buffer.

## Description

If `pPipelineBinaryData` is `NULL`, then the size of the data, in bytes, that is required to store the binary is returned in `pPipelineBinaryDataSize`. Otherwise, `pPipelineBinaryDataSize` must contain the size of the buffer, in bytes, pointed to by `pPipelineBinaryData`, and on return `pPipelineBinaryDataSize` is overwritten with the size of the data, in bytes, that is required to store the binary. If `pPipelineBinaryDataSize` is less than the size that is required to store the binary, nothing is written to `pPipelineBinaryData` and `VK_ERROR_NOT_ENOUGH_SPACE_KHR` will be returned, instead of `VK_SUCCESS`.

If the call returns one of the success return codes, the pipeline binary key is written to `pPipelineBinaryKey`, regardless of whether `pPipelineBinaryData` is `NULL` or not.

If pipelineBinaryCompressedData is `VK_FALSE`, implementations should not return compressed pipeline binary data to the application.

Valid Usage (Implicit)

- VUID-vkGetPipelineBinaryDataKHR-device-parameter
  `device` must be a valid VkDevice handle

- VUID-vkGetPipelineBinaryDataKHR-pInfo-parameter
  `pInfo` must be a valid pointer to a valid VkPipelineBinaryDataInfoKHR structure

- VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryKey-parameter
  `pPipelineBinaryKey` must be a valid pointer to a VkPipelineBinaryKeyKHR structure

- VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryDataSize-parameter
  `pPipelineBinaryDataSize` must be a valid pointer to a `size_t` value

- VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryData-parameter
  If the value referenced by `pPipelineBinaryDataSize` is not `0`, and `pPipelineBinaryData` is not `NULL`, `pPipelineBinaryData` must be a valid pointer to an array of `pPipelineBinaryDataSize` bytes

Return Codes

On success, this command returns

  - `VK_SUCCESS`

On failure, this command returns

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

  - `VK_ERROR_OUT_OF_DEVICE_MEMORY`

  - `VK_ERROR_NOT_ENOUGH_SPACE_KHR`

## See Also

VK_KHR_pipeline_binary, VkDevice, VkPipelineBinaryDataInfoKHR, VkPipelineBinaryKeyKHR

## 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 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0