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.Core10.PipelineCache

  • 4 types
  • 5 values
  • Packagevulkan-3.27
  • Exports13
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourcePipelineCache.hs
valuecreatePipelineCache
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the pipeline cache object.

  3. -> PipelineCacheCreateInfo

    pCreateInfo is a pointer to a PipelineCacheCreateInfo structure containing initial parameters for the pipeline cache object.

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

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

  5. -> io PipelineCache
#

vkCreatePipelineCache - Creates a new pipeline cache

Description

Applications can track and manage the total host memory size of a pipeline cache object using the pAllocator. Applications can limit the amount of data retrieved from a pipeline cache object in getPipelineCacheData. Implementations should not internally limit the total number of entries added to a pipeline cache object or the total host memory consumed.

Once created, a pipeline cache can be passed to the createGraphicsPipelines createRayTracingPipelinesKHR, createRayTracingPipelinesNV, createDataGraphPipelinesARM, and createComputePipelines commands. If the pipeline cache passed into these commands is not NULL_HANDLE, the implementation will query it for possible reuse opportunities and update it with new content. The use of the pipeline cache object in these commands is internally synchronized, and the same pipeline cache object can be used in multiple threads simultaneously.

If flags of pCreateInfo includes PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, all commands that modify the returned pipeline cache object must be externally synchronized.

Implementations should make every effort to limit any critical sections to the actual accesses to the cache, which is expected to be significantly shorter than the duration of the vkCreate*Pipelines commands.

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, PipelineCache, PipelineCacheCreateInfo

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

    device is the logical device that destroys the pipeline cache object.

  3. -> PipelineCache

    pipelineCache is the handle of the pipeline cache to destroy.

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

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

  5. -> io ()
#

vkDestroyPipelineCache - Destroy a pipeline cache object

Valid Usage

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

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

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If pipelineCache is not NULL_HANDLE, pipelineCache must be a valid PipelineCache handle

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

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

Host Synchronization

  • Host access to pipelineCache must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, PipelineCache

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

    device is the logical device that owns the pipeline cache.

  3. -> PipelineCache

    pipelineCache is the pipeline cache to retrieve data from.

  4. -> io (Result, "data" ::: ByteString)
#

vkGetPipelineCacheData - Get the data store from a pipeline cache

Description

If pData is NULL, then the maximum size of the data that can be retrieved from the pipeline cache, in bytes, is returned in pDataSize. Otherwise, pDataSize must point to a variable set by the application to the size of the buffer, in bytes, pointed to by pData, and on return the variable is overwritten with the amount of data actually written to pData. If pDataSize is less than the maximum size that can be retrieved by the pipeline cache, at most pDataSize bytes will be written to pData, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all of the pipeline cache was returned.

Any data written to pData is valid and can be provided as the pInitialData member of the PipelineCacheCreateInfo structure passed to createPipelineCache.

Two calls to getPipelineCacheData with the same parameters must retrieve the same data unless a command that modifies the contents of the cache is called between them.

The initial bytes written to pData must be a header as described in the Pipeline Cache Header section.

If pDataSize is less than what is necessary to store this header, nothing will be written to pData and zero will be written to pDataSize.

This query does not behave consistently with the behavior described in Opaque Binary Data Results, for historical reasons.

If the amount of data available is larger than the passed pDataSize, the query returns up to the size of the passed buffer, and signals overflow with a INCOMPLETE success status instead of returning a ERROR_NOT_ENOUGH_SPACE_KHR error status.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pipelineCache must be a valid PipelineCache handle

  • pDataSize must be a valid pointer to a size_t value

  • If the value referenced by pDataSize is not 0, and pData is not NULL, pData must be a valid pointer to an array of pDataSize bytes

  • pipelineCache must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, Device, PipelineCache

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

    device is the logical device that owns the pipeline cache objects.

  3. -> "dstCache" ::: PipelineCache

    dstCache is the handle of the pipeline cache to merge results into.

  4. -> "srcCaches" ::: Vector PipelineCache

    pSrcCaches is a pointer to an array of pipeline cache handles, which will be merged into dstCache. The previous contents of dstCache are included after the merge.

  5. -> io ()
#

vkMergePipelineCaches - Combine the data stores of pipeline caches

Description

The details of the merge operation are implementation-dependent, but implementations should merge the contents of the specified pipelines and prune duplicate entries.

Valid Usage

  • dstCache must not appear in the list of source caches

Valid Usage (Implicit)

  • device must be a valid Device handle

  • dstCache must be a valid PipelineCache handle

  • pSrcCaches must be a valid pointer to an array of srcCacheCount valid PipelineCache handles

  • srcCacheCount must be greater than 0

  • dstCache must have been created, allocated, or retrieved from device

  • Each element of pSrcCaches must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, Device, PipelineCache

VkPipelineCacheCreateInfo - Structure specifying parameters of a newly created pipeline cache

Members

  • pNext is NULL or a pointer to a structure extending this structure.

  • flags is a bitmask of PipelineCacheCreateFlagBits specifying the behavior of the pipeline cache.

  • initialDataSize is the number of bytes in pInitialData. If initialDataSize is zero, the pipeline cache will initially be empty.

  • pInitialData is a pointer to previously retrieved pipeline cache data. If the pipeline cache data is incompatible (as defined below) with the device, the pipeline cache will be initially empty. If initialDataSize is zero, pInitialData is ignored.

Valid Usage

  • If initialDataSize is not 0, it must be equal to the size of pInitialData, as returned by getPipelineCacheData when pInitialData was originally retrieved

Valid Usage (Implicit)

  • pNext must be NULL

  • flags must be a valid combination of PipelineCacheCreateFlagBits values

  • If initialDataSize is not 0, pInitialData must be a valid pointer to an array of initialDataSize bytes

See Also

VK_VERSION_1_0, PipelineCacheCreateFlags, StructureType, createPipelineCache

Instances5Show, Storable, FromCStruct, ToCStruct, Zero
newtypenewtype PipelineCache
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
newtypenewtype PipelineCacheCreateFlagBits
#

VkPipelineCacheCreateFlagBits - Bitmask specifying the behavior of the pipeline cache

Description

See Also

VK_EXT_pipeline_creation_cache_control, VK_KHR_maintenance8, VK_VERSION_1_0, PipelineCacheCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …