C Specification
To generate the key for a particular pipeline creation info, call:
// Provided by VK_KHR_pipeline_binary
VkResult vkGetPipelineKeyKHR(
VkDevice device,
const VkPipelineCreateInfoKHR* pPipelineCreateInfo,
VkPipelineBinaryKeyKHR* pPipelineKey);
Parameters
-
device
is the logical device that creates the pipeline object. -
pPipelineCreateInfo
isNULL
or a pointer to a VkPipelineCreateInfoKHR structure. -
pPipelineKey
is a pointer to a VkPipelineBinaryKeyKHR structure in which the resulting key is returned.
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 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->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.
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.