HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_KHR_pipeline_binary

Name

VK_KHR_pipeline_binary - device extension

VK_KHR_pipeline_binary

Name String

VK_KHR_pipeline_binary

Extension Type

Device extension

Registered Extension Number

484

Revision

1

Ratification Status

Ratified

Extension and Version Dependencies

VK_KHR_maintenance5

or

Vulkan Version 1.4

Contact
Extension Proposal

VK_KHR_pipeline_binary

Other Extension Metadata

Last Modified Date

2024-07-01

Contributors
  • Stu Smith, AMD

  • Tobias Hector, AMD

  • Alan Harrison, AMD

  • Maciej Jesionowski, AMD

  • Younggwan Kim, Arm

  • Jan-Harald Fredriksen, Arm

  • Ting Wei, Arm

  • Chris Glover, Google

  • Shahbaz Youssefi, Google

  • Jakub Kuderski, Google

  • Piotr Byszewski, Mobica

  • Piers Daniell, NVIDIA

  • Ralph Potter, Samsung

  • Matthew Netsch, Qualcomm

  • Hans-Kristian Arntzen, Valve

  • Samuel Pitoiset, Valve

  • Tatsuyuki Ishi, Valve

Description

This extension provides a method to obtain binary data associated with individual pipelines such that applications can manage caching themselves instead of using VkPipelineCache objects.

New Object Types

New Commands

New Structures

New Enum Constants

Version History

  • Revision 1, 2021-12-10 (Chris Glover)

    • Initial draft.

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

  • 16 types
  • 5 values
  • Packagevulkan-3.27
  • Exports24
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_KHR_pipeline_binary.hs
valuecreatePipelineBinariesKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the pipeline binary objects.

  3. -> PipelineBinaryCreateInfoKHR

    pCreateInfo is a pointer to a PipelineBinaryCreateInfoKHR structure that contains the data to create the pipeline binaries from.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io (Result, "binaries" ::: PipelineBinaryHandlesInfoKHR)
#

vkCreatePipelineBinariesKHR - Create pipeline binaries from a pipeline or previously retrieved data

Description

The implementation will attempt to create all pipeline binaries. If creation fails for any pipeline binary, then:

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_KHR_pipeline_binary, AllocationCallbacks, Device, PipelineBinaryCreateInfoKHR, PipelineBinaryHandlesInfoKHR

valuedestroyPipelineBinaryKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device that created the pipeline binary object.

  3. -> PipelineBinaryKHR

    pipelineBinary is the handle of the pipeline binary object to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkDestroyPipelineBinaryKHR - Destroy a pipeline binary

Valid Usage

  • If AllocationCallbacks were provided when pipelineBinary was created, a compatible set of callbacks must be provided here

  • If no AllocationCallbacks were provided when pipelineBinary was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If pipelineBinary is not NULL_HANDLE, pipelineBinary must be a valid PipelineBinaryKHR handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • If pipelineBinary is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to pipelineBinary must be externally synchronized

See Also

VK_KHR_pipeline_binary, AllocationCallbacks, Device, PipelineBinaryKHR

valuegetPipelineKeyKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the pipeline object.

  3. -> "pipelineCreateInfo" ::: Maybe PipelineCreateInfoKHR

    pPipelineCreateInfo is NULL or a pointer to a PipelineCreateInfoKHR structure.

  4. -> io ("pipelineKey" ::: PipelineBinaryKeyKHR)
#

vkGetPipelineKeyKHR - Generate the pipeline key from pipeline creation info

Description

If pPipelineCreateInfo is NULL, then the implementation must return the global key that applies to all pipelines. If the key obtained in this way changes between saving and restoring data obtained from getPipelineBinaryDataKHR in a different Device, then the application must assume that the restored data is invalid and cannot be passed to createPipelineBinariesKHR. Otherwise the application can assume the data is still valid.

If pPipelineCreateInfo is not NULL, the key obtained functions as a method to compare two pipeline creation info structures. Implementations may not compare parts of a pipeline creation info which would not contribute to the final binary output. If a shader module identifier is used instead of a shader module, the pPipelineKey generated must be equal to the key generated when using the shader module from which the identifier was queried. If the content of two pPipelineKey are equal, pipelines created with the two pPipelineCreateInfo->pNext create infos must produce the same PipelineBinaryKHR contents.

The pipeline key is distinct from pipeline binary key. Pipeline binary keys can only be obtained after compilation. The pipeline key is intended to optionally allow associating pipeline create info with multiple pipeline binary keys.

Valid Usage

  • The pNext chain of pPipelineCreateInfo must not set PipelineBinaryInfoKHR::binaryCount to a value greater than 0

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_KHR_pipeline_binary, Device, PipelineBinaryKeyKHR, PipelineCreateInfoKHR

valuegetPipelineBinaryDataKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device that created the pipeline binary.

  3. -> PipelineBinaryDataInfoKHR

    pInfo is a pointer to a PipelineBinaryDataInfoKHR structure which describes the pipeline binary to get data from.

  4. -> io (PipelineBinaryKeyKHR, "pipelineBinaryData" ::: ByteString)
#

vkGetPipelineBinaryDataKHR - Get the data store from a pipeline binary

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 ERROR_NOT_ENOUGH_SPACE_KHR will be returned, instead of 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 FALSE, implementations should not return compressed pipeline binary data to the application.

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pInfo must be a valid pointer to a valid PipelineBinaryDataInfoKHR structure

  • pPipelineBinaryKey must be a valid pointer to a PipelineBinaryKeyKHR structure

  • pPipelineBinaryDataSize must be a valid pointer to a size_t value

  • 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

Success
Failure

See Also

VK_KHR_pipeline_binary, Device, PipelineBinaryDataInfoKHR, PipelineBinaryKeyKHR

valuereleaseCapturedPipelineDataKHR
  1. :: MonadIO io
  2. => Device

    device is the logical device that created the pipeline object.

  3. -> ReleaseCapturedPipelineDataInfoKHR

    pInfo is a pointer to a ReleaseCapturedPipelineDataInfoKHR structure which describes the pipeline to release the data from.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkReleaseCapturedPipelineDataKHR - Release captured pipeline binary data

Description

The implementation may free any resources captured as a result of creating the pipeline with PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR and put the pipeline into a state as if PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR had not been provided at pipeline creation time.

Any resources captured as a result of creating the pipeline with PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR are implicitly freed by destroyPipeline.

Valid Usage

  • If AllocationCallbacks were provided when pipeline was created, a compatible set of callbacks must be provided in pAllocator

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_KHR_pipeline_binary, AllocationCallbacks, Device, ReleaseCapturedPipelineDataInfoKHR

VkPipelineBinaryCreateInfoKHR - Structure specifying where to retrieve data for pipeline binary creation

Description

When pPipelineCreateInfo is not NULL, an implementation will attempt to retrieve pipeline binary data from an internal cache external to the application if pipelineBinaryInternalCache is TRUE. Applications can use this to determine if a pipeline can be created without compilation. If the implementation fails to create a pipeline binary due to missing an internal cache entry, PIPELINE_BINARY_MISSING_KHR is returned. If creation succeeds, the resulting binary can be used to create a pipeline. PIPELINE_BINARY_MISSING_KHR may be returned for any reason in this situation, even if creating a pipeline binary with the same parameters that succeeded earlier.

If pipelineBinaryPrecompiledInternalCache is TRUE, the implementation may be able to create pipeline binaries even when pPipelineCreateInfo has not been used to create binaries before by the application.

On some platforms, internal pipeline caches may be pre-populated before running the application.

Valid Usage

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, Pipeline, PipelineBinaryKeysAndDataKHR, PipelineCreateInfoKHR, StructureType, createPipelineBinariesKHR

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkPipelineBinaryHandlesInfoKHR - Structure containing newly created pipeline binaries

Description

If pPipelineBinaries is NULL, the number of binaries that would be created is returned in pipelineBinaryCount. Otherwise, pipelineBinaryCount must be the number of entries in the pPipelineBinaries array, and on return from createPipelineBinariesKHR pipelineBinaryCount is overwritten with the number of handles actually written to pPipelineBinaries. If the value of pipelineBinaryCount is less than the number of binaries that would have been created, at most pipelineBinaryCount handles will be written to pPipelineBinaries and INCOMPLETE will be returned instead of SUCCESS, to indicate that pPipelineBinaries was not large enough to create all the binaries.

Valid Usage (Implicit)

  • pNext must be NULL

  • If pipelineBinaryCount is not 0, and pPipelineBinaries is not NULL, pPipelineBinaries must be a valid pointer to an array of pipelineBinaryCount PipelineBinaryKHR handles

See Also

VK_KHR_pipeline_binary, PipelineBinaryKHR, StructureType, createPipelineBinariesKHR

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineBinaryDataKHR - Structure specifying data and length of a pipeline binary

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, PipelineBinaryKeysAndDataKHR

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineBinaryKeysAndDataKHR - Structure specifying arrays of key and data pairs

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, PipelineBinaryCreateInfoKHR, PipelineBinaryDataKHR, PipelineBinaryKeyKHR

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero
datadata PipelineBinaryKeyKHR
#

VkPipelineBinaryKeyKHR - Structure specifying a key to a pipeline binary

Description

Any returned values beyond the first keySize bytes are undefined. Implementations must return a keySize greater than 0, and less-or-equal to MAX_PIPELINE_BINARY_KEY_SIZE_KHR.

Two keys are considered equal if keySize is equal and the first keySize bytes of key compare equal.

Implementations may return a different keySize for different binaries.

Implementations should ensure that keySize is large enough to uniquely identify a pipeline binary.

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, PipelineBinaryKeysAndDataKHR, StructureType, getPipelineBinaryDataKHR, getPipelineKeyKHR

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineBinaryInfoKHR - Structure specifying pipeline binaries to use during pipeline creation

Description

If a PipelineBinaryInfoKHR structure with a binaryCount greater than 0 is included in the pNext chain of any Vk*PipelineCreateInfo structure when creating a pipeline, implementations must use the data in pPipelineBinaries instead of recalculating it. Any shader module identifiers, shader modules, or chained ShaderModuleCreateInfo structures declared in PipelineShaderStageCreateInfo instances, are ignored. Any ShaderDescriptorSetAndBindingMappingInfoEXT in the pNext chains of PipelineShaderStageCreateInfo instances are ignored.

If this structure is not included in the pNext chain, it is equivalent to specifying this structure with a binaryCount of 0.

Valid Usage

Valid Usage (Implicit)

  • If binaryCount is not 0, pPipelineBinaries must be a valid pointer to an array of binaryCount valid PipelineBinaryKHR handles

Structure Chaining

Extends the structures

See Also

VK_KHR_pipeline_binary, PipelineBinaryKHR, StructureType

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkReleaseCapturedPipelineDataInfoKHR - Structure specifying a pipeline whose captured data is to be released

Valid Usage

Valid Usage (Implicit)

  • pNext must be NULL

  • pipeline must be a valid Pipeline handle

Host Synchronization

  • Host access to pipeline must be externally synchronized

See Also

VK_KHR_pipeline_binary, Pipeline, StructureType, releaseCapturedPipelineDataKHR

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineBinaryDataInfoKHR - Structure specifying a pipeline binary to retrieve binary data from

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, PipelineBinaryKHR, StructureType, getPipelineBinaryDataKHR

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineCreateInfoKHR - Structure specifying a pipeline createinfo chain

Valid Usage (Implicit)

See Also

VK_KHR_pipeline_binary, PipelineBinaryCreateInfoKHR, StructureType, getPipelineKeyKHR

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDevicePipelineBinaryFeaturesKHR - Structure describing support for pipeline binaries

Members

This structure describes the following feature:

Description

If the PhysicalDevicePipelineBinaryFeaturesKHR structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDevicePipelineBinaryFeaturesKHR, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Structure Chaining

Extends the structures

See Also

VK_KHR_pipeline_binary, Bool32, StructureType

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkDevicePipelineBinaryInternalCacheControlKHR - Structure specifying parameter to disable the internal pipeline cache

Description

If the DeviceCreateInfo::pNext chain does not include this structure, then disableInternalCache defaults to FALSE.

Valid Usage

Valid Usage (Implicit)

Structure Chaining

Extends the structure

See Also

VK_KHR_pipeline_binary, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDevicePipelineBinaryPropertiesKHR - Structure describing properties about the pipeline binary implementation

Description

These properties tend to be platform specific and may change depending on external configuration which is outside the scope of this specification. These properties are intended to guide applications when implementations have dedicated caching solutions available. In particular, if the pipelineBinaryPrefersInternalCache limit is exposed, relying on the internal cache may provide some advantage compared to an application-specific solution. An application with its own dedicated solution may still use its own caching system even with this limit exposed.

If the PhysicalDevicePipelineBinaryPropertiesKHR structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Structure Chaining

Extends the structure

See Also

VK_KHR_pipeline_binary, Bool32, StructureType

Constructors

  • PhysicalDevicePipelineBinaryPropertiesKHR
    • pipelineBinaryInternalCache :: Bool

      pipelineBinaryInternalCache specifies that the implementation maintains a pipeline cache internal to the implementation. If this is TRUE, applications can create pipeline binaries with only a pipeline create info, and in this case, an implementation may be able to create a pipeline binary directly without application needing to capture the binary itself.

    • pipelineBinaryInternalCacheControl :: Bool

      pipelineBinaryInternalCacheControl specifies whether the driver’s internal cache can be disabled. If this property is TRUE DevicePipelineBinaryInternalCacheControlKHR::disableInternalCache can be used to disable the driver’s internal cache, allowing an application to take full control of both memory and disk usage.

    • pipelineBinaryPrefersInternalCache :: Bool

      pipelineBinaryPrefersInternalCache specifies that the implementation prefers to maintain an internal cache, and applications should not store pipeline binaries in their own on-disk caches to avoid increased on-disk storage requirements. Applications are encouraged to only store pipeline keys instead, and aim to create pipeline binaries from key alone on subsequent runs of the application.

    • pipelineBinaryPrecompiledInternalCache :: Bool

      pipelineBinaryPrecompiledInternalCache specifies that the implementation may have pipeline binaries in its internal cache, which is populated without the application ever having generated that pipeline itself. Applications can attempt to create binaries without extracting pipeline binary data from the pipeline prior for a set of pipeline keys, including from previous runs of the application.

    • pipelineBinaryCompressedData :: Bool

      pipelineBinaryCompressedData specifies that the binary data is already compressed and so applications should not attempt to compress it.

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
newtypenewtype PipelineBinaryKHR
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …