Function Prototype

vkGetPipelineKeyKHR

Generate the pipeline key from pipeline creation info

To generate the key for a particular pipeline creation info, call:

VkResult vkGetPipelineKeyKHR(
    VkDevice device,
    const VkPipelineCreateInfoKHR* pPipelineCreateInfo,
    VkPipelineBinaryKeyKHR* pPipelineKey);
  • device is the logical device that creates the pipeline object.
  • pPipelineCreateInfo is NULL or a pointer to a VkPipelineCreateInfoKHR structure.
  • pPipelineKey is a pointer to a VkPipelineBinaryKeyKHR structure in which the resulting key is returned.

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 vkGetPipelineBinaryDataKHR in a different VkDevice, then the application must assume that the restored data is invalid and cannot be passed to vkCreatePipelineBinariesKHR. 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→pname:pNext create infos must produce the same VkPipelineBinaryKHR 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

VUID-vkGetPipelineKeyKHR-pNext-09605

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

Valid Usage (Implicit)

VUID-vkGetPipelineKeyKHR-pPipelineCreateInfo-parameter

If pPipelineCreateInfo is not NULL, pPipelineCreateInfo must be a valid pointer to a valid VkPipelineCreateInfoKHR structure

VUID-vkGetPipelineKeyKHR-pPipelineKey-parameter

pPipelineKey must be a valid pointer to a VkPipelineBinaryKeyKHR structure