• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021-2024 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5include::{generated}/meta/{refprefix}VK_EXT_shader_module_identifier.adoc[]
6
7=== Other Extension Metadata
8
9*Last Modified Date*::
10    2022-05-16
11*IP Status*::
12    No known IP claims.
13*Contributors*::
14  - Hans-Kristian Arntzen, Valve
15  - Ricardo Garcia, Igalia
16  - Piers Daniell, NVIDIA
17  - Jan-Harald Fredriksen, Arm
18  - Tom Olson, Arm
19  - Faith Ekstrand, Collabora
20
21=== Description
22
23Some applications generate SPIR-V code at runtime.
24When pipeline caches are primed, either explicitly through e.g.
25slink:VkPipelineCache mechanisms, or implicitly through driver managed
26caches, having to re-generate SPIR-V modules is redundant.
27SPIR-V modules could be cached on disk by an application, but the extra disk
28size requirement might be prohibitive in some use cases.
29
30This extension adds the ability for an application to query a small
31identifier associated with a slink:VkShaderModule.
32On subsequent runs of the application, the same identifier can: be provided
33in lieu of a slink:VkShaderModule object.
34A pipeline creation call with such a module may: succeed if a pipeline could
35be created without invoking compilation, and information inside the SPIR-V
36module is not required by the implementation.
37
38ename:VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT must: be used
39if only the identifier is provided, and this use case is intended to work
40like a non-blocking, speculative compile.
41Applications can: fallback as necessary.
42
43The main motivation for identifying the module itself and not the entire
44pipeline is that pipeline identifiers change when a driver is updated, but
45module identifiers are expected to be stable for any particular driver
46implementation.
47This approach is helpful for shader pre-compilation systems which can prime
48pipeline caches ahead of time.
49When on-disk pipeline caches are updated, the same shader identifiers could
50lead to a pipeline cache hit.
51
52include::{generated}/interfaces/VK_EXT_shader_module_identifier.adoc[]
53
54=== Version History
55
56  * Revision 1, 2022-03-16 (Hans-Kristian Arntzen)
57  ** Initial draft
58