1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci
6e5c31af7Sopenharmony_ci[[introduction]]
7e5c31af7Sopenharmony_ci= Introduction
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_ciThis document, referred to as the
10e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0["`Vulkan SC Specification`", ]
11e5c31af7Sopenharmony_ci"`Vulkan Specification`" or just the "`Specification`" hereafter, describes
12e5c31af7Sopenharmony_cithe Vulkan
13e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[SC]
14e5c31af7Sopenharmony_ciApplication Programming Interface (API).
15e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[]
16e5c31af7Sopenharmony_ci"`Base Vulkan Specification`" refers to the Vulkan Specification
17e5c31af7Sopenharmony_ci(https://registry.khronos.org/vulkan/) that Vulkan SC is based on.
18e5c31af7Sopenharmony_ci"`Vulkan`" and "`Vulkan SC`" refer to the Vulkan SC API and "`Base Vulkan`"
19e5c31af7Sopenharmony_cirefers to the Vulkan API that Vulkan SC is based on.
20e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
21e5c31af7Sopenharmony_ciVulkan is a http://www.open-std.org/jtc1/sc22/wg14/www/standards[C99] API
22e5c31af7Sopenharmony_cidesigned for explicit control of low-level graphics and compute
23e5c31af7Sopenharmony_cifunctionality.
24e5c31af7Sopenharmony_ci
25e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[]
26e5c31af7Sopenharmony_ciThe canonical version of the Specification is available in the official
27e5c31af7Sopenharmony_cihttps://registry.khronos.org/vulkan/[Vulkan Registry]
28e5c31af7Sopenharmony_ci(https://registry.khronos.org/vulkan/).
29e5c31af7Sopenharmony_ciThe source files used to generate the Vulkan specification are stored in the
30e5c31af7Sopenharmony_cihttps://github.com/KhronosGroup/Vulkan-Docs[Vulkan Documentation Repository]
31e5c31af7Sopenharmony_ci(https://github.com/KhronosGroup/Vulkan-Docs).
32e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[]
35e5c31af7Sopenharmony_ciThe canonical version of the Specification is available in the official
36e5c31af7Sopenharmony_cihttps://registry.khronos.org/vulkansc/[Vulkan SC Registry]
37e5c31af7Sopenharmony_ci(https://registry.khronos.org/vulkansc/).
38e5c31af7Sopenharmony_ciThe source files used to generate the Vulkan SC specification are stored in
39e5c31af7Sopenharmony_cithe https://github.com/KhronosGroup/VulkanSC-Docs[Vulkan SC Documentation
40e5c31af7Sopenharmony_ciRepository] (https://github.com/KhronosGroup/VulkanSC-Docs).
41e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
42e5c31af7Sopenharmony_ciThe source repository additionally has a public issue tracker and allows the
43e5c31af7Sopenharmony_cisubmission of pull requests that improve the specification.
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_ci
46e5c31af7Sopenharmony_ci[[introduction-conventions]]
47e5c31af7Sopenharmony_ci== Document Conventions
48e5c31af7Sopenharmony_ci
49e5c31af7Sopenharmony_ciThe Vulkan specification is intended for use by both implementors of the API
50e5c31af7Sopenharmony_ciand application developers seeking to make use of the API, forming a
51e5c31af7Sopenharmony_cicontract between these parties.
52e5c31af7Sopenharmony_ciSpecification text may address either party; typically the intended audience
53e5c31af7Sopenharmony_cican be inferred from context, though some sections are defined to address
54e5c31af7Sopenharmony_cionly one of these parties.
55e5c31af7Sopenharmony_ci(For example, <<fundamentals-validusage>> sections only address application
56e5c31af7Sopenharmony_cidevelopers).
57e5c31af7Sopenharmony_ciAny requirements, prohibitions, recommendations or options defined by
58e5c31af7Sopenharmony_ci<<introduction-normative-terminology, normative terminology>> are imposed
59e5c31af7Sopenharmony_cionly on the audience of that text.
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ci[NOTE]
62e5c31af7Sopenharmony_ci.Note
63e5c31af7Sopenharmony_ci====
64e5c31af7Sopenharmony_ciStructure and enumerated types defined in extensions that were promoted to
65e5c31af7Sopenharmony_cicore in a later version of Vulkan are now defined in terms of the equivalent
66e5c31af7Sopenharmony_ciVulkan core interfaces.
67e5c31af7Sopenharmony_ciThis affects the Vulkan Specification, the Vulkan header files, and the
68e5c31af7Sopenharmony_cicorresponding XML Registry.
69e5c31af7Sopenharmony_ci====
70e5c31af7Sopenharmony_ci
71e5c31af7Sopenharmony_ci
72e5c31af7Sopenharmony_ci[[introduction-ratified]]
73e5c31af7Sopenharmony_ci=== Ratification
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ci_Ratification_ of a Vulkan core version or extension is a status conferred
76e5c31af7Sopenharmony_ciby vote of the Khronos Board of Promoters, bringing that core version or
77e5c31af7Sopenharmony_ciextension under the umbrella of the Khronos IP Policy.
78e5c31af7Sopenharmony_ci
79e5c31af7Sopenharmony_ciAll Vulkan core versions and `KHR` extensions (including provisional
80e5c31af7Sopenharmony_cispecifications) are ratified, as are some multi-vendor `EXT` extensions.
81e5c31af7Sopenharmony_ciRatification status of extensions is described in the <<extensions, Layers &
82e5c31af7Sopenharmony_ciExtensions (Informative)>> appendix.
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ci[NOTE]
85e5c31af7Sopenharmony_ci.Note
86e5c31af7Sopenharmony_ci====
87e5c31af7Sopenharmony_ciRatification status is primarily of interest to IHVs developing GPU hardware
88e5c31af7Sopenharmony_ciand Vulkan implementations
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ciFor developers, ratification does not necessarily mean that an extension is
91e5c31af7Sopenharmony_ci"`better`"; has a more stable API; or is more widely supported than
92e5c31af7Sopenharmony_cialternative ways of achieving that functionality.
93e5c31af7Sopenharmony_ci
94e5c31af7Sopenharmony_ciInteractions between ratified and non-ratified extensions are not themselves
95e5c31af7Sopenharmony_ciratified.
96e5c31af7Sopenharmony_ci====
97e5c31af7Sopenharmony_ci
98e5c31af7Sopenharmony_ci
99e5c31af7Sopenharmony_ci[[introduction-informative-language]]
100e5c31af7Sopenharmony_ci=== Informative Language
101e5c31af7Sopenharmony_ci
102e5c31af7Sopenharmony_ciSome language in the specification is purely informative, intended to give
103e5c31af7Sopenharmony_cibackground or suggestions to implementors or developers.
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ciIf an entire chapter or section contains only informative language, its
106e5c31af7Sopenharmony_cititle will be suffixed with "`(Informative)`".
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ciAll NOTEs are implicitly informative.
109e5c31af7Sopenharmony_ci
110e5c31af7Sopenharmony_ci
111e5c31af7Sopenharmony_ci[[introduction-normative-terminology]]
112e5c31af7Sopenharmony_ci=== Normative Terminology
113e5c31af7Sopenharmony_ci
114e5c31af7Sopenharmony_ciWithin this specification, the key words *must*, *required*, *should*,
115e5c31af7Sopenharmony_ci*recommended*, *may*, and *optional* are to be interpreted as described in
116e5c31af7Sopenharmony_cihttps://www.ietf.org/rfc/rfc2119.txt[RFC 2119 - Key words for use in RFCs to
117e5c31af7Sopenharmony_ciIndicate Requirement Levels] (https://www.ietf.org/rfc/rfc2119.txt).
118e5c31af7Sopenharmony_ciThe additional key word *optionally* is an alternate form of *optional*, for
119e5c31af7Sopenharmony_ciuse where grammatically appropriate.
120e5c31af7Sopenharmony_ci
121e5c31af7Sopenharmony_ciThese key words are highlighted in the specification for clarity.
122e5c31af7Sopenharmony_ciIn text addressing application developers, their use expresses requirements
123e5c31af7Sopenharmony_cithat apply to application behavior.
124e5c31af7Sopenharmony_ciIn text addressing implementors, their use expresses requirements that apply
125e5c31af7Sopenharmony_cito implementations.
126e5c31af7Sopenharmony_ci
127e5c31af7Sopenharmony_ciIn text addressing application developers, the additional key words *can*
128e5c31af7Sopenharmony_ciand *cannot* are to be interpreted as describing the capabilities of an
129e5c31af7Sopenharmony_ciapplication, as follows:
130e5c31af7Sopenharmony_ci
131e5c31af7Sopenharmony_ci*can*::
132e5c31af7Sopenharmony_ciThis word means that the application is able to perform the action
133e5c31af7Sopenharmony_cidescribed.
134e5c31af7Sopenharmony_ci
135e5c31af7Sopenharmony_ci*cannot*::
136e5c31af7Sopenharmony_ciThis word means that the API and/or the execution environment provide no
137e5c31af7Sopenharmony_cimechanism through which the application can express or accomplish the action
138e5c31af7Sopenharmony_cidescribed.
139e5c31af7Sopenharmony_ci
140e5c31af7Sopenharmony_ciThese key words are never used in text addressing implementors.
141e5c31af7Sopenharmony_ci
142e5c31af7Sopenharmony_ci[NOTE]
143e5c31af7Sopenharmony_ci.Note
144e5c31af7Sopenharmony_ci====
145e5c31af7Sopenharmony_ciThere is an important distinction between *cannot* and *must not*, as used
146e5c31af7Sopenharmony_ciin this Specification.
147e5c31af7Sopenharmony_ci*Cannot* means something the application literally is unable to express or
148e5c31af7Sopenharmony_ciaccomplish through the API, while *must not* means something that the
149e5c31af7Sopenharmony_ciapplication is capable of expressing through the API, but that the
150e5c31af7Sopenharmony_ciconsequences of doing so are undefined: and potentially unrecoverable for
151e5c31af7Sopenharmony_cithe implementation (see <<fundamentals-validusage>>).
152e5c31af7Sopenharmony_ci====
153e5c31af7Sopenharmony_ci
154e5c31af7Sopenharmony_ciUnless otherwise noted in the section heading, all sections and appendices
155e5c31af7Sopenharmony_ciin this document are normative.
156e5c31af7Sopenharmony_ci
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ci[[introduction-technical-terminology]]
159e5c31af7Sopenharmony_ci=== Technical Terminology
160e5c31af7Sopenharmony_ci
161e5c31af7Sopenharmony_ciThe Vulkan Specification makes use of common engineering and graphics terms
162e5c31af7Sopenharmony_cisuch as *Pipeline*, *Shader*, and *Host* to identify and describe Vulkan API
163e5c31af7Sopenharmony_ciconstructs and their attributes, states, and behaviors.
164e5c31af7Sopenharmony_ciThe <<glossary,Glossary>> defines the basic meanings of these terms in the
165e5c31af7Sopenharmony_cicontext of the Specification.
166e5c31af7Sopenharmony_ciThe Specification text provides fuller definitions of the terms and may
167e5c31af7Sopenharmony_cielaborate, extend, or clarify the <<glossary,Glossary>> definitions.
168e5c31af7Sopenharmony_ciWhen a term defined in the <<glossary,Glossary>> is used in normative
169e5c31af7Sopenharmony_cilanguage within the Specification, the definitions within the Specification
170e5c31af7Sopenharmony_cigovern and supersede any meanings the terms may have in other technical
171e5c31af7Sopenharmony_cicontexts (i.e. outside the Specification).
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_ci
174e5c31af7Sopenharmony_ci[[introduction-normative-references]]
175e5c31af7Sopenharmony_ci=== Normative References
176e5c31af7Sopenharmony_ci
177e5c31af7Sopenharmony_ciReferences to external documents are considered normative references if the
178e5c31af7Sopenharmony_ciSpecification uses any of the normative terms defined in
179e5c31af7Sopenharmony_ci<<introduction-normative-terminology>> to refer to them or their
180e5c31af7Sopenharmony_cirequirements, either as a whole or in part.
181e5c31af7Sopenharmony_ci
182e5c31af7Sopenharmony_ciThe following documents are referenced by normative sections of the
183e5c31af7Sopenharmony_cispecification:
184e5c31af7Sopenharmony_ci
185e5c31af7Sopenharmony_ci[[ieee-754]]
186e5c31af7Sopenharmony_ciIEEE.
187e5c31af7Sopenharmony_ciAugust, 2008.
188e5c31af7Sopenharmony_ci_IEEE Standard for Floating-Point Arithmetic_.
189e5c31af7Sopenharmony_ciIEEE Std 754-2008.
190e5c31af7Sopenharmony_cihttps://dx.doi.org/10.1109/IEEESTD.2008.4610935 .
191e5c31af7Sopenharmony_ci
192e5c31af7Sopenharmony_ci[[data-format]] Andrew Garrard.
193e5c31af7Sopenharmony_ci_Khronos Data Format Specification, version 1.3_.
194e5c31af7Sopenharmony_cihttps://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html .
195e5c31af7Sopenharmony_ci
196e5c31af7Sopenharmony_ci[[spirv-extended]] John Kessenich.
197e5c31af7Sopenharmony_ci_SPIR-V Extended Instructions for GLSL, Version 1.00_ (February 10, 2016).
198e5c31af7Sopenharmony_cihttps://registry.khronos.org/spir-v/ .
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ci[[spirv-spec]] John Kessenich, Boaz Ouriel, and Raun Krisch.
201e5c31af7Sopenharmony_ci_SPIR-V Specification, Version 1.5, Revision 3, Unified_ (April 24, 2020).
202e5c31af7Sopenharmony_cihttps://registry.khronos.org/spir-v/ .
203e5c31af7Sopenharmony_ci
204e5c31af7Sopenharmony_ci[[itu-t-h264]]
205e5c31af7Sopenharmony_ciITU-T.
206e5c31af7Sopenharmony_ci_H.264 Advanced Video Coding for Generic Audiovisual Services_ (August,
207e5c31af7Sopenharmony_ci2021).
208e5c31af7Sopenharmony_cihttps://www.itu.int/rec/T-REC-H.264-202108-I/ .
209e5c31af7Sopenharmony_ci
210e5c31af7Sopenharmony_ci[[itu-t-h265]]
211e5c31af7Sopenharmony_ciITU-T.
212e5c31af7Sopenharmony_ci_H.265 High Efficiency Video Coding_ (August, 2021).
213e5c31af7Sopenharmony_cihttps://www.itu.int/rec/T-REC-H.265-202108-I/ .
214e5c31af7Sopenharmony_ci
215e5c31af7Sopenharmony_ci[[vulkan-registry]] Jon Leech.
216e5c31af7Sopenharmony_ci_The Khronos Vulkan API Registry_ (February 26, 2023).
217e5c31af7Sopenharmony_cihttps://registry.khronos.org/vulkan/specs/1.3/registry.html .
218e5c31af7Sopenharmony_ci
219e5c31af7Sopenharmony_ci[[vulkan-styleguide]] Jon Leech and Tobias Hector.
220e5c31af7Sopenharmony_ci_Vulkan Documentation and Extensions: Procedures and Conventions_ (February
221e5c31af7Sopenharmony_ci26, 2023).
222e5c31af7Sopenharmony_cihttps://registry.khronos.org/vulkan/specs/1.3/styleguide.html .
223e5c31af7Sopenharmony_ci
224e5c31af7Sopenharmony_ci[[LoaderInterfaceArchitecture]]
225e5c31af7Sopenharmony_ci_Architecture of the Vulkan Loader Interfaces_ (October, 2021).
226e5c31af7Sopenharmony_cihttps://github.com/KhronosGroup/Vulkan-Loader/blob/master/docs/LoaderInterfaceArchitecture.md
227e5c31af7Sopenharmony_ci.
228e5c31af7Sopenharmony_ci
229e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[]
230e5c31af7Sopenharmony_ci[[introduction-vulkansc-philosophy]]
231e5c31af7Sopenharmony_ci== Safety Critical Philosophy
232e5c31af7Sopenharmony_ci
233e5c31af7Sopenharmony_ciVulkan SC {revnumber} is based on Vulkan 1.2 and, except where explicitly
234e5c31af7Sopenharmony_cinoted, supports all of the same features, properties, and limits as Vulkan
235e5c31af7Sopenharmony_ci1.2.
236e5c31af7Sopenharmony_ci
237e5c31af7Sopenharmony_ciThroughout the Vulkan SC specification, changes have been made to the Base
238e5c31af7Sopenharmony_ciVulkan Specification in order to align it with safety critical use cases and
239e5c31af7Sopenharmony_cicertification.
240e5c31af7Sopenharmony_ciIn general changes were made to meet the following categories:
241e5c31af7Sopenharmony_ci
242e5c31af7Sopenharmony_ci  * Deterministic Execution (predictable execution times and results)
243e5c31af7Sopenharmony_ci  * Robustness (error handling, removing ambiguity, clarifying undefined:
244e5c31af7Sopenharmony_ci    behavior)
245e5c31af7Sopenharmony_ci  * Simplification (changes made to reduce certification effort and
246e5c31af7Sopenharmony_ci    challenges)
247e5c31af7Sopenharmony_ci
248e5c31af7Sopenharmony_ciTo simplify capturing the reasoning behind deviations made from the Base
249e5c31af7Sopenharmony_ciVulkan Specification, the Vulkan SC specification utilizes change
250e5c31af7Sopenharmony_ciidentifications to give the reader insight into why the change was made in a
251e5c31af7Sopenharmony_ciconcise manner.
252e5c31af7Sopenharmony_ciThe change identifications are captured in
253e5c31af7Sopenharmony_ci<<introduction-vulkansc-change-justification-table>>.
254e5c31af7Sopenharmony_ciIn addition, the Vulkan SC specification contains <<vulkansc-deviations>>
255e5c31af7Sopenharmony_ciwhich is a complete list of changes between Base Vulkan and Vulkan SC.
256e5c31af7Sopenharmony_ciThis is targeted at readers who are familiar with Base Vulkan and would like
257e5c31af7Sopenharmony_cito understand the differences between Vulkan SC and the Base Vulkan
258e5c31af7Sopenharmony_cispecification.
259e5c31af7Sopenharmony_ci
260e5c31af7Sopenharmony_ciVulkan SC follows the Base Vulkan philosophy of requiring valid usage from
261e5c31af7Sopenharmony_cithe application.
262e5c31af7Sopenharmony_ciIt is left to each implementation to determine how to ensure safe operation
263e5c31af7Sopenharmony_ciwith respect to invalid usage.
264e5c31af7Sopenharmony_ciThis may: involve determining that certain invalid usage does not pose a
265e5c31af7Sopenharmony_cisafety risk, adding valid usage checks in the driver, requiring valid usage
266e5c31af7Sopenharmony_cichecks in the application, or some combination of these.
267e5c31af7Sopenharmony_ciAdditionally, validation layers are supported during development.
268e5c31af7Sopenharmony_ci
269e5c31af7Sopenharmony_ci[[introduction-vulkansc-change-justification-table]]
270e5c31af7Sopenharmony_ci=== Change Justification Table
271e5c31af7Sopenharmony_ci
272e5c31af7Sopenharmony_ciThe following is a list of the safety critical change identifications used
273e5c31af7Sopenharmony_cito concisely capture the justification for deviations from the Base Vulkan
274e5c31af7Sopenharmony_ciSpecification.
275e5c31af7Sopenharmony_ci
276e5c31af7Sopenharmony_ci.Change Justifications
277e5c31af7Sopenharmony_ci[width="100%",options="header",cols="15h,~"]
278e5c31af7Sopenharmony_ci|====
279e5c31af7Sopenharmony_ci| Change ID     | Description
280e5c31af7Sopenharmony_ci| SCID-1[[SCID-1]]      | *Deterministic behavior* - no randomness or unpredictability, always produce the same output from a given starting condition or initial state
281e5c31af7Sopenharmony_ci| SCID-2[[SCID-2]]      | *Asynchronous calls* - calls initiated by the application but may not execute or use their parameter data until a later time shall be clearly defined when any parameter data is used, especially data which is passed by reference or pointer
282e5c31af7Sopenharmony_ci| SCID-3[[SCID-3]]      | *Notification of change of state* - avoid the use of asynchronous events causing code to execute (i.e. callbacks) as this can cause the worst case execution time of a system to be indeterminate
283e5c31af7Sopenharmony_ci| SCID-4[[SCID-4]]      | *Garbage collection methods* - avoid the use of garbage collection as this can cause the worst case execution time of a system to be indeterminate.  Avoid memory fragmentation by deleting entire buffers instead of individual items within a buffer
284e5c31af7Sopenharmony_ci| SCID-5[[SCID-5]]      | *Fully testable* - all behavior of the API must be testable in a repeatable manner, consistent from test run to test run (in some cases this may mean testable by inspection)
285e5c31af7Sopenharmony_ci| SCID-6[[SCID-6]]      | *Undefined behavior* - the API must behave as expected under valid input conditions, clearly document conditions that would result in 'fatal error' leaving the system in an unrecoverable state, and document conditions that would result in undefined: behavior based on invalid input
286e5c31af7Sopenharmony_ci| SCID-7[[SCID-7]]      | *Unique ID* - provide a facility to return a run time implementation unique identifier specific
287e5c31af7Sopenharmony_cito that runtime so that is may be interrogated at any time.  For example, such information could be the version number, name, date, release build number or a combination of these that is unique and comprehensible
288e5c31af7Sopenharmony_ci| SCID-8[[SCID-8]]      | *Code complexity* - reducing code complexity to help facilitate certification (for example if there are multiple ways to do the same thing, potentially eliminating one or more of the alternative methods)
289e5c31af7Sopenharmony_ci|====
290e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
291