Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- Not ratified
- 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
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
Extending
PhysicalDeviceFeatures2
,DeviceCreateInfo
:Extending
PhysicalDeviceProperties2
:Extending
PipelineShaderStageCreateInfo
:
New Enum Constants
EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION
MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT
Extending
StructureType
:
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
- getShaderModuleIdentifierEXT :: forall io. MonadIO io => Device -> ShaderModule -> io ShaderModuleIdentifierEXT
- getShaderModuleCreateInfoIdentifierEXT :: forall a io. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) => Device -> ShaderModuleCreateInfo a -> io ShaderModuleIdentifierEXT
- data PhysicalDeviceShaderModuleIdentifierFeaturesEXT = PhysicalDeviceShaderModuleIdentifierFeaturesEXT {}
- data PhysicalDeviceShaderModuleIdentifierPropertiesEXT = PhysicalDeviceShaderModuleIdentifierPropertiesEXT {}
- data PipelineShaderStageModuleIdentifierCreateInfoEXT = PipelineShaderStageModuleIdentifierCreateInfoEXT {}
- data ShaderModuleIdentifierEXT = ShaderModuleIdentifierEXT {}
- type EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION = 1
- pattern EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION :: forall a. Integral a => a
- type EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME = "VK_EXT_shader_module_identifier"
- pattern EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- type MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT = 32
- pattern MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT :: forall a. Integral a => a
Documentation
getShaderModuleIdentifierEXT Source #
:: forall io. MonadIO io | |
=> Device |
|
-> ShaderModule |
|
-> 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
- shaderModuleIdentifier feature must be enabled
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
shaderModule
must be a validShaderModule
handle -
pIdentifier
must be a valid pointer to aShaderModuleIdentifierEXT
structure -
shaderModule
must have been created, allocated, or retrieved fromdevice
See Also
VK_EXT_shader_module_identifier,
Device
, ShaderModule
,
ShaderModuleIdentifierEXT
getShaderModuleCreateInfoIdentifierEXT Source #
:: forall a io. (Extendss ShaderModuleCreateInfo a, PokeChain a, MonadIO io) | |
=> Device |
|
-> ShaderModuleCreateInfo a |
|
-> 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
- shaderModuleIdentifier feature must be enabled
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pCreateInfo
must be a valid pointer to a validShaderModuleCreateInfo
structure -
pIdentifier
must be a valid pointer to aShaderModuleIdentifierEXT
structure
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
PhysicalDeviceShaderModuleIdentifierFeaturesEXT | |
|
Instances
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
PhysicalDeviceShaderModuleIdentifierPropertiesEXT | |
|
Instances
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 andidentifierSize
is not equal to 0, the shaderModuleIdentifier feature must be enabled
-
If this struct is included in a
pNext
chain ofPipelineShaderStageCreateInfo
andidentifierSize
is not equal to 0, the pipeline must be created with thePIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT
flag set -
identifierSize
must be less-or-equal toMAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT
Valid Usage (Implicit)
-
If
identifierSize
is not0
,pIdentifier
must be a valid pointer to an array ofidentifierSize
uint8_t
values
See Also
PipelineShaderStageModuleIdentifierCreateInfoEXT | |
|
Instances
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
ShaderModuleIdentifierEXT | |
|
Instances
pattern EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION :: forall a. Integral a => a Source #
type EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME = "VK_EXT_shader_module_identifier" Source #
pattern EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
type MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT = 32 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