vulkan-3.24.3: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Extensions.VK_EXT_shader_module_identifier

Description

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
Extension and Version Dependencies
  • Requires support for Vulkan 1.0
  • Requires VK_KHR_get_physical_device_properties2 to be enabled for any device-level functionality
  • Requires VK_EXT_pipeline_creation_cache_control to be enabled for any device-level functionality
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
  • Jason 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

MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT, PhysicalDeviceShaderModuleIdentifierFeaturesEXT, PhysicalDeviceShaderModuleIdentifierPropertiesEXT, PipelineShaderStageModuleIdentifierCreateInfoEXT, ShaderModuleIdentifierEXT, getShaderModuleCreateInfoIdentifierEXT, getShaderModuleIdentifierEXT

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.

Synopsis

Documentation

getShaderModuleIdentifierEXT Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that created the shader module.

-> ShaderModule

shaderModule is the handle of the shader module.

-> 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

getShaderModuleCreateInfoIdentifierEXT Source #

Arguments

:: forall a io. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) 
=> Device

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

-> ShaderModuleCreateInfo a

pCreateInfo is a pointer to a ShaderModuleCreateInfo structure.

-> 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

data PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source #

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. PhysicalDeviceShaderModuleIdentifierFeaturesEXT can also be used in the pNext chain of DeviceCreateInfo to selectively enable these features.

Valid Usage (Implicit)

See Also

VK_EXT_shader_module_identifier, Bool32, StructureType

Constructors

PhysicalDeviceShaderModuleIdentifierFeaturesEXT 

Fields

Instances

Instances details
Storable PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Show PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Eq PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

FromCStruct PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

ToCStruct PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Zero PhysicalDeviceShaderModuleIdentifierFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

data PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source #

VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT - Structure describing shader module identifier properties of an implementation

Members

The members of the PhysicalDeviceShaderModuleIdentifierPropertiesEXT structure describe the following:

Description

Note

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.

Valid Usage (Implicit)

See Also

VK_EXT_shader_module_identifier, StructureType

Constructors

PhysicalDeviceShaderModuleIdentifierPropertiesEXT 

Fields

Instances

Instances details
Storable PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Show PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

FromCStruct PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

ToCStruct PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Zero PhysicalDeviceShaderModuleIdentifierPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

data PipelineShaderStageModuleIdentifierCreateInfoEXT Source #

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

See Also

VK_EXT_shader_module_identifier, StructureType

Constructors

PipelineShaderStageModuleIdentifierCreateInfoEXT 

Fields

Instances

Instances details
Show PipelineShaderStageModuleIdentifierCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

FromCStruct PipelineShaderStageModuleIdentifierCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

ToCStruct PipelineShaderStageModuleIdentifierCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Zero PipelineShaderStageModuleIdentifierCreateInfoEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

data ShaderModuleIdentifierEXT Source #

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

ShaderModuleIdentifierEXT 

Fields

Instances

Instances details
Storable ShaderModuleIdentifierEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Show ShaderModuleIdentifierEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

FromCStruct ShaderModuleIdentifierEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

ToCStruct ShaderModuleIdentifierEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

Zero ShaderModuleIdentifierEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_module_identifier

type EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME = "VK_EXT_shader_module_identifier" Source #

pattern MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT :: forall a. Integral a => a Source #

VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT - Maximum length of a shader module identifier

See Also

VK_EXT_shader_module_identifier