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.
VK_EXT_shader_module_identifierVK_KHR_get_physical_device_properties2 and VK_EXT_pipeline_creation_cache_control| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME
The extension name. |
| public static final int | VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION
The extension specification version. |
| public static final int | VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT
VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT |
| public static final int | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT
Extends |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | nvkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, long pCreateInfo, long pIdentifier)
Unsafe version of: |
| public static void | nvkGetShaderModuleIdentifierEXT(VkDevice device, long shaderModule, long pIdentifier)
Unsafe version of: |
| public static void | vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice
the logical device that can create a device, VkShaderModuleCreateInfo VkShaderModule from pCreateInfo.a pointer to a pCreateInfo, VkShaderModuleIdentifierEXT VkShaderModuleCreateInfo structure.a pointer to the returned pIdentifier)VkShaderModuleIdentifierEXT.Query a unique identifier for a shader module create info. |
| public static void | vkGetShaderModuleIdentifierEXT(VkDevice
the logical device that created the shader module. device, long the handle of the shader module. shaderModule, VkShaderModuleIdentifierEXT a pointer to the returned pIdentifier)VkShaderModuleIdentifierEXT.Query a unique identifier for a shader module. |
| VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME The extension name. | |
| VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION The extension specification version. | |
| VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT | back to summary |
|---|---|
| public static final int VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT | |
| VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT Extends Enum values: | |
| EXTShaderModuleIdentifier | back to summary |
|---|---|
| protected EXTShaderModuleIdentifier() | |
| nvkGetShaderModuleCreateInfoIdentifierEXT | back to summary |
|---|---|
| public static void nvkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, long pCreateInfo, long pIdentifier) Unsafe version of: | |
| nvkGetShaderModuleIdentifierEXT | back to summary |
|---|---|
| public static void nvkGetShaderModuleIdentifierEXT(VkDevice device, long shaderModule, long pIdentifier) Unsafe version of: | |
| vkGetShaderModuleCreateInfoIdentifierEXT | back to summary |
|---|---|
| public static void vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, VkShaderModuleCreateInfo pCreateInfo, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module create info. C Specification
DescriptionThe identifier returned by implementation must only depend on The identifier returned by the implementation in Valid Usage
Valid Usage (Implicit)
See Also
| |
| vkGetShaderModuleIdentifierEXT | back to summary |
|---|---|
| public static void vkGetShaderModuleIdentifierEXT(VkDevice device, long shaderModule, VkShaderModuleIdentifierEXT pIdentifier) Query a unique identifier for a shader module. C SpecificationShader modules have unique identifiers associated with them. To query an implementation provided identifier, call:
DescriptionThe identifier returned by the implementation must only depend on Valid Usage
Valid Usage (Implicit)
See Also
| |