Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class EXTShaderModuleIdentifier

extends Object
Class Inheritance
Imports
org.lwjgl.system.*

Some applications generate SPIR-V code at runtime. When pipeline caches are primed, either explicitly through e.g. 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_identifier
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_properties2 and VK_EXT_pipeline_creation_cache_control
Contact
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

Modifier and TypeField and Description
public static final String
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
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
nvkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, long pCreateInfo, long pIdentifier)

Unsafe version of: GetShaderModuleCreateInfoIdentifierEXT

public static void
nvkGetShaderModuleIdentifierEXT(VkDevice device, long shaderModule, long pIdentifier)

Unsafe version of: GetShaderModuleIdentifierEXT

public static void
vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice
the logical device that can create a VkShaderModule from pCreateInfo.
device
,
VkShaderModuleCreateInfo
a pointer to a VkShaderModuleCreateInfo structure.
pCreateInfo
,
VkShaderModuleIdentifierEXT
a pointer to the returned VkShaderModuleIdentifierEXT.
pIdentifier
)

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 VkShaderModuleIdentifierEXT.
pIdentifier
)

Query a unique identifier for a shader module.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAMEback to summary
public static final String VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME

The extension name.

VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSIONback to summary
public static final int VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION

The extension specification version.

VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXTback 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_EXTback to summary
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXTback to summary
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXTback to summary
public static final int VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXTback to summary
public static final int VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT

Extends VkStructureType.

Enum values:

Constructor Detail

EXTShaderModuleIdentifierback to summary
protected EXTShaderModuleIdentifier()

Method Detail

nvkGetShaderModuleCreateInfoIdentifierEXTback to summary
public static void nvkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, long pCreateInfo, long pIdentifier)

Unsafe version of: GetShaderModuleCreateInfoIdentifierEXT

nvkGetShaderModuleIdentifierEXTback to summary
public static void nvkGetShaderModuleIdentifierEXT(VkDevice device, long shaderModule, long pIdentifier)

Unsafe version of: GetShaderModuleIdentifierEXT

vkGetShaderModuleCreateInfoIdentifierEXTback to summary
public static void vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, VkShaderModuleCreateInfo pCreateInfo, VkShaderModuleIdentifierEXT pIdentifier)

Query a unique identifier for a shader module create info.

C Specification

VkShaderModuleCreateInfo structures 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 shaderIdentifierAlgorithmUUID and information provided in the VkShaderModuleCreateInfo. The implementation may return equal identifiers for two different VkShaderModuleCreateInfo structures if the difference does not affect pipeline compilation. Identifiers are only meaningful on different VkDevice objects if the device the identifier was queried from had the same shaderModuleIdentifierAlgorithmUUID as the device consuming the identifier.

The identifier returned by the implementation in GetShaderModuleCreateInfoIdentifierEXT must be equal to the identifier returned by GetShaderModuleIdentifierEXT given equivalent definitions of VkShaderModuleCreateInfo and any chained pNext structures.

Valid Usage
Valid Usage (Implicit)
See Also

VkShaderModuleCreateInfo, VkShaderModuleIdentifierEXT

Parameters
device:VkDevice

the logical device that can create a VkShaderModule from pCreateInfo.

pCreateInfo:VkShaderModuleCreateInfo

a pointer to a VkShaderModuleCreateInfo structure.

pIdentifier:VkShaderModuleIdentifierEXT

a pointer to the returned VkShaderModuleIdentifierEXT.

vkGetShaderModuleIdentifierEXTback to summary
public static void vkGetShaderModuleIdentifierEXT(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 shaderIdentifierAlgorithmUUID and information provided in the VkShaderModuleCreateInfo which created shaderModule. The implementation may return equal identifiers for two different VkShaderModuleCreateInfo structures if the difference does not affect pipeline compilation. Identifiers are only meaningful on different VkDevice objects if the device the identifier was queried from had the same shaderModuleIdentifierAlgorithmUUID as the device consuming the identifier.

Valid Usage
Valid Usage (Implicit)
  • device must be a valid VkDevice handle
  • shaderModule must be a valid VkShaderModule handle
  • pIdentifier must be a valid pointer to a VkShaderModuleIdentifierEXT structure
  • shaderModule must have been created, allocated, or retrieved from device
See Also

VkShaderModuleIdentifierEXT

Parameters
device:VkDevice

the logical device that created the shader module.

shaderModule:long

the handle of the shader module.

pIdentifier:VkShaderModuleIdentifierEXT

a pointer to the returned VkShaderModuleIdentifierEXT.