Class EXTShaderModuleIdentifier
VkPipelineCache mechanisms, or implicitly through driver managed caches, having to re-generate SPIR-V modules is redundant. SPIR-V modules could be cached on disk by an application, but the extra disk size requirement might be prohibitive in some use cases.
This extension adds the ability for an application to query a small identifier associated with a VkShaderModule. On subsequent runs of the application, the same identifier can be provided in lieu of a VkShaderModule object. A pipeline creation call with such a module may succeed if a pipeline could be created without invoking compilation, and information inside the SPIR-V module is not required by the implementation.
PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT must be used if only the identifier is provided, and this use case is intended to work like a non-blocking, speculative compile. Applications can fallback as necessary.
The main motivation for identifying the module itself and not the entire pipeline is that pipeline identifiers change when a driver is updated, but module identifiers are expected to be stable for any particular driver implementation. This approach is helpful for shader pre-compilation systems which can prime pipeline caches ahead of time. When on-disk pipeline caches are updated, the same shader identifiers could lead to a pipeline cache hit.
- Name String
VK_EXT_shader_module_identifier- Extension Type
- Device extension
- Registered Extension Number
- 463
- Revision
- 1
- Extension and Version Dependencies
VK_KHR_get_physical_device_properties2or Version 1.1 andVK_EXT_pipeline_creation_cache_controlor Version 1.3- Contact
- Hans-Kristian Arntzen HansKristian-Work
- Extension Proposal
- VK_EXT_shader_module_identifier
Other Extension Metadata
- Last Modified Date
- 2022-05-16
- IP Status
- No known IP claims.
- Contributors
- Hans-Kristian Arntzen, Valve
- Ricardo Garcia, Igalia
- Piers Daniell, NVIDIA
- Jan-Harald Fredriksen, Arm
- Tom Olson, Arm
- Faith Ekstrand, Collabora
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intVK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXTstatic final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidnvkGetShaderModuleCreateInfoIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long pCreateInfo, long pIdentifier) Unsafe version of:GetShaderModuleCreateInfoIdentifierEXTstatic voidnvkGetShaderModuleIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long shaderModule, long pIdentifier) Unsafe version of:GetShaderModuleIdentifierEXTstatic voidvkGetShaderModuleCreateInfoIdentifierEXT(org.lwjgl.vulkan.VkDevice device, VkShaderModuleCreateInfo pCreateInfo, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module create info.static voidvkGetShaderModuleIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long shaderModule, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module.
-
Field Details
-
VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION
public static final int VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT
public static final int VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT
public static final int VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT
public static final int VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXTVK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT- See Also:
-
-
Method Details
-
nvkGetShaderModuleIdentifierEXT
public static void nvkGetShaderModuleIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long shaderModule, long pIdentifier) Unsafe version of:GetShaderModuleIdentifierEXT -
vkGetShaderModuleIdentifierEXT
public static void vkGetShaderModuleIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long shaderModule, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module.C Specification
Shader modules have unique identifiers associated with them. To query an implementation provided identifier, call:
void vkGetShaderModuleIdentifierEXT( VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT* pIdentifier);Description
The identifier returned by the implementation must only depend on
shaderIdentifierAlgorithmUUIDand information provided in theVkShaderModuleCreateInfowhich createdshaderModule. The implementation may return equal identifiers for two differentVkShaderModuleCreateInfostructures if the difference does not affect pipeline compilation. Identifiers are only meaningful on differentVkDeviceobjects if the device the identifier was queried from had the sameshaderModuleIdentifierAlgorithmUUIDas the device consuming the identifier.Valid Usage
shaderModuleIdentifierfeature must be enabled
Valid Usage (Implicit)
devicemust be a validVkDevicehandleshaderModulemust be a validVkShaderModulehandlepIdentifiermust be a valid pointer to aVkShaderModuleIdentifierEXTstructureshaderModulemust have been created, allocated, or retrieved fromdevice
See Also
- Parameters:
device- the logical device that created the shader module.shaderModule- the handle of the shader module.pIdentifier- a pointer to the returnedVkShaderModuleIdentifierEXT.
-
nvkGetShaderModuleCreateInfoIdentifierEXT
public static void nvkGetShaderModuleCreateInfoIdentifierEXT(org.lwjgl.vulkan.VkDevice device, long pCreateInfo, long pIdentifier) Unsafe version of:GetShaderModuleCreateInfoIdentifierEXT -
vkGetShaderModuleCreateInfoIdentifierEXT
public static void vkGetShaderModuleCreateInfoIdentifierEXT(org.lwjgl.vulkan.VkDevice device, VkShaderModuleCreateInfo pCreateInfo, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module create info.C Specification
VkShaderModuleCreateInfostructures have unique identifiers associated with them. To query an implementation provided identifier, call:void vkGetShaderModuleCreateInfoIdentifierEXT( VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModuleIdentifierEXT* pIdentifier);Description
The identifier returned by implementation must only depend on
shaderIdentifierAlgorithmUUIDand information provided in theVkShaderModuleCreateInfo. The implementation may return equal identifiers for two differentVkShaderModuleCreateInfostructures if the difference does not affect pipeline compilation. Identifiers are only meaningful on differentVkDeviceobjects if the device the identifier was queried from had the sameshaderModuleIdentifierAlgorithmUUIDas the device consuming the identifier.The identifier returned by the implementation in
GetShaderModuleCreateInfoIdentifierEXTmust be equal to the identifier returned byGetShaderModuleIdentifierEXTgiven equivalent definitions ofVkShaderModuleCreateInfoand any chainedpNextstructures.Valid Usage
shaderModuleIdentifierfeature must be enabled
Valid Usage (Implicit)
devicemust be a validVkDevicehandlepCreateInfomust be a valid pointer to a validVkShaderModuleCreateInfostructurepIdentifiermust be a valid pointer to aVkShaderModuleIdentifierEXTstructure
See Also
- Parameters:
device- the logical device that can create aVkShaderModulefrompCreateInfo.pCreateInfo- a pointer to aVkShaderModuleCreateInfostructure.pIdentifier- a pointer to the returnedVkShaderModuleIdentifierEXT.
-