HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_EXT_shader_module_identifier

Name

VK_EXT_shader_module_identifier - device extension

VK_EXT_shader_module_identifier

Name String

VK_EXT_shader_module_identifier

Extension Type

Device extension

Registered Extension Number

463

Revision

1

Ratification Status

Ratified

Extension and Version Dependencies

VK_KHR_get_physical_device_properties2          or

Vulkan Version 1.1      and

VK_EXT_pipeline_creation_cache_control or Vulkan Version 1.3

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

Description

Some applications generate SPIR-V code at runtime. When pipeline caches are primed, either explicitly through e.g. PipelineCache 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 ShaderModule. On subsequent runs of the application, the same identifier can be provided in lieu of a ShaderModule 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.

New Commands

New Structures

New Enum Constants

Version History

  • Revision 1, 2022-03-16 (Hans-Kristian Arntzen)

    • Initial draft

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

  • 7 types
  • 2 values
  • Packagevulkan-3.27
  • Exports12
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_EXT_shader_module_identifier.hs
valuegetShaderModuleIdentifierEXT
  1. :: MonadIO io
  2. => Device

    device is the logical device that created the shader module.

  3. -> ShaderModule

    shaderModule is the handle of the shader module.

  4. -> io ShaderModuleIdentifierEXT
#

vkGetShaderModuleIdentifierEXT - Query a unique identifier for a shader module

Description

The identifier returned by the implementation must only depend on shaderIdentifierAlgorithmUUID and information provided in the ShaderModuleCreateInfo which created shaderModule. The implementation may return equal identifiers for two different ShaderModuleCreateInfo structures if the difference does not affect pipeline compilation. Identifiers are only meaningful on different Device 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 Device handle

  • shaderModule must be a valid ShaderModule handle

  • pIdentifier must be a valid pointer to a ShaderModuleIdentifierEXT structure

  • shaderModule must have been created, allocated, or retrieved from device

See Also

VK_EXT_shader_module_identifier, Device, ShaderModule, ShaderModuleIdentifierEXT

valuegetShaderModuleCreateInfoIdentifierEXT
  1. :: (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io)
  2. => Device

    device is the logical device that can create a ShaderModule from pCreateInfo.

  3. -> ShaderModuleCreateInfo a

    pCreateInfo is a pointer to a ShaderModuleCreateInfo structure.

  4. -> io ShaderModuleIdentifierEXT
#

vkGetShaderModuleCreateInfoIdentifierEXT - Query a unique identifier for a shader module create info

Description

The identifier returned by implementation must only depend on shaderIdentifierAlgorithmUUID and information provided in the ShaderModuleCreateInfo. The implementation may return equal identifiers for two different ShaderModuleCreateInfo structures if the difference does not affect pipeline compilation. Identifiers are only meaningful on different Device 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 ShaderModuleCreateInfo and any chained pNext structures.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle

See Also

VK_EXT_shader_module_identifier, Device, ShaderModuleCreateInfo, ShaderModuleIdentifierEXT

VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT - Structure describing whether querying and providing an identifier of a shader module is supported by the implementation

Members

This structure describes the following feature:

Description

If the PhysicalDeviceShaderModuleIdentifierFeaturesEXT structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDeviceShaderModuleIdentifierFeaturesEXT, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Structure Chaining

Extends the structures

See Also

VK_EXT_shader_module_identifier, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT - Structure describing shader module identifier properties of an implementation

Members

The members of the PhysicalDeviceShaderModuleIdentifierPropertiesEXT structure describe the following:

Description

The algorithm UUID may be the same in different ICDs if the algorithms are guaranteed to produce the same results. This may happen in driver stacks which support different kinds of hardware with shared code.

Khronos' conformance testing can not guarantee that shaderModuleIdentifierAlgorithmUUID values are actually unique, so implementors should make their own best efforts to ensure that their UUID is unlikely to conflict with other implementations which may use a different algorithm. In particular, hard-coded values which easily conflict, such as all-0 bits, should never be used. Hard-coded values are acceptable if best effort is ensured that the value will not accidentally conflict.

If the PhysicalDeviceShaderModuleIdentifierPropertiesEXT structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Structure Chaining

Extends the structure

See Also

VK_EXT_shader_module_identifier, StructureType

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkPipelineShaderStageModuleIdentifierCreateInfoEXT - Structure specifying an identifier for a shader module

Description

Any identifier can be used. If the pipeline being created with identifier requires compilation to complete the pipeline creation call, pipeline compilation must fail as defined by PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.

pIdentifier and identifierSize can be obtained from an ShaderModuleIdentifierEXT queried earlier.

Valid Usage

  • If this structure is included in a pNext chain and identifierSize is not equal to 0, the shaderModuleIdentifier feature must be enabled

Valid Usage (Implicit)

  • If identifierSize is not 0, pIdentifier must be a valid pointer to an array of identifierSize uint8_t values

Structure Chaining

Extends the structure

See Also

VK_EXT_shader_module_identifier, StructureType

Constructors

Instances4Show, FromCStruct, ToCStruct, Zero

VkShaderModuleIdentifierEXT - A unique identifier for a shader module

Description

Any returned values beyond the first identifierSize bytes are undefined. Implementations must return an identifierSize greater than 0, and less-or-equal to MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT.

Two identifiers are considered equal if identifierSize is equal and the first identifierSize bytes of identifier compare equal.

Implementations may return a different identifierSize for different modules. Implementations should ensure that identifierSize is large enough to uniquely define a shader module.

Valid Usage (Implicit)

See Also

VK_EXT_shader_module_identifier, StructureType, getShaderModuleCreateInfoIdentifierEXT, getShaderModuleIdentifierEXT

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero