1// Copyright 2015-2023 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5[appendix]
6[[spirvenv]]
7= Vulkan Environment for SPIR-V
8
9Shaders for Vulkan are defined by the <<spirv-spec,Khronos SPIR-V
10Specification>> as well as the <<spirv-extended,Khronos SPIR-V Extended
11Instructions for GLSL>> Specification.
12This appendix defines additional SPIR-V requirements applying to Vulkan
13shaders.
14
15== Versions and Formats
16
17// The fallthrough logic here defines {spirv-versions} according to the
18// highest Vulkan version supported, and simplifies the markup.
19
20ifdef::VK_VERSION_1_0[]
21:spirv-versions: 1.0 version
22:api-version: 1.0
23endif::VK_VERSION_1_0[]
24ifdef::VK_VERSION_1_1[]
25:spirv-versions: 1.0, 1.1, 1.2, and 1.3 versions
26:api-version: 1.1
27endif::VK_VERSION_1_1[]
28ifdef::VK_VERSION_1_2[]
29:spirv-versions: 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 versions
30:api-version: 1.2
31endif::VK_VERSION_1_2[]
32ifdef::VK_VERSION_1_3[]
33:spirv-versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, and 1.6 versions
34:api-version: 1.3
35endif::VK_VERSION_1_3[]
36
37A Vulkan {api-version} implementation must: support the {spirv-versions} of
38SPIR-V and the 1.0 version of the SPIR-V Extended Instructions for GLSL.
39ifndef::VK_VERSION_1_2[]
40ifdef::VK_KHR_spirv_1_4[]
41If the `apiext:VK_KHR_spirv_1_4` extension is enabled, the implementation
42must: additionally support the 1.4 version of SPIR-V.
43endif::VK_KHR_spirv_1_4[]
44endif::VK_VERSION_1_2[]
45
46A SPIR-V module
47ifndef::VKSC_VERSION_1_0[]
48passed into flink:vkCreateShaderModule
49endif::VKSC_VERSION_1_0[]
50is interpreted as a series of 32-bit words in host endianness, with literal
51strings packed as described in section 2.2 of the SPIR-V Specification.
52The first few words of the SPIR-V module must: be a magic number and a
53SPIR-V version number, as described in section 2.3 of the SPIR-V
54Specification.
55
56
57[[spirvenv-capabilities]]
58== Capabilities
59
60The <<spirvenv-capabilities-table, table below>> lists the set of SPIR-V
61capabilities that may: be supported in Vulkan implementations.
62ifndef::VKSC_VERSION_1_0[]
63The application must: not use any of these capabilities in SPIR-V passed to
64flink:vkCreateShaderModule unless one of the following conditions is met for
65the slink:VkDevice specified in the pname:device parameter of
66flink:vkCreateShaderModule:
67endif::VKSC_VERSION_1_0[]
68ifdef::VKSC_VERSION_1_0[]
69The application must: not select a pipeline cache entry, which was created
70by passing a SPIR-V module using any of these capabilities to the
71<<pipelines-offline-compilation, offline pipeline cache compiler>>, in a
72ptext:vkCreate*Pipelines command unless one of the following conditions is
73met for the slink:VkDevice specified in the pname:device parameter of the
74ptext:vkCreate*Pipelines command:
75endif::VKSC_VERSION_1_0[]
76
77  * The corresponding field in the table is blank.
78  * Any corresponding Vulkan feature is enabled.
79  * Any corresponding Vulkan extension is enabled.
80  * Any corresponding Vulkan property is supported.
81  * The corresponding core version is supported (as returned by
82    slink:VkPhysicalDeviceProperties::pname:apiVersion).
83
84:captableindent: {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp}
85[[spirvenv-capabilities-table]]
86.List of SPIR-V Capabilities and corresponding Vulkan features, extensions, or core version
87[options="header"]
88|====
89| SPIR-V code:OpCapability +
90  {captableindent} Vulkan feature, extension, or core version
91include::{generated}/spirvcap/captable.adoc[]
92|====
93
94ifndef::VKSC_VERSION_1_0[]
95The application must: not pass a SPIR-V module containing any of the
96following to flink:vkCreateShaderModule:
97endif::VKSC_VERSION_1_0[]
98ifdef::VKSC_VERSION_1_0[]
99The application must: not select a pipeline cache entry, which was created
100by passing a SPIR-V module containing any of the following to the
101<<pipelines-offline-compilation, offline pipeline cache compiler>>,
102containing any of the following in a ptext:vkCreate*Pipelines command:
103endif::VKSC_VERSION_1_0[]
104
105  * any code:OpCapability not listed above,
106  * an unsupported capability, or
107  * a capability which corresponds to a Vulkan feature or extension which
108    has not been enabled.
109
110
111[[spirvenv-extensions]]
112=== SPIR-V Extensions
113
114The <<spirvenv-extensions-table,following table>> lists SPIR-V extensions
115that implementations may: support.
116ifndef::VKSC_VERSION_1_0[]
117The application must: not pass a SPIR-V module to flink:vkCreateShaderModule
118that uses the following SPIR-V extensions unless one of the following
119conditions is met for the slink:VkDevice specified in the pname:device
120parameter of flink:vkCreateShaderModule:
121endif::VKSC_VERSION_1_0[]
122ifdef::VKSC_VERSION_1_0[]
123The application must: not select a pipeline cache entry, which was created
124by passing a SPIR-V module using any of the following SPIR-V extensions to
125the <<pipelines-offline-compilation, offline pipeline cache compiler>>, in a
126ptext:vkCreate*Pipelines command unless one of the following conditions is
127met for the slink:VkDevice specified in the pname:device parameter of the
128ptext:vkCreate*Pipelines command:
129endif::VKSC_VERSION_1_0[]
130
131  * Any corresponding Vulkan extension is enabled.
132  * The corresponding core version is supported (as returned by
133    slink:VkPhysicalDeviceProperties::pname:apiVersion).
134
135[[spirvenv-extensions-table]]
136.List of SPIR-V Extensions and corresponding Vulkan extensions or core version
137[options="header"]
138|====
139| SPIR-V code:OpExtension +
140  {captableindent} Vulkan extension or core version
141include::{generated}/spirvcap/exttable.adoc[]
142|====
143
144
145[[spirvenv-module-validation]]
146== Validation Rules Within a Module
147
148ifndef::VKSC_VERSION_1_0[]
149A SPIR-V module passed to flink:vkCreateShaderModule must: conform to the
150following rules:
151endif::VKSC_VERSION_1_0[]
152ifdef::VKSC_VERSION_1_0[]
153Pipeline cache entries must: have been compiled with the
154<<pipelines-offline-compilation, offline pipeline cache compiler>> using
155SPIR-V modules that conform to the following rules:
156endif::VKSC_VERSION_1_0[]
157
158
159[[spirvenv-module-validation-standalone]]
160=== Standalone SPIR-V Validation
161
162[open,refpage='StandaloneSpirv',desc='Standalone SPIR-V Validation',type='spirv']
163--
164:refpage: StandaloneSpirv
165
166The following rules can: be validated with only the SPIR-V module itself.
167They do not depend on knowledge of the implementation and its capabilities
168or knowledge of runtime information, such as enabled features.
169
170.Valid Usage
171****
172// NOTE: Do not conditionalize the "standalone" VUs.
173// Write as though all extensions were enabled.
174// Add any needed conditional logic to the runtime section if needed.
175  * [[VUID-{refpage}-None-04633]]
176    Every entry point must: have no return value and accept no arguments
177  * [[VUID-{refpage}-None-04634]]
178    The static function-call graph for an entry point must: not contain
179    cycles; that is, static recursion is not allowed
180  * [[VUID-{refpage}-None-04635]]
181    The code:Logical or code:PhysicalStorageBuffer64 addressing model must:
182    be selected
183  * [[VUID-{refpage}-None-04636]]
184    code:Scope for execution must: be limited to code:Workgroup or
185    code:Subgroup
186  * [[VUID-{refpage}-None-04637]]
187    If the code:Scope for execution is code:Workgroup, then it must: only be
188    used in the task, mesh, tessellation control, or compute
189    {ExecutionModel}
190  * [[VUID-{refpage}-None-04638]]
191    code:Scope for memory must: be limited to code:Device, code:QueueFamily,
192    code:Workgroup, code:ShaderCallKHR, code:Subgroup, or code:Invocation
193  * [[VUID-{refpage}-ExecutionModel-07320]]
194    If the {ExecutionModel} is code:TessellationControl, and the
195    code:MemoryModel is code:GLSL450, the code:Scope for memory must: not be
196    code:Workgroup
197  * [[VUID-{refpage}-None-07321]]
198    If the code:Scope for memory is code:Workgroup, then it must: only be
199    used in the task, mesh, tessellation control, or compute
200    {ExecutionModel}
201  * [[VUID-{refpage}-None-04640]]
202    If the code:Scope for memory is code:ShaderCallKHR, then it must: only
203    be used in ray generation, intersection, closest hit, any-hit, miss, and
204    callable {ExecutionModel}
205  * [[VUID-{refpage}-None-04641]]
206    If the code:Scope for memory is code:Invocation, then memory semantics
207    must: be code:None
208  * [[VUID-{refpage}-None-04642]]
209    code:Scope for <<shaders-group-operations,group operations>> must: be
210    limited to code:Subgroup
211  * [[VUID-{refpage}-SubgroupVoteKHR-07951]]
212    If none of the code:SubgroupVoteKHR, code:GroupNonUniform, or
213    code:SubgroupBallotKHR capabilities are declared, code:Scope for memory
214    must: not be code:Subgroup
215  * [[VUID-{refpage}-None-04643]]
216    {StorageClass} must: be limited to code:UniformConstant, code:Input,
217    code:Uniform, code:Output, code:Workgroup, code:Private, code:Function,
218    code:PushConstant, code:Image, code:StorageBuffer, code:RayPayloadKHR,
219    code:IncomingRayPayloadKHR, code:HitAttributeKHR, code:CallableDataKHR,
220    code:IncomingCallableDataKHR, code:ShaderRecordBufferKHR,
221    code:PhysicalStorageBuffer, or code:TileImageEXT
222  * [[VUID-{refpage}-None-04644]]
223    If the {StorageClass} is code:Output, then it must: not be used in the
224    code:GlCompute, code:RayGenerationKHR, code:IntersectionKHR,
225    code:AnyHitKHR, code:ClosestHitKHR, code:MissKHR, or code:CallableKHR
226    {ExecutionModel}
227  * [[VUID-{refpage}-None-04645]]
228    If the {StorageClass} is code:Workgroup, then it must: only be used in
229    the task, mesh, or compute {ExecutionModel}
230  * [[VUID-{refpage}-None-08720]]
231    If the {StorageClass} is code:TileImageEXT, then it must: only be used
232    in the fragment execution model
233  * [[VUID-{refpage}-OpAtomicStore-04730]]
234    code:OpAtomicStore must: not use code:Acquire, code:AcquireRelease, or
235    code:SequentiallyConsistent memory semantics
236  * [[VUID-{refpage}-OpAtomicLoad-04731]]
237    code:OpAtomicLoad must: not use code:Release, code:AcquireRelease, or
238    code:SequentiallyConsistent memory semantics
239  * [[VUID-{refpage}-OpMemoryBarrier-04732]]
240    code:OpMemoryBarrier must: use one of code:Acquire, code:Release,
241    code:AcquireRelease, or code:SequentiallyConsistent memory semantics
242  * [[VUID-{refpage}-OpMemoryBarrier-04733]]
243    code:OpMemoryBarrier must: include at least one {StorageClass}
244  * [[VUID-{refpage}-OpControlBarrier-04650]]
245    If the semantics for code:OpControlBarrier includes one of code:Acquire,
246    code:Release, code:AcquireRelease, or code:SequentiallyConsistent memory
247    semantics, then it must: include at least one {StorageClass}
248  * [[VUID-{refpage}-OpVariable-04651]]
249    Any code:OpVariable with an code:Initializer operand must: have
250    code:Output, code:Private, code:Function, or code:Workgroup as its
251    {StorageClass} operand
252  * [[VUID-{refpage}-OpVariable-04734]]
253    Any code:OpVariable with an code:Initializer operand and code:Workgroup
254    as its {StorageClass} operand must: use code:OpConstantNull as the
255    initializer
256  * [[VUID-{refpage}-OpReadClockKHR-04652]]
257    code:Scope for code:OpReadClockKHR must: be limited to code:Subgroup or
258    code:Device
259  * [[VUID-{refpage}-OriginLowerLeft-04653]]
260    The code:OriginLowerLeft {ExecutionMode} must: not be used; fragment
261    entry points must: declare code:OriginUpperLeft
262  * [[VUID-{refpage}-PixelCenterInteger-04654]]
263    The code:PixelCenterInteger {ExecutionMode} must: not be used (pixels
264    are always centered at half-integer coordinates)
265  * [[VUID-{refpage}-UniformConstant-04655]]
266    Any variable in the code:UniformConstant {StorageClass} must: be typed
267    as either code:OpTypeImage, code:OpTypeSampler, code:OpTypeSampledImage,
268    code:OpTypeAccelerationStructureKHR, or an array of one of these types
269  * [[VUID-{refpage}-Uniform-06807]]
270    Any variable in the code:Uniform or code:StorageBuffer {StorageClass}
271    must: be typed as code:OpTypeStruct or an array of this type
272  * [[VUID-{refpage}-PushConstant-06808]]
273    Any variable in the code:PushConstant {StorageClass} must: be typed as
274    code:OpTypeStruct
275  * [[VUID-{refpage}-OpTypeImage-04656]]
276    code:OpTypeImage must: declare a scalar 32-bit float, 64-bit integer, or
277    32-bit integer type for the "`Sampled Type`" (code:RelaxedPrecision can:
278    be applied to a sampling instruction and to the variable holding the
279    result of a sampling instruction)
280  * [[VUID-{refpage}-OpTypeImage-04657]]
281    code:OpTypeImage must: have a "`Sampled`" operand of 1 (sampled image)
282    or 2 (storage image)
283  * [[VUID-{refpage}-OpTypeSampledImage-06671]]
284    code:OpTypeSampledImage must: have a code:OpTypeImage with a "`Sampled`"
285    operand of 1 (sampled image)
286  * [[VUID-{refpage}-Image-04965]]
287    The <<spirv-type,SPIR-V Type>> of the code:Image code:Format operand of
288    an code:OpTypeImage must: match the code:Sampled code:Type, as defined
289    in <<spirvenv-format-type-matching>>
290  * [[VUID-{refpage}-OpImageTexelPointer-04658]]
291    If an code:OpImageTexelPointer is used in an atomic operation, the image
292    type of the code:image parameter to code:OpImageTexelPointer must: have
293    an image format of code:R64i, code:R64ui, code:R32f, code:R32i, or
294    code:R32ui
295  * [[VUID-{refpage}-OpImageQuerySizeLod-04659]]
296    code:OpImageQuerySizeLod, code:OpImageQueryLod, and
297    code:OpImageQueryLevels must: only consume an "`Image`" operand whose
298    type has its "`Sampled`" operand set to 1
299  * [[VUID-{refpage}-OpTypeImage-06214]]
300    An code:OpTypeImage with a "`Dim`" operand of code:SubpassData must:
301    have an "`Arrayed`" operand of 0 (non-arrayed) and a "`Sampled`" operand
302    of 2 (storage image)
303  * [[VUID-{refpage}-SubpassData-04660]]
304    The [eq]#(u,v)# coordinates used for a code:SubpassData must: be the
305    <id> of a constant vector [eq]#(0,0)#, or if a layer coordinate is used,
306    must: be a vector that was formed with constant 0 for the [eq]#u# and
307    [eq]#v# components
308  * [[VUID-{refpage}-OpTypeImage-06924]]
309    Objects of types code:OpTypeImage, code:OpTypeSampler,
310    code:OpTypeSampledImage, code:OpTypeAccelerationStructureKHR, and arrays
311    of these types must: not be stored to or modified
312  * [[VUID-{refpage}-Uniform-06925]]
313    Any variable in the code:Uniform {StorageClass} decorated as code:Block
314    must: not be stored to or modified
315  * [[VUID-{refpage}-Offset-04663]]
316    Image operand code:Offset must: only be used with code:OpImage*Gather
317    instructions
318  * [[VUID-{refpage}-Offset-04865]]
319    Any image instruction which uses an code:Offset, code:ConstOffset, or
320    code:ConstOffsets image operand, must only consume a "`Sampled Image`"
321    operand whose type has its "`Sampled`" operand set to 1
322  * [[VUID-{refpage}-OpImageGather-04664]]
323    The "`Component`" operand of code:OpImageGather, and
324    code:OpImageSparseGather must: be the <id> of a constant instruction
325  * [[VUID-{refpage}-OpImage-04777]]
326    code:OpImage*Dref* instructions must: not consume an image whose `Dim`
327    is 3D
328  * [[VUID-{refpage}-None-04667]]
329    Structure types must: not contain opaque types
330  * [[VUID-{refpage}-BuiltIn-04668]]
331    Any code:BuiltIn decoration not listed in
332    <<interfaces-builtin-variables>> must: not be used
333  * [[VUID-{refpage}-Location-06672]]
334    The code:Location or code:Component decorations must: only be used with
335    the code:Input, code:Output, code:RayPayloadKHR,
336    code:IncomingRayPayloadKHR, code:HitAttributeKHR,
337    code:HitObjectAttributeNV, code:CallableDataKHR,
338    code:IncomingCallableDataKHR, or code:ShaderRecordBufferKHR storage
339    classes
340  * [[VUID-{refpage}-Location-04915]]
341    The code:Location or code:Component decorations must: not be used with
342    code:BuiltIn
343  * [[VUID-{refpage}-Location-04916]]
344    The code:Location decorations must: be used on
345    <<interfaces-iointerfaces-user,user-defined variables>>
346  * [[VUID-{refpage}-Location-04917]]
347    If a <<interfaces-iointerfaces-user,user-defined variable>> is not a
348    pointer to a code:Block decorated code:OpTypeStruct, then the
349    code:OpVariable must: have a code:Location decoration
350  * [[VUID-{refpage}-Location-04918]]
351    If a <<interfaces-iointerfaces-user,user-defined variable>> has a
352    code:Location decoration, and the variable is a pointer to a
353    code:OpTypeStruct, then the members of that structure must: not have
354    code:Location decorations
355  * [[VUID-{refpage}-Location-04919]]
356    If a <<interfaces-iointerfaces-user,user-defined variable>> does not
357    have a code:Location decoration, and the variable is a pointer to a
358    code:Block decorated code:OpTypeStruct, then each member of the struct
359    must: have a code:Location decoration
360  * [[VUID-{refpage}-Component-04920]]
361    The code:Component decoration value must: not be greater than 3
362  * [[VUID-{refpage}-Component-04921]]
363    If the code:Component decoration is used on an code:OpVariable that has
364    a code:OpTypeVector type with a code:Component code:Type with a
365    code:Width that is less than or equal to 32, the sum of its
366    code:Component code:Count and the code:Component decoration value must:
367    be less than or equal to 4
368  * [[VUID-{refpage}-Component-04922]]
369    If the code:Component decoration is used on an code:OpVariable that has
370    a code:OpTypeVector type with a code:Component code:Type with a
371    code:Width that is equal to 64, the sum of two times its code:Component
372    code:Count and the code:Component decoration value must: be less than or
373    equal to 4
374  * [[VUID-{refpage}-Component-04923]]
375    The code:Component decorations value must: not be 1 or 3 for scalar or
376    two-component 64-bit data types
377  * [[VUID-{refpage}-Component-04924]]
378    The code:Component decorations must: not be used with any type that is
379    not a scalar or vector, or an array of such a type
380  * [[VUID-{refpage}-Component-07703]]
381    The code:Component decorations must: not be used for a 64-bit vector
382    type with more than two components
383  * [[VUID-{refpage}-GLSLShared-04669]]
384    The code:GLSLShared and code:GLSLPacked decorations must: not be used
385  * [[VUID-{refpage}-Flat-04670]]
386    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
387    decorations must: only be used on variables with the code:Output or
388    code:Input {StorageClass}
389  * [[VUID-{refpage}-Flat-06201]]
390    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
391    decorations must: not be used on variables with the code:Output storage
392    class in a fragment shader
393  * [[VUID-{refpage}-Flat-06202]]
394    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
395    decorations must: not be used on variables with the code:Input storage
396    class in a vertex shader
397  * [[VUID-{refpage}-PerVertexKHR-06777]]
398    The code:PerVertexKHR decoration must: only be used on variables with
399    the code:Input {StorageClass} in a fragment shader
400  * [[VUID-{refpage}-Flat-04744]]
401    Any variable with integer or double-precision floating-point type and
402    with code:Input {StorageClass} in a fragment shader, must: be decorated
403    code:Flat
404  * [[VUID-{refpage}-ViewportRelativeNV-04672]]
405    The code:ViewportRelativeNV decoration must: only be used on a variable
406    decorated with code:Layer in the vertex, tessellation evaluation, or
407    geometry shader stages
408  * [[VUID-{refpage}-ViewportRelativeNV-04673]]
409    The code:ViewportRelativeNV decoration must: not be used unless a
410    variable decorated with one of code:ViewportIndex or code:ViewportMaskNV
411    is also statically used by the same code:OpEntryPoint
412  * [[VUID-{refpage}-ViewportMaskNV-04674]]
413    The code:ViewportMaskNV and code:ViewportIndex decorations must: not
414    both be statically used by one or more code:OpEntryPoint's that form the
415    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
416    stages>> of a graphics pipeline
417  * [[VUID-{refpage}-FPRoundingMode-04675]]
418    Rounding modes other than round-to-nearest-even and round-towards-zero
419    must: not be used for the code:FPRoundingMode decoration
420  * [[VUID-{refpage}-Invariant-04677]]
421    Variables decorated with code:Invariant and variables with structure
422    types that have any members decorated with code:Invariant must: be in
423    the code:Output or code:Input {StorageClass}, code:Invariant used on an
424    code:Input {StorageClass} variable or structure member has no effect
425  * [[VUID-{refpage}-VulkanMemoryModel-04678]]
426    [[builtin-volatile-semantics]] If the code:VulkanMemoryModel capability
427    is not declared, the code:Volatile decoration must: be used on any
428    variable declaration that includes one of the code:SMIDNV,
429    code:WarpIDNV, code:SubgroupSize, code:SubgroupLocalInvocationId,
430    code:SubgroupEqMask, code:SubgroupGeMask, code:SubgroupGtMask,
431    code:SubgroupLeMask, or code:SubgroupLtMask code:BuiltIn decorations
432    when used in the ray generation, closest hit, miss, intersection, or
433    callable shaders, or with the code:RayTmaxKHR code:Builtin decoration
434    when used in an intersection shader
435  * [[VUID-{refpage}-VulkanMemoryModel-04679]]
436    If the code:VulkanMemoryModel capability is declared, the code:OpLoad
437    instruction must: use the code:Volatile memory semantics when it
438    accesses into any variable that includes one of the code:SMIDNV,
439    code:WarpIDNV, code:SubgroupSize, code:SubgroupLocalInvocationId,
440    code:SubgroupEqMask, code:SubgroupGeMask, code:SubgroupGtMask,
441    code:SubgroupLeMask, or code:SubgroupLtMask code:BuiltIn decorations
442    when used in the ray generation, closest hit, miss, intersection, or
443    callable shaders, or with the code:RayTmaxKHR code:Builtin decoration
444    when used in an intersection shader
445  * [[VUID-{refpage}-OpTypeRuntimeArray-04680]]
446    code:OpTypeRuntimeArray must: only be used for:
447  ** the last member of a code:Block-decorated code:OpTypeStruct in
448     code:StorageBuffer or code:PhysicalStorageBuffer storage {StorageClass}
449  ** code:BufferBlock-decorated code:OpTypeStruct in the code:Uniform
450     storage {StorageClass}
451  ** the outermost dimension of an arrayed variable in the
452     code:StorageBuffer, code:Uniform, or code:UniformConstant storage
453     {StorageClass}
454  ** variables in the code:NodePayloadAMDX storage {StorageClass} when the
455     code:CoalescingAMDX {ExecutionMode} is specified
456  * [[VUID-{refpage}-Function-04681]]
457    A type _T_ that is an array sized with a specialization constant must:
458    neither be, nor be contained in, the type _T2_ of a variable _V_, unless
459    either: a) _T_ is equal to _T2_, b) _V_ is declared in the
460    code:Function, or code:Private {StorageClass}, c) _V_ is a non-Block
461    variable in the code:Workgroup {StorageClass}, or d) _V_ is an interface
462    variable with an additional level of arrayness,
463    <<interfaces-iointerfaces-matching, as described in interface
464    matching>>, and _T_ is the member type of the array type _T2_
465  * [[VUID-{refpage}-OpControlBarrier-04682]]
466    If code:OpControlBarrier is used in ray generation, intersection,
467    any-hit, closest hit, miss, fragment, vertex, tessellation evaluation,
468    or geometry shaders, the execution Scope must: be code:Subgroup
469  * [[VUID-{refpage}-LocalSize-06426]]
470    For each compute shader entry point, either a code:LocalSize or
471    code:LocalSizeId {ExecutionMode}, or an object decorated with the
472    code:WorkgroupSize decoration must: be specified
473  * [[VUID-{refpage}-DerivativeGroupQuadsNV-04684]]
474    For compute shaders using the code:DerivativeGroupQuadsNV execution
475    mode, the first two dimensions of the local workgroup size must: be a
476    multiple of two
477  * [[VUID-{refpage}-DerivativeGroupLinearNV-04778]]
478    For compute shaders using the code:DerivativeGroupLinearNV execution
479    mode, the product of the dimensions of the local workgroup size must: be
480    a multiple of four
481  * [[VUID-{refpage}-OpGroupNonUniformBallotBitCount-04685]]
482    If code:OpGroupNonUniformBallotBitCount is used, the group operation
483    must: be limited to code:Reduce, code:InclusiveScan, or
484    code:ExclusiveScan
485  * [[VUID-{refpage}-None-04686]]
486    The _Pointer_ operand of all atomic instructions must: have a
487    {StorageClass} limited to code:Uniform, code:Workgroup, code:Image,
488    code:StorageBuffer, code:PhysicalStorageBuffer, or
489    code:TaskPayloadWorkgroupEXT
490  * [[VUID-{refpage}-Offset-04687]]
491    Output variables or block members decorated with code:Offset that have a
492    64-bit type, or a composite type containing a 64-bit type, must: specify
493    an code:Offset value aligned to a 8 byte boundary
494  * [[VUID-{refpage}-Offset-04689]]
495    The size of any output block containing any member decorated with
496    code:Offset that is a 64-bit type must: be a multiple of 8
497  * [[VUID-{refpage}-Offset-04690]]
498    The first member of an output block specifying a code:Offset decoration
499    must: specify a code:Offset value that is aligned to an 8 byte boundary
500    if that block contains any member decorated with code:Offset and is a
501    64-bit type
502  * [[VUID-{refpage}-Offset-04691]]
503    Output variables or block members decorated with code:Offset that have a
504    32-bit type, or a composite type contains a 32-bit type, must: specify
505    an code:Offset value aligned to a 4 byte boundary
506  * [[VUID-{refpage}-Offset-04692]]
507    Output variables, blocks or block members decorated with code:Offset
508    must: only contain base types that have components that are either
509    32-bit or 64-bit in size
510  * [[VUID-{refpage}-Offset-04716]]
511    Only variables or block members in the output interface decorated with
512    code:Offset can: be captured for transform feedback, and those variables
513    or block members must: also be decorated with code:XfbBuffer and
514    code:XfbStride, or inherit code:XfbBuffer and code:XfbStride decorations
515    from a block containing them
516  * [[VUID-{refpage}-XfbBuffer-04693]]
517    All variables or block members in the output interface of the entry
518    point being compiled decorated with a specific code:XfbBuffer value
519    must: all be decorated with identical code:XfbStride values
520  * [[VUID-{refpage}-Stream-04694]]
521    If any variables or block members in the output interface of the entry
522    point being compiled are decorated with code:Stream, then all variables
523    belonging to the same code:XfbBuffer must: specify the same code:Stream
524    value
525  * [[VUID-{refpage}-XfbBuffer-04696]]
526    For any two variables or block members in the output interface of the
527    entry point being compiled with the same code:XfbBuffer value, the
528    ranges determined by the code:Offset decoration and the size of the type
529    must: not overlap
530  * [[VUID-{refpage}-XfbBuffer-04697]]
531    All block members in the output interface of the entry point being
532    compiled that are in the same block and have a declared or inherited
533    code:XfbBuffer decoration must: specify the same code:XfbBuffer value
534  * [[VUID-{refpage}-RayPayloadKHR-04698]]
535    code:RayPayloadKHR {StorageClass} must: only be used in ray generation,
536    closest hit or miss shaders
537  * [[VUID-{refpage}-IncomingRayPayloadKHR-04699]]
538    code:IncomingRayPayloadKHR {StorageClass} must: only be used in closest
539    hit, any-hit, or miss shaders
540  * [[VUID-{refpage}-IncomingRayPayloadKHR-04700]]
541    There must: be at most one variable with the code:IncomingRayPayloadKHR
542    {StorageClass} in the input interface of an entry point
543  * [[VUID-{refpage}-HitAttributeKHR-04701]]
544    code:HitAttributeKHR {StorageClass} must: only be used in intersection,
545    any-hit, or closest hit shaders
546  * [[VUID-{refpage}-HitAttributeKHR-04702]]
547    There must: be at most one variable with the code:HitAttributeKHR
548    {StorageClass} in the input interface of an entry point
549  * [[VUID-{refpage}-HitAttributeKHR-04703]]
550    A variable with code:HitAttributeKHR {StorageClass} must: only be
551    written to in an intersection shader
552  * [[VUID-{refpage}-CallableDataKHR-04704]]
553    code:CallableDataKHR {StorageClass} must: only be used in ray
554    generation, closest hit, miss, and callable shaders
555  * [[VUID-{refpage}-IncomingCallableDataKHR-04705]]
556    code:IncomingCallableDataKHR {StorageClass} must: only be used in
557    callable shaders
558  * [[VUID-{refpage}-IncomingCallableDataKHR-04706]]
559    There must: be at most one variable with the
560    code:IncomingCallableDataKHR {StorageClass} in the input interface of an
561    entry point
562  * [[VUID-{refpage}-ShaderRecordBufferKHR-07119]]
563    code:ShaderRecordBufferKHR {StorageClass} must: only be used in ray
564    generation, intersection, any-hit, closest hit, callable, or miss
565    shaders
566  * [[VUID-{refpage}-Base-07650]]
567    The code:Base operand of code:OpPtrAccessChain must: have a storage
568    class of code:Workgroup, code:StorageBuffer, or
569    code:PhysicalStorageBuffer
570  * [[VUID-{refpage}-Base-07651]]
571    If the code:Base operand of code:OpPtrAccessChain has a code:Workgroup
572    {StorageClass}, then the code:VariablePointers capability must: be
573    declared
574  * [[VUID-{refpage}-Base-07652]]
575    If the code:Base operand of code:OpPtrAccessChain has a
576    code:StorageBuffer {StorageClass}, then the code:VariablePointers or
577    code:VariablePointersStorageBuffer capability must: be declared
578  * [[VUID-{refpage}-PhysicalStorageBuffer64-04708]]
579    If the code:PhysicalStorageBuffer64 addressing model is enabled, all
580    instructions that support memory access operands and that use a physical
581    pointer must: include the code:Aligned operand
582  * [[VUID-{refpage}-PhysicalStorageBuffer64-04709]]
583    If the code:PhysicalStorageBuffer64 addressing model is enabled, any
584    access chain instruction that accesses into a code:RowMajor matrix must:
585    only be used as the code:Pointer operand to code:OpLoad or code:OpStore
586  * [[VUID-{refpage}-PhysicalStorageBuffer64-04710]]
587    If the code:PhysicalStorageBuffer64 addressing model is enabled,
588    code:OpConvertUToPtr and code:OpConvertPtrToU must: use an integer type
589    whose code:Width is 64
590  * [[VUID-{refpage}-OpTypeForwardPointer-04711]]
591    code:OpTypeForwardPointer must: have a {StorageClass} of
592    code:PhysicalStorageBuffer
593  * [[VUID-{refpage}-None-04745]]
594    All block members in a variable with a {StorageClass} of
595    code:PushConstant declared as an array must: only be accessed by
596    dynamically uniform indices
597  * [[VUID-{refpage}-OpVariable-06673]]
598    There must: not be more than one code:OpVariable in the
599    code:PushConstant {StorageClass} listed in the code:Interface for each
600    code:OpEntryPoint
601  * [[VUID-{refpage}-OpEntryPoint-06674]]
602    Each code:OpEntryPoint must: not statically use more than one
603    code:OpVariable in the code:PushConstant {StorageClass}
604  * [[VUID-{refpage}-OpEntryPoint-08721]]
605    Each code:OpEntryPoint must: not have more than one code:Input variable
606    assigned the same code:Component word inside a code:Location slot,
607    either explicitly or implicitly
608  * [[VUID-{refpage}-OpEntryPoint-08722]]
609    Each code:OpEntryPoint must: not have more than one code:Output variable
610    assigned the same code:Component word inside a code:Location slot,
611    either explicitly or implicitly
612  * [[VUID-{refpage}-Result-04780]]
613    The code:Result code:Type operand of any code:OpImageRead or
614    code:OpImageSparseRead instruction must: be a vector of four components
615  * [[VUID-{refpage}-Base-04781]]
616    The code:Base operand of any code:OpBitCount, code:OpBitReverse,
617    code:OpBitFieldInsert, code:OpBitFieldSExtract, or
618    code:OpBitFieldUExtract instruction must: be a 32-bit integer scalar or
619    a vector of 32-bit integers
620  * [[VUID-{refpage}-PushConstant-06675]]
621    Any variable in the code:PushConstant or code:StorageBuffer storage
622    class must: be decorated as code:Block
623  * [[VUID-{refpage}-Uniform-06676]]
624    Any variable in the code:Uniform {StorageClass} must: be decorated as
625    code:Block or code:BufferBlock
626  * [[VUID-{refpage}-UniformConstant-06677]]
627    Any variable in the code:UniformConstant, code:StorageBuffer, or
628    code:Uniform {StorageClass} must: be decorated with code:DescriptorSet
629    and code:Binding
630  * [[VUID-{refpage}-InputAttachmentIndex-06678]]
631    Variables decorated with code:InputAttachmentIndex must: be in the
632    code:UniformConstant {StorageClass}
633  * [[VUID-{refpage}-DescriptorSet-06491]]
634    If a variable is decorated by code:DescriptorSet or code:Binding, the
635    {StorageClass} must: correspond to an entry in
636    <<interfaces-resources-storage-class-correspondence, Shader Resource and
637    Storage Class Correspondence>>
638  * [[VUID-{refpage}-Input-06778]]
639    Variables with a {StorageClass} of code:Input in a fragment shader stage
640    that are decorated with code:PerVertexKHR must: be declared as arrays
641  * [[VUID-{refpage}-MeshEXT-07102]]
642    The module must: not contain both an entry point that uses the
643    code:TaskEXT or code:MeshEXT {ExecutionModel} and an entry point that
644    uses the code:TaskNV or code:MeshNV {ExecutionModel}
645  * [[VUID-{refpage}-MeshEXT-07106]]
646    In mesh shaders using the code:MeshEXT {ExecutionModel}
647    code:OpSetMeshOutputsEXT must: be called before any outputs are written
648  * [[VUID-{refpage}-MeshEXT-07107]]
649    In mesh shaders using the code:MeshEXT {ExecutionModel} all variables
650    declared as output must: not be read from
651  * [[VUID-{refpage}-MeshEXT-07108]]
652    In mesh shaders using the code:MeshEXT {ExecutionModel} for
653    code:OpSetMeshOutputsEXT instructions, the "`Vertex Count`" and
654    "`Primitive Count`" operands must: not depend on code:ViewIndex
655  * [[VUID-{refpage}-MeshEXT-07109]]
656    In mesh shaders using the code:MeshEXT {ExecutionModel} variables
657    decorated with code:PrimitivePointIndicesEXT,
658    code:PrimitiveLineIndicesEXT, or code:PrimitiveTriangleIndicesEXT
659    declared as an array must: not be accessed by indices that depend on
660    code:ViewIndex
661  * [[VUID-{refpage}-MeshEXT-07110]]
662    In mesh shaders using the code:MeshEXT {ExecutionModel} any values
663    stored in variables decorated with code:PrimitivePointIndicesEXT,
664    code:PrimitiveLineIndicesEXT, or code:PrimitiveTriangleIndicesEXT must:
665    not depend on code:ViewIndex
666  * [[VUID-{refpage}-MeshEXT-07111]]
667    In mesh shaders using the code:MeshEXT {ExecutionModel} variables in
668    workgroup or private {StorageClass} declared as or containing a
669    composite type must: not be accessed by indices that depend on
670    code:ViewIndex
671  * [[VUID-{refpage}-MeshEXT-07330]]
672    In mesh shaders using the code:MeshEXT {ExecutionModel} the
673    code:OutputVertices {ExecutionMode} must: be greater than 0
674  * [[VUID-{refpage}-MeshEXT-07331]]
675    In mesh shaders using the code:MeshEXT {ExecutionModel} the
676    code:OutputPrimitivesEXT {ExecutionMode} must: be greater than 0
677  * [[VUID-{refpage}-Input-07290]]
678    Variables with a {StorageClass} of code:Input or code:Output and a type
679    of code:OpTypeBool must: be decorated with the code:BuiltIn decoration
680  * [[VUID-{refpage}-TileImageEXT-08723]]
681    The tile image variable declarations must: obey the constraints on the
682    code:TileImageEXT {StorageClass} and the code:Location decoration
683    described in <<interfaces-fragmenttileimage, Fragment Tile Image
684    Interface>>
685  * [[VUID-{refpage}-None-08724]]
686    The code:TileImageEXT {StorageClass} must: only be used for declaring
687    tile image variables.
688  * [[VUID-{refpage}-Pointer-08973]]
689    The {StorageClass} of the code:Pointer operand to
690    code:OpCooperativeMatrixLoadKHR or code:OpCooperativeMatrixStoreKHR
691    must: be limited to code:Workgroup, code:StorageBuffer, or
692    code:PhysicalStorageBuffer.
693****
694--
695
696
697[[spirvenv-module-validation-runtime]]
698=== Runtime SPIR-V Validation
699
700[open,refpage='RuntimeSpirv',desc='Runtime SPIR-V Validation',type='spirv']
701--
702:refpage: RuntimeSpirv
703
704The following rules must: be validated at runtime.
705These rules depend on knowledge of the implementation and its capabilities
706and knowledge of runtime information, such as enabled features.
707
708.Valid Usage
709****
710ifdef::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
711  * [[VUID-{refpage}-vulkanMemoryModel-06265]]
712    If <<features-vulkanMemoryModel, pname:vulkanMemoryModel>> is enabled
713    and <<features-vulkanMemoryModelDeviceScope,
714    pname:vulkanMemoryModelDeviceScope>> is not enabled, code:Device memory
715    scope must: not be used
716endif::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
717ifdef::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
718  * [[VUID-{refpage}-vulkanMemoryModel-06266]]
719    If <<features-vulkanMemoryModel, pname:vulkanMemoryModel>> is not
720    enabled, code:QueueFamily memory scope must: not be used
721endif::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
722ifdef::VK_KHR_shader_clock[]
723  * [[VUID-{refpage}-shaderSubgroupClock-06267]]
724    If <<features-shaderSubgroupClock, pname:shaderSubgroupClock>> is not
725    enabled, the code:Subgroup scope must: not be used for
726    code:OpReadClockKHR
727  * [[VUID-{refpage}-shaderDeviceClock-06268]]
728    If <<features-shaderDeviceClock, pname:shaderDeviceClock>> is not
729    enabled, the code:Device scope must: not be used for code:OpReadClockKHR
730endif::VK_KHR_shader_clock[]
731ifndef::VK_VERSION_1_3,VK_KHR_format_feature_flags2[]
732  * [[VUID-{refpage}-OpTypeImage-06269]]
733    If <<features-shaderStorageImageWriteWithoutFormat,
734    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
735    variable created with a "`Type`" of code:OpTypeImage that has a
736    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
737    must: be decorated with code:NonWritable
738  * [[VUID-{refpage}-OpTypeImage-06270]]
739    If <<features-shaderStorageImageReadWithoutFormat,
740    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
741    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
742    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
743    decorated with code:NonReadable
744endif::VK_VERSION_1_3,VK_KHR_format_feature_flags2[]
745ifdef::VK_VERSION_1_3[]
746ifndef::VK_KHR_format_feature_flags2[]
747  * [[VUID-{refpage}-apiVersion-07952]]
748    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
749    Vulkan 1.3, and <<features-shaderStorageImageWriteWithoutFormat,
750    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
751    variable created with a "`Type`" of code:OpTypeImage that has a
752    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
753    must: be decorated with code:NonWritable
754  * [[VUID-{refpage}-apiVersion-07953]]
755    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
756    Vulkan 1.3, and <<features-shaderStorageImageReadWithoutFormat,
757    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
758    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
759    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
760    decorated with code:NonReadable
761endif::VK_KHR_format_feature_flags2[]
762ifdef::VK_KHR_format_feature_flags2[]
763  * [[VUID-{refpage}-apiVersion-07954]]
764    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
765    Vulkan 1.3, the apiext:VK_KHR_format_feature_flags2 extension is not
766    supported, and <<features-shaderStorageImageWriteWithoutFormat,
767    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
768    variable created with a "`Type`" of code:OpTypeImage that has a
769    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
770    must: be decorated with code:NonWritable
771  * [[VUID-{refpage}-apiVersion-07955]]
772    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
773    Vulkan 1.3, the apiext:VK_KHR_format_feature_flags2 extension is not
774    supported, and <<features-shaderStorageImageReadWithoutFormat,
775    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
776    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
777    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
778    decorated with code:NonReadable
779endif::VK_KHR_format_feature_flags2[]
780endif::VK_VERSION_1_3[]
781ifdef::VK_KHR_format_feature_flags2[]
782ifndef::VK_VERSION_1_3[]
783  * [[VUID-{refpage}-shaderStorageImageWriteWithoutFormat-07956]]
784    If the apiext:VK_KHR_format_feature_flags2 extension is not enabled, and
785    <<features-shaderStorageImageWriteWithoutFormat,
786    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
787    variable created with a "`Type`" of code:OpTypeImage that has a
788    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
789    must: be decorated with code:NonWritable
790  * [[VUID-{refpage}-shaderStorageImageReadWithoutFormat-07957]]
791    If the apiext:VK_KHR_format_feature_flags2 extension is not enabled, and
792    <<features-shaderStorageImageReadWithoutFormat,
793    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
794    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
795    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
796    decorated with code:NonReadable
797endif::VK_VERSION_1_3[]
798endif::VK_KHR_format_feature_flags2[]
799  * [[VUID-{refpage}-OpImageWrite-07112]]
800    code:OpImageWrite to any code:Image whose code:Image code:Format is not
801    code:Unknown must: have the code:Texel operand contain at least as many
802    components as the corresponding elink:VkFormat as given in the
803    <<spirvenv-image-formats,SPIR-V Image Format compatibility table>>
804  * [[VUID-{refpage}-Location-06272]]
805    The sum of code:Location and the number of locations the variable it
806    decorates consumes must: be less than or equal to the value for the
807    matching {ExecutionModel} defined in <<interfaces-iointerfaces-limits>>
808  * [[VUID-{refpage}-Location-06428]]
809    The maximum number of storage buffers, storage images, and output
810    code:Location decorated color attachments written to in the
811    code:Fragment {ExecutionModel} must: be less than or equal to
812    <<limits-maxFragmentCombinedOutputResources,
813    pname:maxFragmentCombinedOutputResources>>
814ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
815  * [[VUID-{refpage}-NonUniform-06274]]
816    If an instruction loads from or stores to a resource (including atomics
817    and image instructions) and the resource descriptor being accessed is
818    not dynamically uniform, then the operand corresponding to that resource
819    (e.g. the pointer or sampled image operand) must: be decorated with
820    code:NonUniform
821endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
822ifdef::VK_VERSION_1_1[]
823ifdef::VK_VERSION_1_2,VK_KHR_shader_subgroup_extended_types[]
824  * [[VUID-{refpage}-None-06275]]
825    <<features-subgroup-extended-types, pname:shaderSubgroupExtendedTypes>>
826    must: be enabled for <<shaders-group-operations,group operations>> to
827    use 8-bit integer, 16-bit integer, 64-bit integer, 16-bit
828    floating-point, and vectors of these types
829endif::VK_VERSION_1_2,VK_KHR_shader_subgroup_extended_types[]
830endif::VK_VERSION_1_1[]
831ifdef::VK_VERSION_1_2[]
832  * [[VUID-{refpage}-subgroupBroadcastDynamicId-06276]]
833    If <<features-subgroupBroadcastDynamicId,
834    pname:subgroupBroadcastDynamicId>> is ename:VK_TRUE, and the shader
835    module version is 1.5 or higher, the "`Index`" for
836    code:OpGroupNonUniformQuadBroadcast must: be dynamically uniform within
837    the derivative group.
838    Otherwise, "`Index`" must: be a constant
839  * [[VUID-{refpage}-subgroupBroadcastDynamicId-06277]]
840    If <<features-subgroupBroadcastDynamicId,
841    pname:subgroupBroadcastDynamicId>> is ename:VK_TRUE, and the shader
842    module version is 1.5 or higher, the "`Id`" for
843    code:OpGroupNonUniformBroadcast must: be dynamically uniform within the
844    subgroup.
845    Otherwise, "`Id`" must: be a constant
846endif::VK_VERSION_1_2[]
847ifdef::VK_KHR_shader_atomic_int64[]
848  * [[VUID-{refpage}-None-06278]]
849    <<features-shaderBufferInt64Atomics, pname:shaderBufferInt64Atomics>>
850    must: be enabled for 64-bit integer atomic operations to be supported on
851    a _Pointer_ with a {StorageClass} of code:StorageBuffer or code:Uniform
852  * [[VUID-{refpage}-None-06279]]
853    <<features-shaderSharedInt64Atomics, pname:shaderSharedInt64Atomics>>
854    must: be enabled for 64-bit integer atomic operations to be supported on
855    a _Pointer_ with a {StorageClass} of code:Workgroup
856endif::VK_KHR_shader_atomic_int64[]
857ifdef::VK_EXT_shader_atomic_float[]
858ifndef::VK_EXT_shader_atomic_float2[]
859  * [[VUID-{refpage}-None-06280]]
860    <<features-shaderBufferFloat32Atomics,
861    pname:shaderBufferFloat32Atomics>>, or
862    <<features-shaderBufferFloat32AtomicAdd,
863    pname:shaderBufferFloat32AtomicAdd>>, or
864    <<features-shaderBufferFloat64Atomics,
865    pname:shaderBufferFloat64Atomics>>, or
866    <<features-shaderBufferFloat64AtomicAdd,
867    pname:shaderBufferFloat64AtomicAdd>> must: be enabled for floating-point
868    atomic operations to be supported on a _Pointer_ with a {StorageClass}
869    of code:StorageBuffer
870  * [[VUID-{refpage}-None-06281]]
871    <<features-shaderSharedFloat32Atomics,
872    pname:shaderSharedFloat32Atomics>>, or
873    <<features-shaderSharedFloat32AtomicAdd,
874    pname:shaderSharedFloat32AtomicAdd>>, or
875    <<features-shaderSharedFloat64Atomics,
876    pname:shaderSharedFloat64Atomics>>, or
877    <<features-shaderSharedFloat64AtomicAdd,
878    pname:shaderSharedFloat64AtomicAdd>> must: be enabled for floating-point
879    atomic operations to be supported on a _Pointer_ with a {StorageClass}
880    of code:Workgroup
881  * [[VUID-{refpage}-None-06282]]
882    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>
883    or <<features-shaderImageFloat32AtomicAdd,
884    pname:shaderImageFloat32AtomicAdd>> must: be enabled for 32-bit
885    floating-point atomic operations to be supported on a _Pointer_ with a
886    {StorageClass} of code:Image
887  * [[VUID-{refpage}-None-06283]]
888    <<features-sparseImageFloat32Atomics, pname:sparseImageFloat32Atomics>>
889    or <<features-sparseImageFloat32AtomicAdd,
890    pname:sparseImageFloat32AtomicAdd>> must: be enabled for 32-bit
891    floating-point atomics to be supported on sparse images
892endif::VK_EXT_shader_atomic_float2[]
893endif::VK_EXT_shader_atomic_float[]
894ifdef::VK_EXT_shader_atomic_float2[]
895  * [[VUID-{refpage}-None-06284]]
896    <<features-shaderBufferFloat32Atomics,
897    pname:shaderBufferFloat32Atomics>>, or
898    <<features-shaderBufferFloat32AtomicAdd,
899    pname:shaderBufferFloat32AtomicAdd>>, or
900    <<features-shaderBufferFloat64Atomics,
901    pname:shaderBufferFloat64Atomics>>, or
902    <<features-shaderBufferFloat64AtomicAdd,
903    pname:shaderBufferFloat64AtomicAdd>>, or
904    <<features-shaderBufferFloat16AtomicMinMax,
905    pname:shaderBufferFloat16Atomics>>, or
906    <<features-shaderBufferFloat16AtomicMinMax,
907    pname:shaderBufferFloat16AtomicAdd>>, or
908    <<features-shaderBufferFloat16AtomicMinMax,
909    pname:shaderBufferFloat16AtomicMinMax>>, or
910    <<features-shaderBufferFloat32AtomicMinMax,
911    pname:shaderBufferFloat32AtomicMinMax>>, or
912    <<features-shaderBufferFloat64AtomicMinMax,
913    pname:shaderBufferFloat64AtomicMinMax>> must: be enabled for
914    floating-point atomic operations to be supported on a _Pointer_ with a
915    {StorageClass} of code:StorageBuffer
916  * [[VUID-{refpage}-None-06285]]
917    <<features-shaderSharedFloat32Atomics,
918    pname:shaderSharedFloat32Atomics>>, or
919    <<features-shaderSharedFloat32AtomicAdd,
920    pname:shaderSharedFloat32AtomicAdd>>, or
921    <<features-shaderSharedFloat64Atomics,
922    pname:shaderSharedFloat64Atomics>>, or
923    <<features-shaderSharedFloat64AtomicAdd,
924    pname:shaderSharedFloat64AtomicAdd>>, or
925    <<features-shaderBufferFloat16AtomicMinMax,
926    pname:shaderSharedFloat16Atomics>>, or
927    <<features-shaderBufferFloat16AtomicMinMax,
928    pname:shaderSharedFloat16AtomicAdd>>, or
929    <<features-shaderBufferFloat16AtomicMinMax,
930    pname:shaderSharedFloat16AtomicMinMax>>, or
931    <<features-shaderSharedFloat32AtomicMinMax,
932    pname:shaderSharedFloat32AtomicMinMax>>, or
933    <<features-shaderSharedFloat64AtomicMinMax,
934    pname:shaderSharedFloat64AtomicMinMax>> must: be enabled for
935    floating-point atomic operations to be supported on a _Pointer_ with a
936    {StorageClass} of code:Workgroup
937  * [[VUID-{refpage}-None-06286]]
938    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
939    or <<features-shaderImageFloat32AtomicAdd,
940    pname:shaderImageFloat32AtomicAdd>>, or
941    <<features-shaderImageFloat32AtomicMinMax,
942    pname:shaderImageFloat32AtomicMinMax>> must: be enabled for 32-bit
943    floating-point atomic operations to be supported on a _Pointer_ with a
944    {StorageClass} of code:Image
945  * [[VUID-{refpage}-None-06287]]
946    <<features-sparseImageFloat32Atomics, pname:sparseImageFloat32Atomics>>,
947    or <<features-sparseImageFloat32AtomicAdd,
948    pname:sparseImageFloat32AtomicAdd>>, or
949    <<features-sparseImageFloat32AtomicMinMax,
950    pname:sparseImageFloat32AtomicMinMax>> must: be enabled for 32-bit
951    floating-point atomics to be supported on sparse images
952endif::VK_EXT_shader_atomic_float2[]
953ifdef::VK_EXT_shader_image_atomic_int64[]
954  * [[VUID-{refpage}-None-06288]]
955    <<features-shaderImageInt64Atomics, pname:shaderImageInt64Atomics>>
956    must: be enabled for 64-bit integer atomic operations to be supported on
957    a _Pointer_ with a {StorageClass} of code:Image
958endif::VK_EXT_shader_image_atomic_int64[]
959ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
960  * [[VUID-{refpage}-denormBehaviorIndependence-06289]]
961    If <<features-denormBehaviorIndependence,
962    pname:denormBehaviorIndependence>> is
963    ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, then the entry
964    point must: use the same denormals {ExecutionMode} for both 16-bit and
965    64-bit floating-point types
966  * [[VUID-{refpage}-denormBehaviorIndependence-06290]]
967    If <<features-denormBehaviorIndependence,
968    pname:denormBehaviorIndependence>> is
969    ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, then the entry point
970    must: use the same denormals {ExecutionMode} for all floating-point
971    types
972  * [[VUID-{refpage}-roundingModeIndependence-06291]]
973    If <<features-roundingModeIndependence, pname:roundingModeIndependence>>
974    is ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, then the
975    entry point must: use the same rounding {ExecutionMode} for both 16-bit
976    and 64-bit floating-point types
977  * [[VUID-{refpage}-roundingModeIndependence-06292]]
978    If <<features-roundingModeIndependence, pname:roundingModeIndependence>>
979    is ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, then the entry
980    point must: use the same rounding {ExecutionMode} for all floating-point
981    types
982  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat16-06293]]
983    If <<limits-shaderSignedZeroInfNanPreserveFloat16,
984    pname:shaderSignedZeroInfNanPreserveFloat16>> is ename:VK_FALSE, then
985    code:SignedZeroInfNanPreserve for 16-bit floating-point type must: not
986    be used
987  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat32-06294]]
988    If <<limits-shaderSignedZeroInfNanPreserveFloat32,
989    pname:shaderSignedZeroInfNanPreserveFloat32>> is ename:VK_FALSE, then
990    code:SignedZeroInfNanPreserve for 32-bit floating-point type must: not
991    be used
992  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat64-06295]]
993    If <<limits-shaderSignedZeroInfNanPreserveFloat64,
994    pname:shaderSignedZeroInfNanPreserveFloat64>> is ename:VK_FALSE, then
995    code:SignedZeroInfNanPreserve for 64-bit floating-point type must: not
996    be used
997  * [[VUID-{refpage}-shaderDenormPreserveFloat16-06296]]
998    If <<limits-shaderDenormPreserveFloat16,
999    pname:shaderDenormPreserveFloat16>> is ename:VK_FALSE, then
1000    code:DenormPreserve for 16-bit floating-point type must: not be used
1001  * [[VUID-{refpage}-shaderDenormPreserveFloat32-06297]]
1002    If <<limits-shaderDenormPreserveFloat32,
1003    pname:shaderDenormPreserveFloat32>> is ename:VK_FALSE, then
1004    code:DenormPreserve for 32-bit floating-point type must: not be used
1005  * [[VUID-{refpage}-shaderDenormPreserveFloat64-06298]]
1006    If <<limits-shaderDenormPreserveFloat64,
1007    pname:shaderDenormPreserveFloat64>> is ename:VK_FALSE, then
1008    code:DenormPreserve for 64-bit floating-point type must: not be used
1009  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat16-06299]]
1010    If <<limits-shaderDenormFlushToZeroFloat16,
1011    pname:shaderDenormFlushToZeroFloat16>> is ename:VK_FALSE, then
1012    code:DenormFlushToZero for 16-bit floating-point type must: not be used
1013  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat32-06300]]
1014    If <<limits-shaderDenormFlushToZeroFloat32,
1015    pname:shaderDenormFlushToZeroFloat32>> is ename:VK_FALSE, then
1016    code:DenormFlushToZero for 32-bit floating-point type must: not be used
1017  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat64-06301]]
1018    If <<limits-shaderDenormFlushToZeroFloat64,
1019    pname:shaderDenormFlushToZeroFloat64>> is ename:VK_FALSE, then
1020    code:DenormFlushToZero for 64-bit floating-point type must: not be used
1021  * [[VUID-{refpage}-shaderRoundingModeRTEFloat16-06302]]
1022    If <<limits-shaderRoundingModeRTEFloat16,
1023    pname:shaderRoundingModeRTEFloat16>> is ename:VK_FALSE, then
1024    code:RoundingModeRTE for 16-bit floating-point type must: not be used
1025  * [[VUID-{refpage}-shaderRoundingModeRTEFloat32-06303]]
1026    If <<limits-shaderRoundingModeRTEFloat32,
1027    pname:shaderRoundingModeRTEFloat32>> is ename:VK_FALSE, then
1028    code:RoundingModeRTE for 32-bit floating-point type must: not be used
1029  * [[VUID-{refpage}-shaderRoundingModeRTEFloat64-06304]]
1030    If <<limits-shaderRoundingModeRTEFloat64,
1031    pname:shaderRoundingModeRTEFloat64>> is ename:VK_FALSE, then
1032    code:RoundingModeRTE for 64-bit floating-point type must: not be used
1033  * [[VUID-{refpage}-shaderRoundingModeRTZFloat16-06305]]
1034    If <<limits-shaderRoundingModeRTZFloat16,
1035    pname:shaderRoundingModeRTZFloat16>> is ename:VK_FALSE, then
1036    code:RoundingModeRTZ for 16-bit floating-point type must: not be used
1037  * [[VUID-{refpage}-shaderRoundingModeRTZFloat32-06306]]
1038    If <<limits-shaderRoundingModeRTZFloat32,
1039    pname:shaderRoundingModeRTZFloat32>> is ename:VK_FALSE, then
1040    code:RoundingModeRTZ for 32-bit floating-point type must: not be used
1041  * [[VUID-{refpage}-shaderRoundingModeRTZFloat64-06307]]
1042    If <<limits-shaderRoundingModeRTZFloat64,
1043    pname:shaderRoundingModeRTZFloat64>> is ename:VK_FALSE, then
1044    code:RoundingModeRTZ for 64-bit floating-point type must: not be used
1045endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
1046ifdef::VK_EXT_transform_feedback[]
1047  * [[VUID-{refpage}-Offset-06308]]
1048    The code:Offset plus size of the type of each variable, in the output
1049    interface of the entry point being compiled, decorated with
1050    code:XfbBuffer must: not be greater than
1051    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackBufferDataSize
1052  * [[VUID-{refpage}-XfbBuffer-06309]]
1053    For any given code:XfbBuffer value, define the buffer data size to be
1054    smallest number of bytes such that, for all outputs decorated with the
1055    same code:XfbBuffer value, the size of the output interface variable
1056    plus the code:Offset is less than or equal to the buffer data size.
1057    For a given code:Stream, the sum of all the buffer data sizes for all
1058    buffers writing to that stream the must: not exceed
1059    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreamDataSize
1060  * [[VUID-{refpage}-OpEmitStreamVertex-06310]]
1061    The Stream value to code:OpEmitStreamVertex and
1062    code:OpEndStreamPrimitive must: be less than
1063    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreams
1064  * [[VUID-{refpage}-transformFeedbackStreamsLinesTriangles-06311]]
1065    If the geometry shader emits to more than one vertex stream and
1066    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:transformFeedbackStreamsLinesTriangles
1067    is ename:VK_FALSE, then {ExecutionMode} must: be code:OutputPoints
1068  * [[VUID-{refpage}-Stream-06312]]
1069    The stream number value to code:Stream must: be less than
1070    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreams
1071  * [[VUID-{refpage}-XfbStride-06313]]
1072    The XFB Stride value to code:XfbStride must: be less than or equal to
1073    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackBufferDataStride
1074endif::VK_EXT_transform_feedback[]
1075ifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
1076  * [[VUID-{refpage}-PhysicalStorageBuffer64-06314]]
1077    If the code:PhysicalStorageBuffer64 addressing model is enabled any load
1078    or store through a physical pointer type must: be aligned to a multiple
1079    of the size of the largest scalar type in the pointed-to type
1080  * [[VUID-{refpage}-PhysicalStorageBuffer64-06315]]
1081    If the code:PhysicalStorageBuffer64 addressing model is enabled the
1082    pointer value of a memory access instruction must: be at least as
1083    aligned as specified by the code:Aligned memory access operand
1084endif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
1085ifdef::VK_NV_cooperative_matrix[]
1086  * [[VUID-{refpage}-OpTypeCooperativeMatrixNV-06316]]
1087    For code:OpTypeCooperativeMatrixNV, the component type, scope, number of
1088    rows, and number of columns must: match one of the matrices in any of
1089    the supported slink:VkCooperativeMatrixPropertiesNV
1090  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06317]]
1091    For code:OpCooperativeMatrixMulAddNV, the type of code:A must: have
1092    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
1093    slink:VkCooperativeMatrixPropertiesNV::pname:KSize columns and have a
1094    component type that matches
1095    slink:VkCooperativeMatrixPropertiesNV::pname:AType
1096  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06318]]
1097    For code:OpCooperativeMatrixMulAddNV, the type of code:B must: have
1098    slink:VkCooperativeMatrixPropertiesNV::pname:KSize rows and
1099    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
1100    component type that matches
1101    slink:VkCooperativeMatrixPropertiesNV::pname:BType
1102  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06319]]
1103    For code:OpCooperativeMatrixMulAddNV, the type of code:C must: have
1104    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
1105    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
1106    component type that matches
1107    slink:VkCooperativeMatrixPropertiesNV::pname:CType
1108  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06320]]
1109    For code:OpCooperativeMatrixMulAddNV, the type of code:Result must: have
1110    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
1111    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
1112    component type that matches
1113    slink:VkCooperativeMatrixPropertiesNV::pname:DType
1114  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06321]]
1115    For code:OpCooperativeMatrixMulAddNV, the type of code:A, code:B,
1116    code:C, and code:Result must: all have a scope of pname:scope
1117  * [[VUID-{refpage}-OpTypeCooperativeMatrixNV-06322]]
1118    code:OpTypeCooperativeMatrixNV and code:OpCooperativeMatrix*
1119    instructions must: not be used in shader stages not included in
1120    slink:VkPhysicalDeviceCooperativeMatrixPropertiesNV::pname:cooperativeMatrixSupportedStages
1121endif::VK_NV_cooperative_matrix[]
1122ifdef::VK_KHR_cooperative_matrix[]
1123  * [[VUID-{refpage}-OpTypeCooperativeMatrixKHR-08974]]
1124    For code:OpTypeCooperativeMatrixKHR, the component type, scope, number
1125    of rows, and number of columns must: match one of the matrices in any of
1126    the supported slink:VkCooperativeMatrixPropertiesKHR.
1127  * [[VUID-{refpage}-MSize-08975]]
1128    For code:OpCooperativeMatrixMulAddKHR, the type of code:A must: have
1129    slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
1130    slink:VkCooperativeMatrixPropertiesKHR::pname:KSize columns and have a
1131    component type that matches
1132    slink:VkCooperativeMatrixPropertiesKHR::pname:AType.
1133  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08976]]
1134    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:A
1135    is a signed integer type, the code:MatrixASignedComponents cooperative
1136    matrix operand must: be present.
1137  * [[VUID-{refpage}-KSize-08977]]
1138    For code:OpCooperativeMatrixMulAddKHR, the type of code:B must: have
1139    slink:VkCooperativeMatrixPropertiesKHR::pname:KSize rows and
1140    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
1141    component type that matches
1142    slink:VkCooperativeMatrixPropertiesKHR::pname:BType.
1143  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08978]]
1144    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:B
1145    is a signed integer type, the code:MatrixBSignedComponents cooperative
1146    matrix operand must: be present.
1147  * [[VUID-{refpage}-MSize-08979]]
1148    For code:OpCooperativeMatrixMulAddKHR, the type of code:C must: have
1149    slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
1150    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
1151    component type that matches
1152    slink:VkCooperativeMatrixPropertiesKHR::pname:CType.
1153  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08980]]
1154    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:C
1155    is a signed integer type, the code:MatrixCSignedComponents cooperative
1156    matrix operand must: be present.
1157  * [[VUID-{refpage}-MSize-08981]]
1158    For code:OpCooperativeMatrixMulAddKHR, the type of code:Result must:
1159    have slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
1160    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
1161    component type that matches
1162    slink:VkCooperativeMatrixPropertiesKHR::pname:ResultType.
1163  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08982]]
1164    For code:OpCooperativeMatrixMulAddKHR, when the component type of
1165    code:Result is a signed integer type, the
1166    code:MatrixResultSignedComponents cooperative matrix operand must: be
1167    present.
1168  * [[VUID-{refpage}-saturatingAccumulation-08983]]
1169    For code:OpCooperativeMatrixMulAddKHR, the code:SaturatingAccumulation
1170    cooperative matrix operand must: be present if and only if
1171    slink:VkCooperativeMatrixPropertiesKHR::pname:saturatingAccumulation is
1172    ename:VK_TRUE.
1173  * [[VUID-{refpage}-scope-08984]]
1174    For code:OpCooperativeMatrixMulAddKHR, the type of code:A, code:B,
1175    code:C, and code:Result must: all have a scope of pname:scope.
1176  * [[VUID-{refpage}-cooperativeMatrixSupportedStages-08985]]
1177    code:OpTypeCooperativeMatrixKHR and code:OpCooperativeMatrix*
1178    instructions must: not be used in shader stages not included in
1179    slink:VkPhysicalDeviceCooperativeMatrixPropertiesKHR::pname:cooperativeMatrixSupportedStages.
1180endif::VK_KHR_cooperative_matrix[]
1181  * [[VUID-{refpage}-DescriptorSet-06323]]
1182    code:DescriptorSet and code:Binding decorations must: obey the
1183    constraints on {StorageClass}, type, and descriptor type described in
1184    <<interfaces-resources-setandbinding,DescriptorSet and Binding
1185    Assignment>>
1186ifdef::VK_NV_cooperative_matrix[]
1187  * [[VUID-{refpage}-OpCooperativeMatrixLoadNV-06324]]
1188    For code:OpCooperativeMatrixLoadNV and code:OpCooperativeMatrixStoreNV
1189    instructions, the code:Pointer and code:Stride operands must: be aligned
1190    to at least the lesser of 16 bytes or the natural alignment of a row or
1191    column (depending on code:ColumnMajor) of the matrix (where the natural
1192    alignment is the number of columns/rows multiplied by the component
1193    size)
1194endif::VK_NV_cooperative_matrix[]
1195ifdef::VK_NV_mesh_shader[]
1196  * [[VUID-{refpage}-MeshNV-07113]]
1197    For mesh shaders using the code:MeshNV {ExecutionModel} the
1198    code:OutputVertices code:OpExecutionMode must: be less than or equal to
1199    slink:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputVertices
1200  * [[VUID-{refpage}-MeshNV-07114]]
1201    For mesh shaders using the code:MeshNV {ExecutionModel} the
1202    code:OutputPrimitivesNV code:OpExecutionMode must: be less than or equal
1203    to
1204    slink:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputPrimitives
1205endif::VK_NV_mesh_shader[]
1206ifdef::VK_EXT_mesh_shader[]
1207  * [[VUID-{refpage}-MeshEXT-07115]]
1208    For mesh shaders using the code:MeshEXT {ExecutionModel} the
1209    code:OutputVertices code:OpExecutionMode must: be less than or equal to
1210    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshOutputVertices
1211  * [[VUID-{refpage}-MeshEXT-07332]]
1212    For mesh shaders using the code:MeshEXT {ExecutionModel} the "`Vertex
1213    Count`" operand of code:OpSetMeshOutputsEXT must: be less than or equal
1214    to code:OutputVertices code:OpExecutionMode
1215  * [[VUID-{refpage}-MeshEXT-07116]]
1216    For mesh shaders using the code:MeshEXT {ExecutionModel} the
1217    code:OutputPrimitivesEXT code:OpExecutionMode must: be less than or
1218    equal to
1219    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshOutputPrimitives
1220  * [[VUID-{refpage}-MeshEXT-07333]]
1221    For mesh shaders using the code:MeshEXT {ExecutionModel} the "`Primitive
1222    Count`" operand of code:OpSetMeshOutputsEXT must: be less than or equal
1223    to code:OutputPrimitivesEXT code:OpExecutionMode
1224  * [[VUID-{refpage}-TaskEXT-07117]]
1225    In task shaders using the code:TaskEXT {ExecutionModel}
1226    code:OpEmitMeshTasksEXT must: be called exactly once under dynamically
1227    uniform conditions
1228  * [[VUID-{refpage}-MeshEXT-07118]]
1229    In mesh shaders using the code:MeshEXT {ExecutionModel}
1230    code:OpSetMeshOutputsEXT must: be called at most once under dynamically
1231    uniform conditions
1232  * [[VUID-{refpage}-TaskEXT-07291]]
1233    In task shaders using the code:TaskEXT {ExecutionModel} the pname:x size
1234    in code:LocalSize or code:LocalSizeId must: be less than or equal to
1235    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[0]
1236  * [[VUID-{refpage}-TaskEXT-07292]]
1237    In task shaders using the code:TaskEXT {ExecutionModel} the pname:y size
1238    in code:LocalSize or code:LocalSizeId must: be less than or equal to
1239    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[1]
1240  * [[VUID-{refpage}-TaskEXT-07293]]
1241    In task shaders using the code:TaskEXT {ExecutionModel} the pname:z size
1242    in code:LocalSize or code:LocalSizeId must: be less than or equal to
1243    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[2]
1244  * [[VUID-{refpage}-TaskEXT-07294]]
1245    In task shaders using the code:TaskEXT {ExecutionModel} the product of
1246    pname:x size, pname:y size, and pname:z size in code:LocalSize or
1247    code:LocalSizeId must: be less than or equal to
1248    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupInvocations
1249  * [[VUID-{refpage}-MeshEXT-07295]]
1250    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:x
1251    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1252    to
1253    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[0]
1254  * [[VUID-{refpage}-MeshEXT-07296]]
1255    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:y
1256    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1257    to
1258    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[1]
1259  * [[VUID-{refpage}-MeshEXT-07297]]
1260    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:z
1261    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1262    to
1263    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[2]
1264  * [[VUID-{refpage}-MeshEXT-07298]]
1265    For mesh shaders using the code:MeshEXT {ExecutionModel} the product of
1266    pname:x size, pname:y size, and pname:z size in code:LocalSize or
1267    code:LocalSizeId must: be less than or equal to
1268    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupInvocations
1269  * [[VUID-{refpage}-TaskEXT-07299]]
1270    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
1271    "`Group Count X`" operand of code:OpEmitMeshTasksEXT must: be less than
1272    or equal to
1273    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[0]
1274  * [[VUID-{refpage}-TaskEXT-07300]]
1275    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
1276    "`Group Count Y`" operand of code:OpEmitMeshTasksEXT must: be less than
1277    or equal to
1278    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[1]
1279  * [[VUID-{refpage}-TaskEXT-07301]]
1280    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
1281    "`Group Count Z`" operand of code:OpEmitMeshTasksEXT must: be less than
1282    or equal to
1283    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[2]
1284  * [[VUID-{refpage}-TaskEXT-07302]]
1285    In task shaders using the code:TaskEXT {ExecutionModel} the product of
1286    the "`Group Count`" operands of code:OpEmitMeshTasksEXT must: be less
1287    than or equal to
1288    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupTotalCount
1289  * [[VUID-{refpage}-maxMeshSharedMemorySize-08754]]
1290    The sum of size in bytes for variables and <<workgroup-padding,
1291    padding>> in the code:Workgroup {StorageClass} in the code:MeshEXT
1292    {ExecutionModel} must: be less than or equal to
1293    <<limits-maxMeshSharedMemorySize, pname:maxMeshSharedMemorySize>>
1294  * [[VUID-{refpage}-maxMeshPayloadAndSharedMemorySize-08755]]
1295    The sum of size in bytes for variables and <<workgroup-padding,
1296    padding>> in the code:TaskPayloadWorkgroupEXT or code:Workgroup
1297    {StorageClass} in the code:MeshEXT {ExecutionModel} must: be less than
1298    or equal to <<limits-maxMeshPayloadAndSharedMemorySize,
1299    pname:maxMeshPayloadAndSharedMemorySize>>
1300  * [[VUID-{refpage}-maxMeshOutputMemorySize-08756]]
1301    The sum of size in bytes for variables in the code:Output {StorageClass}
1302    in the code:MeshEXT {ExecutionModel} must: be less than or equal to
1303    <<limits-maxMeshOutputMemorySize, pname:maxMeshOutputMemorySize>>
1304    according to the formula in <<mesh-output, Mesh Shader Output>>
1305  * [[VUID-{refpage}-maxMeshPayloadAndOutputMemorySize-08757]]
1306    The sum of size in bytes for variables and in the
1307    code:TaskPayloadWorkgroupEXT or code:Output {StorageClass} in the
1308    code:MeshEXT {ExecutionModel} must: be less than or equal to
1309    <<limits-maxMeshPayloadAndOutputMemorySize,
1310    pname:maxMeshPayloadAndOutputMemorySize>> according to the formula in
1311    <<mesh-output, Mesh Shader Output>>
1312  * [[VUID-{refpage}-maxTaskPayloadSize-08758]]
1313    The sum of size in bytes for variables and in the
1314    code:TaskPayloadWorkgroupEXT {StorageClass} in the code:TaskEXT
1315    {ExecutionModel} must: be less than or equal to
1316    <<limits-maxTaskPayloadSize, pname:maxTaskPayloadSize>>
1317  * [[VUID-{refpage}-maxTaskSharedMemorySize-08759]]
1318    The sum of size in bytes for variables and <<workgroup-padding,
1319    padding>> in the code:Workgroup {StorageClass} in the code:TaskEXT
1320    {ExecutionModel} must: be less than or equal to
1321    <<limits-maxTaskSharedMemorySize, pname:maxTaskSharedMemorySize>>
1322  * [[VUID-{refpage}-maxTaskPayloadAndSharedMemorySize-08760]]
1323    The sum of size in bytes for variables and <<workgroup-padding,
1324    padding>> in the code:TaskPayloadWorkgroupEXT or code:Workgroup
1325    {StorageClass} in the code:TaskEXT {ExecutionModel} must: be less than
1326    or equal to <<limits-maxTaskPayloadAndSharedMemorySize,
1327    pname:maxTaskPayloadAndSharedMemorySize>>
1328endif::VK_EXT_mesh_shader[]
1329ifdef::VK_KHR_cooperative_matrix[]
1330  * [[VUID-{refpage}-OpCooperativeMatrixLoadKHR-08986]]
1331    For code:OpCooperativeMatrixLoadKHR and code:OpCooperativeMatrixStoreKHR
1332    instructions, the code:Pointer and code:Stride operands must: be aligned
1333    to at least the lesser of 16 bytes or the natural alignment of a row or
1334    column (depending on code:ColumnMajor) of the matrix (where the natural
1335    alignment is the number of columns/rows multiplied by the component
1336    size).
1337endif::VK_KHR_cooperative_matrix[]
1338ifdef::VK_KHR_portability_subset[]
1339  * [[VUID-{refpage}-shaderSampleRateInterpolationFunctions-06325]]
1340    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
1341    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:shaderSampleRateInterpolationFunctions
1342    is ename:VK_FALSE, then `GLSL.std.450` fragment interpolation functions
1343    are not supported by the implementation and code:OpCapability must: not
1344    be set to code:InterpolationFunction
1345  * [[VUID-{refpage}-tessellationShader-06326]]
1346    If <<features-tessellationShader, pname:tessellationShader>> is enabled,
1347    and the `apiext:VK_KHR_portability_subset` extension is enabled, and
1348    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationIsolines
1349    is ename:VK_FALSE, then code:OpExecutionMode must: not be set to
1350    code:IsoLines
1351  * [[VUID-{refpage}-tessellationShader-06327]]
1352    If <<features-tessellationShader, pname:tessellationShader>> is enabled,
1353    and the `apiext:VK_KHR_portability_subset` extension is enabled, and
1354    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationPointMode
1355    is ename:VK_FALSE, then code:OpExecutionMode must: not be set to
1356    code:PointMode
1357endif::VK_KHR_portability_subset[]
1358ifdef::VK_KHR_8bit_storage[]
1359  * [[VUID-{refpage}-storageBuffer8BitAccess-06328]]
1360    If <<features-storageBuffer8BitAccess, pname:storageBuffer8BitAccess>>
1361    is ename:VK_FALSE, then objects containing an 8-bit integer element
1362    must: not have {StorageClass} of code:StorageBuffer,
1363    code:ShaderRecordBufferKHR, or code:PhysicalStorageBuffer
1364  * [[VUID-{refpage}-uniformAndStorageBuffer8BitAccess-06329]]
1365    If <<features-uniformAndStorageBuffer8BitAccess,
1366    pname:uniformAndStorageBuffer8BitAccess>> is ename:VK_FALSE, then
1367    objects in the code:Uniform {StorageClass} with the code:Block
1368    decoration must: not have an 8-bit integer member
1369  * [[VUID-{refpage}-storagePushConstant8-06330]]
1370    If <<features-storagePushConstant8, pname:storagePushConstant8>> is
1371    ename:VK_FALSE, then objects containing an 8-bit integer element must:
1372    not have {StorageClass} of code:PushConstant
1373endif::VK_KHR_8bit_storage[]
1374ifdef::VK_KHR_16bit_storage[]
1375  * [[VUID-{refpage}-storageBuffer16BitAccess-06331]]
1376    If <<features-storageBuffer16BitAccess, pname:storageBuffer16BitAccess>>
1377    is ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
1378    floating-point elements must: not have {StorageClass} of
1379    code:StorageBuffer, code:ShaderRecordBufferKHR, or
1380    code:PhysicalStorageBuffer
1381  * [[VUID-{refpage}-uniformAndStorageBuffer16BitAccess-06332]]
1382    If <<features-uniformAndStorageBuffer16BitAccess,
1383    pname:uniformAndStorageBuffer16BitAccess>> is ename:VK_FALSE, then
1384    objects in the code:Uniform {StorageClass} with the code:Block
1385    decoration must: not have 16-bit integer or 16-bit floating-point
1386    members
1387  * [[VUID-{refpage}-storagePushConstant16-06333]]
1388    If <<features-storagePushConstant16, pname:storagePushConstant16>> is
1389    ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
1390    floating-point elements must: not have {StorageClass} of
1391    code:PushConstant
1392  * [[VUID-{refpage}-storageInputOutput16-06334]]
1393    If <<features-storageInputOutput16, pname:storageInputOutput16>> is
1394    ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
1395    floating-point elements must: not have {StorageClass} of code:Input or
1396    code:Output
1397endif::VK_KHR_16bit_storage[]
1398ifdef::VK_EXT_shader_atomic_float[]
1399ifndef::VK_EXT_shader_atomic_float2[]
1400  * [[VUID-{refpage}-None-06335]]
1401    <<features-shaderBufferFloat32Atomics,
1402    pname:shaderBufferFloat32Atomics>>, or
1403    <<features-shaderBufferFloat32AtomicAdd,
1404    pname:shaderBufferFloat32AtomicAdd>>, or
1405    <<features-shaderSharedFloat32Atomics,
1406    pname:shaderSharedFloat32Atomics>>, or
1407    <<features-shaderSharedFloat32AtomicAdd,
1408    pname:shaderSharedFloat32AtomicAdd>>, or
1409    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
1410    or <<features-shaderImageFloat32AtomicAdd,
1411    pname:shaderImageFloat32AtomicAdd>> must: be enabled for 32-bit floating
1412    point atomic operations
1413  * [[VUID-{refpage}-None-06336]]
1414    <<features-shaderBufferFloat64Atomics,
1415    pname:shaderBufferFloat64Atomics>>, or
1416    <<features-shaderBufferFloat64AtomicAdd,
1417    pname:shaderBufferFloat64AtomicAdd>>, or
1418    <<features-shaderSharedFloat64Atomics,
1419    pname:shaderSharedFloat64Atomics>>, or
1420    <<features-shaderSharedFloat64AtomicAdd,
1421    pname:shaderSharedFloat64AtomicAdd>> must: be enabled for 64-bit
1422    floating point atomic operations
1423endif::VK_EXT_shader_atomic_float2[]
1424endif::VK_EXT_shader_atomic_float[]
1425ifdef::VK_EXT_shader_atomic_float2[]
1426  * [[VUID-{refpage}-None-06337]]
1427    <<features-shaderBufferFloat16Atomics,
1428    pname:shaderBufferFloat16Atomics>>, or
1429    <<features-shaderBufferFloat16AtomicAdd,
1430    pname:shaderBufferFloat16AtomicAdd>>, or
1431    <<features-shaderBufferFloat16AtomicMinMax,
1432    pname:shaderBufferFloat16AtomicMinMax>>, or
1433    <<features-shaderSharedFloat16Atomics,
1434    pname:shaderSharedFloat16Atomics>>, or
1435    <<features-shaderSharedFloat16AtomicAdd,
1436    pname:shaderSharedFloat16AtomicAdd>>, or
1437    <<features-shaderSharedFloat16AtomicMinMax,
1438    pname:shaderSharedFloat16AtomicMinMax>> must: be enabled for 16-bit
1439    floating point atomic operations
1440  * [[VUID-{refpage}-None-06338]]
1441    <<features-shaderBufferFloat32Atomics,
1442    pname:shaderBufferFloat32Atomics>>, or
1443    <<features-shaderBufferFloat32AtomicAdd,
1444    pname:shaderBufferFloat32AtomicAdd>>, or
1445    <<features-shaderSharedFloat32Atomics,
1446    pname:shaderSharedFloat32Atomics>>, or
1447    <<features-shaderSharedFloat32AtomicAdd,
1448    pname:shaderSharedFloat32AtomicAdd>>, or
1449    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
1450    or <<features-shaderImageFloat32AtomicAdd,
1451    pname:shaderImageFloat32AtomicAdd>> or
1452    <<features-shaderBufferFloat32AtomicMinMax,
1453    pname:shaderBufferFloat32AtomicMinMax>>, or
1454    <<features-shaderSharedFloat32AtomicMinMax,
1455    pname:shaderSharedFloat32AtomicMinMax>>, or
1456    <<features-shaderImageFloat32AtomicMinMax,
1457    pname:shaderImageFloat32AtomicMinMax>> must: be enabled for 32-bit
1458    floating point atomic operations
1459  * [[VUID-{refpage}-None-06339]]
1460    <<features-shaderBufferFloat64Atomics,
1461    pname:shaderBufferFloat64Atomics>>, or
1462    <<features-shaderBufferFloat64AtomicAdd,
1463    pname:shaderBufferFloat64AtomicAdd>>, or
1464    <<features-shaderSharedFloat64Atomics,
1465    pname:shaderSharedFloat64Atomics>>, or
1466    <<features-shaderSharedFloat64AtomicAdd,
1467    pname:shaderSharedFloat64AtomicAdd>>, or
1468    <<features-shaderBufferFloat64AtomicMinMax,
1469    pname:shaderBufferFloat64AtomicMinMax>>, or
1470    <<features-shaderSharedFloat64AtomicMinMax,
1471    pname:shaderSharedFloat64AtomicMinMax>>, must: be enabled for 64-bit
1472    floating point atomic operations
1473endif::VK_EXT_shader_atomic_float2[]
1474  * [[VUID-{refpage}-NonWritable-06340]]
1475    If <<features-fragmentStoresAndAtomics, pname:fragmentStoresAndAtomics>>
1476    is not enabled, then all storage image, storage texel buffer, and
1477    storage buffer variables in the fragment stage must: be decorated with
1478    the code:NonWritable decoration
1479  * [[VUID-{refpage}-NonWritable-06341]]
1480    If <<features-vertexPipelineStoresAndAtomics,
1481    pname:vertexPipelineStoresAndAtomics>> is not enabled, then all storage
1482    image, storage texel buffer, and storage buffer variables in the vertex,
1483    tessellation, and geometry stages must: be decorated with the
1484    code:NonWritable decoration
1485ifdef::VKSC_VERSION_1_0[]
1486  * [[VUID-{refpage}-OpAtomic-05091]]
1487    If <<features-shaderAtomicInstructions, shaderAtomicInstructions>> is
1488    not enabled, the SPIR-V Atomic Instructions listed in 3.37.18
1489    (code:OpAtomic*) must: not be used <<SCID-1>>
1490endif::VKSC_VERSION_1_0[]
1491  * [[VUID-{refpage}-None-06342]]
1492    If <<limits-subgroupQuadOperationsInAllStages,
1493    pname:subgroupQuadOperationsInAllStages>> is ename:VK_FALSE, then
1494    <<features-subgroup-quad, quad subgroup operations>> must: not be used
1495    except for in fragment and compute stages
1496ifdef::VK_VERSION_1_1[]
1497  * [[VUID-{refpage}-None-06343]]
1498    <<shaders-group-operations, Group operations>> with
1499    <<shaders-scope-subgroup, subgroup scope>> must: not be used if the
1500    shader stage is not in <<limits-subgroupSupportedStages,
1501    pname:subgroupSupportedStages>>
1502endif::VK_VERSION_1_1[]
1503  * [[VUID-{refpage}-Offset-06344]]
1504    The first element of the code:Offset operand of code:InterpolateAtOffset
1505    must: be greater than or equal to: +
1506    [eq]#frag~width~ {times} <<limits-minInterpolationOffset,
1507    pname:minInterpolationOffset>># +
1508    where [eq]#frag~width~# is the width of the current fragment in pixels
1509  * [[VUID-{refpage}-Offset-06345]]
1510    The first element of the code:Offset operand of code:InterpolateAtOffset
1511    must: be less than or equal to +
1512    [eq]#frag~width~ {times} (<<limits-maxInterpolationOffset,
1513    pname:maxInterpolationOffset>> {plus} ULP ) - ULP# +
1514    where [eq]#frag~width~# is the width of the current fragment in pixels
1515    and [eq]#ULP = 1 / 2^<<limits-subPixelInterpolationOffsetBits,
1516    pname:subPixelInterpolationOffsetBits>>^#
1517  * [[VUID-{refpage}-Offset-06346]]
1518    The second element of the code:Offset operand of
1519    code:InterpolateAtOffset must: be greater than or equal to +
1520    [eq]#frag~height~ {times} <<limits-minInterpolationOffset,
1521    pname:minInterpolationOffset>># +
1522    where [eq]#frag~height~# is the height of the current fragment in pixels
1523  * [[VUID-{refpage}-Offset-06347]]
1524    The second element of the code:Offset operand of
1525    code:InterpolateAtOffset must: be less than or equal to +
1526    [eq]#frag~height~ {times} (<<limits-maxInterpolationOffset,
1527    pname:maxInterpolationOffset>> {plus} ULP ) - ULP# +
1528    where [eq]#frag~height~# is the height of the current fragment in pixels
1529    and [eq]#ULP = 1 / 2^<<limits-subPixelInterpolationOffsetBits,
1530    pname:subPixelInterpolationOffsetBits>>^#.
1531
1532ifdef::VK_KHR_ray_query[]
1533  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06348]]
1534    For code:OpRayQueryInitializeKHR instructions, all components of the
1535    code:RayOrigin and code:RayDirection operands must: be finite
1536    floating-point values
1537  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06349]]
1538    For code:OpRayQueryInitializeKHR instructions, the code:RayTmin and
1539    code:RayTmax operands must: be non-negative floating-point values
1540  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06350]]
1541    For code:OpRayQueryInitializeKHR instructions, the code:RayTmin operand
1542    must: be less than or equal to the code:RayTmax operand
1543  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06351]]
1544    For code:OpRayQueryInitializeKHR instructions, code:RayOrigin,
1545    code:RayDirection, code:RayTmin, and code:RayTmax operands must: not
1546    contain NaNs
1547  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06352]]
1548    For code:OpRayQueryInitializeKHR instructions, code:Acceleration
1549    code:Structure must: be an acceleration structure built as a
1550    <<acceleration-structure-top-level, top-level acceleration structure>>
1551  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06889]]
1552    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
1553    must: not contain both code:SkipTrianglesKHR and code:SkipAABBsKHR
1554  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06890]]
1555    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
1556    must: not contain more than one of code:SkipTrianglesKHR,
1557    code:CullBackFacingTrianglesKHR, and code:CullFrontFacingTrianglesKHR
1558  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06891]]
1559    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
1560    must: not contain more than one of code:OpaqueKHR, code:NoOpaqueKHR,
1561    code:CullOpaqueKHR, and code:CullNoOpaqueKHR
1562  * [[VUID-{refpage}-OpRayQueryGenerateIntersectionKHR-06353]]
1563    For code:OpRayQueryGenerateIntersectionKHR instructions, code:Hit code:T
1564    must: satisfy the condition [eq]##code:RayTmin {leq} code:Hit code:T
1565    {leq} code:RayTmax##, where code:RayTmin is equal to the value returned
1566    by code:OpRayQueryGetRayTMinKHR with the same ray query object, and
1567    code:RayTmax is equal to the value of code:OpRayQueryGetIntersectionTKHR
1568    for the current committed intersection with the same ray query object
1569ifdef::VK_NV_ray_tracing_motion_blur[]
1570  * [[VUID-{refpage}-OpRayQueryGenerateIntersectionKHR-06354]]
1571    For code:OpRayQueryGenerateIntersectionKHR instructions,
1572    code:Acceleration code:Structure must: not be built with
1573    ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
1574endif::VK_NV_ray_tracing_motion_blur[]
1575ifdef::VK_KHR_ray_tracing_position_fetch[]
1576  * [[VUID-{refpage}-flags-08761]]
1577    For code:OpRayQueryGetIntersectionTriangleVertexPositionsKHR
1578    instructions, code:Acceleration code:Structure must: have been built
1579    with ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR in
1580    pname:flags
1581endif::VK_KHR_ray_tracing_position_fetch[]
1582endif::VK_KHR_ray_query[]
1583ifdef::VK_KHR_ray_tracing_pipeline[]
1584  * [[VUID-{refpage}-OpTraceRayKHR-06355]]
1585    For code:OpTraceRayKHR instructions, all components of the
1586    code:RayOrigin and code:RayDirection operands must: be finite
1587    floating-point values
1588  * [[VUID-{refpage}-OpTraceRayKHR-06356]]
1589    For code:OpTraceRayKHR instructions, the code:RayTmin and code:RayTmax
1590    operands must: be non-negative floating-point values
1591  * [[VUID-{refpage}-OpTraceRayKHR-06552]]
1592    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
1593    contain both code:SkipTrianglesKHR and code:SkipAABBsKHR
1594  * [[VUID-{refpage}-OpTraceRayKHR-06892]]
1595    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
1596    contain more than one of code:SkipTrianglesKHR,
1597    code:CullBackFacingTrianglesKHR, and code:CullFrontFacingTrianglesKHR
1598  * [[VUID-{refpage}-OpTraceRayKHR-06893]]
1599    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
1600    contain more than one of code:OpaqueKHR, code:NoOpaqueKHR,
1601    code:CullOpaqueKHR, and code:CullNoOpaqueKHR
1602  * [[VUID-{refpage}-OpTraceRayKHR-06553]]
1603    For code:OpTraceRayKHR instructions, if the code:Rayflags operand
1604    contains code:SkipTrianglesKHR, the pipeline must: not have been created
1605    with ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR set
1606  * [[VUID-{refpage}-OpTraceRayKHR-06554]]
1607    For code:OpTraceRayKHR instructions, if the code:Rayflags operand
1608    contains code:SkipAABBsKHR, the pipeline must: not have been created
1609    with ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR set
1610  * [[VUID-{refpage}-OpTraceRayKHR-06357]]
1611    For code:OpTraceRayKHR instructions, the code:RayTmin operand must: be
1612    less than or equal to the code:RayTmax operand
1613  * [[VUID-{refpage}-OpTraceRayKHR-06358]]
1614    For code:OpTraceRayKHR instructions, code:RayOrigin, code:RayDirection,
1615    code:RayTmin, and code:RayTmax operands must: not contain NaNs
1616  * [[VUID-{refpage}-OpTraceRayKHR-06359]]
1617    For code:OpTraceRayKHR instructions, code:Acceleration code:Structure
1618    must: be an acceleration structure built as a
1619    <<acceleration-structure-top-level, top-level acceleration structure>>
1620  * [[VUID-{refpage}-OpReportIntersectionKHR-06998]]
1621    The value of the "`Hit Kind`" operand of code:OpReportIntersectionKHR
1622    must: be in the range [eq]#[0,127]#
1623endif::VK_KHR_ray_tracing_pipeline[]
1624ifdef::VK_NV_ray_tracing_motion_blur[]
1625  * [[VUID-{refpage}-OpTraceRayKHR-06360]]
1626    For code:OpTraceRayKHR instructions, if code:Acceleration code:Structure
1627    was built with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in
1628    pname:flags, the pipeline must: have been created with
1629    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
1630  * [[VUID-{refpage}-OpTraceRayMotionNV-06361]]
1631    For code:OpTraceRayMotionNV instructions, all components of the
1632    code:RayOrigin and code:RayDirection operands must: be finite
1633    floating-point values
1634  * [[VUID-{refpage}-OpTraceRayMotionNV-06362]]
1635    For code:OpTraceRayMotionNV instructions, the code:RayTmin and
1636    code:RayTmax operands must: be non-negative floating-point values
1637  * [[VUID-{refpage}-OpTraceRayMotionNV-06363]]
1638    For code:OpTraceRayMotionNV instructions, the code:RayTmin operand must:
1639    be less than or equal to the code:RayTmax operand
1640  * [[VUID-{refpage}-OpTraceRayMotionNV-06364]]
1641    For code:OpTraceRayMotionNV instructions, code:RayOrigin,
1642    code:RayDirection, code:RayTmin, and code:RayTmax operands must: not
1643    contain NaNs
1644  * [[VUID-{refpage}-OpTraceRayMotionNV-06365]]
1645    For code:OpTraceRayMotionNV instructions, code:Acceleration
1646    code:Structure must: be an acceleration structure built as a
1647    <<acceleration-structure-top-level, top-level acceleration structure>>
1648    with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
1649  * [[VUID-{refpage}-OpTraceRayMotionNV-06366]]
1650    For code:OpTraceRayMotionNV instructions the code:time operand must: be
1651    between 0.0 and 1.0
1652  * [[VUID-{refpage}-OpTraceRayMotionNV-06367]]
1653    For code:OpTraceRayMotionNV instructions the pipeline must: have been
1654    created with ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV
1655    set
1656endif::VK_NV_ray_tracing_motion_blur[]
1657ifdef::VK_NV_ray_tracing_invocation_reorder[]
1658  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07704]]
1659    For code:OpHitObjectTraceRayMotionNV instructions, if code:Acceleration
1660    code:Structure was built with
1661    ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags, the
1662    pipeline must: have been created with
1663    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
1664  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07705]]
1665    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1666    instructions, all components of the code:RayOrigin and code:RayDirection
1667    operands must: be finite floating-point values
1668  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07706]]
1669    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1670    instructions, the code:RayTmin and code:RayTmax operands must: be
1671    non-negative floating-point values
1672  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07707]]
1673    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1674    instructions, the code:RayTmin operand must: be less than or equal to
1675    the code:RayTmax operand
1676  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07708]]
1677    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1678    instructions, code:RayOrigin, code:RayDirection, code:RayTmin, and
1679    code:RayTmax operands must: not contain NaNs
1680  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07709]]
1681    For code:OpHitObjectTraceRayMotionNV instructions, code:Acceleration
1682    code:Structure must: be an acceleration structure built as a
1683    <<acceleration-structure-top-level, top-level acceleration structure>>
1684    with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
1685  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07710]]
1686    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1687    instructions the code:time operand must: be between 0.0 and 1.0
1688  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07711]]
1689    For code:OpHitObjectTraceRayMotionNV instructions the pipeline must:
1690    have been created with
1691    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
1692  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07712]]
1693    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1694    instructions, the code:Rayflags operand must: not contain both
1695    code:SkipTrianglesKHR and code:SkipAABBsKHR
1696  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07713]]
1697    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1698    instructions, the code:Rayflags operand must: not contain more than one
1699    of code:SkipTrianglesKHR, code:CullBackFacingTrianglesKHR, and
1700    code:CullFrontFacingTrianglesKHR
1701  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07714]]
1702    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1703    instructions, the code:Rayflags operand must: not contain more than one
1704    of code:OpaqueKHR, code:NoOpaqueKHR, code:CullOpaqueKHR, and
1705    code:CullNoOpaqueKHR
1706  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07715]]
1707    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1708    instructions, if the code:Rayflags operand contains
1709    code:SkipTrianglesKHR, the pipeline must: not have been created with
1710    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR set
1711  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07716]]
1712    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
1713    instructions, if the code:Rayflags operand contains code:SkipAABBsKHR,
1714    the pipeline must: not have been created with
1715    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR set
1716endif::VK_NV_ray_tracing_invocation_reorder[]
1717  * [[VUID-{refpage}-x-06429]]
1718    In compute shaders using the code:GLCompute {ExecutionModel} the pname:x
1719    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1720    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[0]
1721  * [[VUID-{refpage}-y-06430]]
1722    In compute shaders using the code:GLCompute {ExecutionModel} the pname:y
1723    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1724    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[1]
1725  * [[VUID-{refpage}-z-06431]]
1726    In compute shaders using the code:GLCompute {ExecutionModel} the pname:z
1727    size in code:LocalSize or code:LocalSizeId must: be less than or equal
1728    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[2]
1729  * [[VUID-{refpage}-x-06432]]
1730    In compute shaders using the code:GLCompute {ExecutionModel} the product
1731    of pname:x size, pname:y size, and pname:z size in code:LocalSize or
1732    code:LocalSizeId must: be less than or equal to
1733    slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupInvocations
1734ifndef::VK_VERSION_1_3,VK_KHR_maintenance4[]
1735  * [[VUID-{refpage}-LocalSizeId-06433]]
1736    The {ExecutionMode} code:LocalSizeId must: not be used
1737  * [[VUID-{refpage}-OpTypeVector-06816]]
1738    Any code:OpTypeVector output interface variables must: not have a higher
1739    code:Component code:Count than a matching code:OpTypeVector input
1740    interface variable
1741endif::VK_VERSION_1_3,VK_KHR_maintenance4[]
1742ifdef::VK_VERSION_1_3,VK_KHR_maintenance4[]
1743  * [[VUID-{refpage}-LocalSizeId-06434]]
1744    If {ExecutionMode} code:LocalSizeId is used, <<features-maintenance4,
1745    pname:maintenance4>> must: be enabled
1746  * [[VUID-{refpage}-maintenance4-06817]]
1747    If <<features-maintenance4, pname:maintenance4>> is not enabled, any
1748    code:OpTypeVector output interface variables must: not have a higher
1749    code:Component code:Count than a matching code:OpTypeVector input
1750    interface variable
1751endif::VK_VERSION_1_3,VK_KHR_maintenance4[]
1752  * [[VUID-{refpage}-OpEntryPoint-08743]]
1753    Any <<interfaces-iointerfaces-user,user-defined variables>> shared
1754    between the code:OpEntryPoint of two shader stages, and declared with
1755    code:Input as its {StorageClass} for the subsequent shader stage, must:
1756    have all code:Location slots and code:Component words declared in the
1757    preceding shader stage's code:OpEntryPoint with code:Output as the
1758    {StorageClass}
1759  * [[VUID-{refpage}-OpEntryPoint-07754]]
1760    Any <<interfaces-iointerfaces-user,user-defined variables>> between the
1761    code:OpEntryPoint of two shader stages must: have the same type and
1762    width for each code:Component
1763  * [[VUID-{refpage}-OpVariable-08746]]
1764    Any code:OpVariable, code:Block-decorated code:OpTypeStruct, or
1765    code:Block-decorated code:OpTypeStruct members shared between the
1766    code:OpEntryPoint of two shader stages must: have matching decorations
1767    as defined in <<interfaces-iointerfaces-matching,interface matching>>
1768  * [[VUID-{refpage}-Workgroup-06530]]
1769    The sum of size in bytes for variables and <<workgroup-padding,
1770    padding>> in the code:Workgroup {StorageClass} in the code:GLCompute
1771    {ExecutionModel} must: be less than or equal to
1772    <<limits-maxComputeSharedMemorySize, pname:maxComputeSharedMemorySize>>
1773ifdef::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
1774  * [[VUID-{refpage}-shaderZeroInitializeWorkgroupMemory-06372]]
1775    If <<features-shaderZeroInitializeWorkgroupMemory,
1776    pname:shaderZeroInitializeWorkgroupMemory>> is not enabled, any
1777    code:OpVariable with code:Workgroup as its {StorageClass} must: not have
1778    an code:Initializer operand
1779endif::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
1780ifndef::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
1781  * [[VUID-{refpage}-OpVariable-06373]]
1782    Any code:OpVariable with code:Workgroup as its {StorageClass} must: not
1783    have an code:Initializer operand
1784endif::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
1785  * [[VUID-{refpage}-OpImage-06376]]
1786    If an code:OpImage*Gather operation has an image operand of code:Offset,
1787    code:ConstOffset, or code:ConstOffsets the offset value must: be greater
1788    than or equal to <<limits-minTexelGatherOffset,
1789    pname:minTexelGatherOffset>>
1790  * [[VUID-{refpage}-OpImage-06377]]
1791    If an code:OpImage*Gather operation has an image operand of code:Offset,
1792    code:ConstOffset, or code:ConstOffsets the offset value must: be less
1793    than or equal to <<limits-maxTexelGatherOffset,
1794    pname:maxTexelGatherOffset>>
1795  * [[VUID-{refpage}-OpImageSample-06435]]
1796    If an code:OpImageSample* or code:OpImageFetch* operation has an image
1797    operand of code:ConstOffset then the offset value must: be greater than
1798    or equal to <<limits-minTexelOffset, pname:minTexelOffset>>
1799  * [[VUID-{refpage}-OpImageSample-06436]]
1800    If an code:OpImageSample* or code:OpImageFetch* operation has an image
1801    operand of code:ConstOffset then the offset value must: be less than or
1802    equal to <<limits-maxTexelOffset, pname:maxTexelOffset>>
1803  * [[VUID-{refpage}-samples-08725]]
1804    If an code:OpTypeImage has an code:MS operand 0, its bound image must:
1805    have been created with slink:VkImageCreateInfo::pname:samples as
1806    ename:VK_SAMPLE_COUNT_1_BIT
1807  * [[VUID-{refpage}-samples-08726]]
1808    If an code:OpTypeImage has an code:MS operand 1, its bound image must:
1809    not have been created with slink:VkImageCreateInfo::pname:samples as
1810    ename:VK_SAMPLE_COUNT_1_BIT
1811ifdef::VK_QCOM_render_pass_shader_resolve[]
1812  * [[VUID-{refpage}-SampleRateShading-06378]]
1813    If the subpass description contains
1814    ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then the SPIR-V
1815    fragment shader Capability code:SampleRateShading must: not be enabled
1816endif::VK_QCOM_render_pass_shader_resolve[]
1817ifdef::VK_KHR_shader_subgroup_uniform_control_flow[]
1818  * [[VUID-{refpage}-SubgroupUniformControlFlowKHR-06379]]
1819    The {ExecutionMode} code:SubgroupUniformControlFlowKHR must: not be
1820    applied to an entry point unless
1821    <<features-shaderSubgroupUniformControlFlow,
1822    pname:shaderSubgroupUniformControlFlow>> is enabled and the
1823    corresponding shader stage bit is set in subgroup
1824    <<limits-subgroup-supportedStages, pname:supportedStages>> and the entry
1825    point does not execute any <<ray-tracing-repack,_invocation repack
1826    instructions_>>
1827endif::VK_KHR_shader_subgroup_uniform_control_flow[]
1828ifdef::VK_AMD_shader_early_and_late_fragment_tests[]
1829  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06767]]
1830    If <<features-shaderEarlyAndLateFragmentTests,
1831    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1832    code:EarlyAndLateFragmentTestsEXT {ExecutionMode} must: not be used
1833  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06768]]
1834    If <<features-shaderEarlyAndLateFragmentTests,
1835    pname:shaderEarlyAndLateFragmentTests>> feature is not enabled, the
1836    code:StencilRefUnchangedFrontEXT {ExecutionMode} must: not be used
1837  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06769]]
1838    If <<features-shaderEarlyAndLateFragmentTests,
1839    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1840    code:StencilRefUnchangedBackEXT {ExecutionMode} must: not be used
1841  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06770]]
1842    If <<features-shaderEarlyAndLateFragmentTests,
1843    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1844    code:StencilRefGreaterFrontEXT {ExecutionMode} must: not be used
1845  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06771]]
1846    If <<features-shaderEarlyAndLateFragmentTests,
1847    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1848    code:StencilRefGreaterBackEXT {ExecutionMode} must: not be used
1849  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06772]]
1850    If <<features-shaderEarlyAndLateFragmentTests,
1851    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1852    code:StencilRefLessFrontEXT {ExecutionMode} must: not be used
1853  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06773]]
1854    If <<features-shaderEarlyAndLateFragmentTests,
1855    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
1856    code:StencilRefLessBackEXT {ExecutionMode} must: not be used
1857endif::VK_AMD_shader_early_and_late_fragment_tests[]
1858ifdef::VK_QCOM_image_processing[]
1859  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06979]]
1860    If an code:OpImageWeightedSampleQCOM operation is used, then the
1861    code:Texture code:Sampled code:Image and code:Weight code:Image
1862    parameters must: both be _dynamically uniform_ for the quad
1863  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06980]]
1864    If an code:OpImageWeightedSampleQCOM operation is used, then the
1865    code:Weight code:Image parameter must: be of {StorageClass}
1866    code:UniformConstant and type code:OpTypeImage with code:Depth=0,
1867    code:Dim=code:2D, code:Arrayed=1, code:MS=0, and code:Sampled=1
1868  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06981]]
1869    If an code:OpImageWeightedSampleQCOM operation is used, then the
1870    code:Weight code:Image parameter must: be decorated with
1871    code:WeightTextureQCOM
1872  * [[VUID-{refpage}-OpImageBlockMatchSADQCOM-06982]]
1873    If an code:OpImageBlockMatchSADQCOM or code:OpImageBlockMatchSSDQCOM
1874    operation is used, then the code:target code:sampled code:image,
1875    code:reference code:sampled code:image, and code:Block code:Size
1876    parameters must: both be _dynamically uniform_ for the quad
1877  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06983]]
1878    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1879    operation is used, then code:target code:sampled code:image and
1880    code:reference code:sampled code:image parameters must: be of storage
1881    class code:UniformConstant and type code:OpTypeImage with code:Depth=0,
1882    code:Dim=code:2D, code:Arrayed=0, code:MS=0, and code:Sampled=1
1883  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06984]]
1884    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1885    operation is used, then the code:target code:sampled code:image and
1886    code:reference code:sampled code:image parameters must: be decorated
1887    with code:BlockMatchTextureQCOM
1888  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06985]]
1889    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1890    operation is used, then code:target code:sampled code:image and
1891    code:reference code:sampled code:image parameters must: have been
1892    created using an identical sampler object
1893  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06986]]
1894    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1895    operation is used, then code:target code:sampled code:image and
1896    code:reference code:sampled code:image parameters must: have been
1897    created with a sampler object with pname:unnormalizedCoordinates equal
1898    to ename:VK_TRUE
1899  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06987]]
1900    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1901    operation is used, then code:target code:sampled code:image and
1902    code:reference code:sampled code:image parameters must: have been
1903    created with a sampler object with pname:unnormalizedCoordinates equal
1904    to ename:VK_TRUE
1905  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06988]]
1906    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
1907    operation is used, then code:Block code:Size less than or equal to
1908    <<limits-blockmatch-maxblocksize, pname:maxBlockMatchRegion>>
1909  * [[VUID-{refpage}-OpImageBoxFilterQCOM-06989]]
1910    If an code:OpImageBoxFilterQCOM operation is used, then code:Box
1911    code:Size.y must: be equal to or greater than 1.0 and less than or equal
1912    to <<limits-boxfilter-maxblocksize,
1913    pname:maxBoxFilterBlockSize>>.code:height
1914  * [[VUID-{refpage}-OpImageBoxFilterQCOM-06990]]
1915    If an code:OpImageBoxFilterQCOM operation is used, then code:Sampled
1916    code:Texture code:Image and code:Box code:Size parameters must: be
1917    _dynamically uniform_
1918endif::VK_QCOM_image_processing[]
1919  * [[VUID-{refpage}-OpEntryPoint-08727]]
1920    Each code:OpEntryPoint must: not have more than one variable decorated
1921    with code:InputAttachmentIndex per image aspect of the attachment image
1922    bound to it, either explicitly or implicitly as described by
1923    <<interfaces-inputattachment, input attachment interface>>
1924ifdef::VK_EXT_shader_tile_image[]
1925  * [[VUID-{refpage}-shaderTileImageColorReadAccess-08728]]
1926    If <<features-shaderTileImageColorReadAccess,
1927    pname:shaderTileImageColorReadAccess>> is not enabled,
1928    code:OpColorAttachmentReadEXT operation must: not be used
1929  * [[VUID-{refpage}-shaderTileImageDepthReadAccess-08729]]
1930    If <<features-shaderTileImageDepthReadAccess,
1931    pname:shaderTileImageDepthReadAccess>> is not enabled,
1932    code:OpDepthAttachmentReadEXT operation must: not be used
1933  * [[VUID-{refpage}-shaderTileImageStencilReadAccess-08730]]
1934    If <<features-shaderTileImageStencilReadAccess,
1935    pname:shaderTileImageStencilReadAccess>> is not enabled,
1936    code:OpStencilAttachmentReadEXT operation must: not be used
1937  * [[VUID-{refpage}-minSampleShading-08731]]
1938    If <<primsrast-sampleshading, sample shading>> is enabled and
1939    pname:minSampleShading is 1.0, the code:sample operand of any
1940    code:OpColorAttachmentReadEXT, code:OpDepthAttachmentReadEXT, or
1941    code:OpStencilAttachmentReadEXT operation must: evaluate to the value of
1942    the <<primsrast-multisampling-coverage-mask, coverage index>> for any
1943    given fragment invocation
1944  * [[VUID-{refpage}-minSampleShading-08732]]
1945    If <<primsrast-sampleshading, sample shading>> is enabled and any of the
1946    code:OpColorAttachmentReadEXT, code:OpDepthAttachmentReadEXT, or
1947    code:OpStencilAttachmentReadEXT operations are used, then
1948    pname:minSampleShading must: be 1.0
1949endif::VK_EXT_shader_tile_image[]
1950  * [[VUID-{refpage}-MeshEXT-09218]]
1951    In mesh shaders using the code:MeshEXT or code:MeshNV {ExecutionModel}
1952    and the code:OutputPoints {ExecutionMode},
1953ifdef::VK_KHR_maintenance5[]
1954    if <<features-maintenance5, pname:maintenance5>> is not enabled, and
1955endif::VK_KHR_maintenance5[]
1956    if the number of output points is greater than 0, a code:PointSize
1957    decorated variable must: be written to for each output point
1958ifdef::VK_KHR_maintenance5[]
1959  * [[VUID-{refpage}-maintenance5-09190]]
1960    If <<features-maintenance5, pname:maintenance5>> is enabled and a
1961    code:PointSize decorated variable is written to, all execution paths
1962    must: write to a code:PointSize decorated variable
1963endif::VK_KHR_maintenance5[]
1964ifdef::VK_AMDX_shader_enqueue[]
1965  * [[VUID-{refpage}-ShaderEnqueueAMDX-09191]]
1966    The code:ShaderEnqueueAMDX capability must: only be used in shaders with
1967    the code:GLCompute execution model
1968  * [[VUID-{refpage}-NodePayloadAMDX-09192]]
1969    Variables in the code:NodePayloadAMDX storage class must: only be
1970    declared in the code:GLCompute execution model
1971  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09193]]
1972    Variables declared in the code:NodePayloadAMDX storage class must: not
1973    be larger than the <<limits-maxExecutionGraphShaderPayloadSize,
1974    pname:maxExecutionGraphShaderPayloadSize>> limit
1975  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09194]]
1976    Variables declared in the code:NodeOutputPayloadAMDX storage class must:
1977    not be larger than the <<limits-maxExecutionGraphShaderPayloadSize,
1978    pname:maxExecutionGraphShaderPayloadSize>> limit
1979  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09195]]
1980    For a given entry point, the sum of the size of any variable in the
1981    code:NodePayloadAMDX storage class, and the combined size of all
1982    statically initialized variables in the code:NodeOutputPayloadAMDX
1983    storage class must: not be greater than
1984    <<limits-maxExecutionGraphShaderPayloadSize,
1985    pname:maxExecutionGraphShaderPayloadSize>>
1986  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadCount-09196]]
1987    Shaders must: not statically initialize more than
1988    <<limits-maxExecutionGraphShaderPayloadCount,
1989    pname:maxExecutionGraphShaderPayloadCount>> variables in the
1990    code:NodeOutputPayloadAMDX storage class
1991  * [[VUID-{refpage}-maxExecutionGraphShaderOutputNodes-09197]]
1992    Shaders must: not include more than
1993    <<limits-maxExecutionGraphShaderOutputNodes,
1994    pname:maxExecutionGraphShaderOutputNodes>> instances of
1995    code:OpInitializeNodePayloadsAMDX
1996endif::VK_AMDX_shader_enqueue[]
1997ifdef::VK_QCOM_image_processing2[]
1998  * [[VUID-{refpage}-OpImageBlockMatchWindow-09219]]
1999    If a code:OpImageBlockMatchWindow*QCOM or
2000    code:OpImageBlockMatchGather*QCOM operation is used, then the
2001    code:target code:sampled code:image, code:reference code:sampled
2002    code:image, and code:Block code:Size parameters must: both be
2003    _dynamically uniform_ for the quad
2004  * [[VUID-{refpage}-OpImageBlockMatchWindow-09220]]
2005    If a code:OpImageBlockMatchWindow*QCOM or
2006    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
2007    code:sampled code:image and code:reference code:sampled code:image
2008    parameters must: be of storage class code:UniformConstant and type
2009    code:OpTypeImage with code:Depth=0, code:Dim=code:2D, code:Arrayed=0,
2010    code:MS=0, and code:Sampled=1
2011  * [[VUID-{refpage}-OpImageBlockMatchWindow-09221]]
2012    If a code:OpImageBlockMatchWindow*QCOM or
2013    code:OpImageBlockMatchGather*QCOM operation is used, then the
2014    code:target code:sampled code:image and code:reference code:sampled
2015    code:image parameters must: be decorated with code:BlockMatchTextureQCOM
2016  * [[VUID-{refpage}-OpImageBlockMatchWindow-09222]]
2017    If a code:OpImageBlockMatchWindow*QCOM or
2018    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
2019    code:sampled code:image and code:reference code:sampled code:image
2020    parameters must: have been created using an identical sampler object
2021  * [[VUID-{refpage}-OpImageBlockMatchWindow-09223]]
2022    If a code:OpImageBlockMatchWindow*QCOM or
2023    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
2024    code:sampled code:image and code:reference code:sampled code:image
2025    parameters must: have been created with a sampler object with
2026    pname:unnormalizedCoordinates equal to ename:VK_TRUE
2027  * [[VUID-{refpage}-OpImageBlockMatchWindow-09224]]
2028    If a code:OpImageBlockMatchWindow*QCOM or
2029    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
2030    code:sampled code:image and code:reference code:sampled code:image
2031    parameters must: have been created with sampler object with
2032    pname:unnormalizedCoordinates equal to ename:VK_TRUE
2033  * [[VUID-{refpage}-maxBlockMatchRegion-09225]]
2034    If a code:OpImageBlockMatchWindow*QCOM or
2035    code:OpImageBlockMatchGather*QCOM operation is used, then code:Block
2036    code:Size less than or equal to <<limits-blockmatch-maxblocksize,
2037    pname:maxBlockMatchRegion>>
2038  * [[VUID-{refpage}-pNext-09226]]
2039    If a code:OpImageBlockMatchWindow*QCOM operation is used, then
2040    code:target code:sampled code:image must: have been created using
2041    asampler object that included
2042    slink:VkSamplerBlockMatchWindowCreateInfoQCOM in the pname:pNext chain.
2043endif::VK_QCOM_image_processing2[]
2044
2045****
2046--
2047
2048
2049[[spirvenv-precision-operation]]
2050== Precision and Operation of SPIR-V Instructions
2051
2052The following rules apply to half, single, and double-precision floating
2053point instructions:
2054
2055  * Positive and negative infinities and positive and negative zeros are
2056    generated as dictated by <<ieee-754,IEEE 754>>, but subject to the
2057    precisions allowed in the following table.
2058  * Dividing a non-zero by a zero results in the appropriately signed
2059    <<ieee-754,IEEE 754>> infinity.
2060  * Signaling [eq]##NaN##s are not required to be generated and exceptions
2061    are never raised.
2062    Signaling [eq]##NaN## may: be converted to quiet [eq]##NaN##s values by
2063    any floating point instruction.
2064  * By default, the implementation may: perform optimizations on half,
2065    single, or double-precision floating-point instructions that ignore sign
2066    of a zero, or assume that arguments and results are not NaNs or
2067    infinities.
2068ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2069    If the entry point is declared with the code:SignedZeroInfNanPreserve
2070    {ExecutionMode}, then NaNs, infinities, and the sign of zero must: not
2071    be ignored.
2072  ** The following core SPIR-V instructions must: respect the
2073     code:SignedZeroInfNanPreserve {ExecutionMode}: code:OpPhi,
2074     code:OpSelect, code:OpReturnValue, code:OpVectorExtractDynamic,
2075     code:OpVectorInsertDynamic, code:OpVectorShuffle,
2076     code:OpCompositeConstruct, code:OpCompositeExtract,
2077     code:OpCompositeInsert, code:OpCopyObject, code:OpTranspose,
2078     code:OpFConvert, code:OpFNegate, code:OpFAdd, code:OpFSub, code:OpFMul,
2079     code:OpStore.
2080     This {ExecutionMode} must: also be respected by code:OpLoad except for
2081     loads from the code:Input {StorageClass} in the fragment shader stage
2082     with the floating-point result type.
2083     Other SPIR-V instructions may: also respect the
2084     code:SignedZeroInfNanPreserve {ExecutionMode}.
2085endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2086  * The following instructions must: not flush denormalized values:
2087    code:OpConstant, code:OpConstantComposite, code:OpSpecConstant,
2088    code:OpSpecConstantComposite, code:OpLoad, code:OpStore, code:OpBitcast,
2089    code:OpPhi, code:OpSelect, code:OpFunctionCall, code:OpReturnValue,
2090    code:OpVectorExtractDynamic, code:OpVectorInsertDynamic,
2091    code:OpVectorShuffle, code:OpCompositeConstruct,
2092    code:OpCompositeExtract, code:OpCompositeInsert, code:OpCopyMemory,
2093    code:OpCopyObject.
2094ifndef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2095  * Any denormalized value input into a shader or potentially generated by
2096    any instruction in a shader (except those listed above) may: be flushed
2097    to 0.
2098  * The rounding mode cannot: be set, and results will be
2099    <<spirvenv-correctly-rounded, correctly rounded>>, as described below.
2100  * [eq]##NaN##s may: not be generated.
2101    Instructions that operate on a [eq]#NaN# may: not result in a [eq]#NaN#.
2102endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2103ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2104  * Denormalized values are supported.
2105  ** By default, any half, single, or double-precision denormalized value
2106     input into a shader or potentially generated by any instruction (except
2107     those listed above) or any extended instructions for GLSL in a shader
2108     may: be flushed to zero.
2109  ** If the entry point is declared with the code:DenormFlushToZero
2110     {ExecutionMode} then for the affected instructions the denormalized
2111     result must: be flushed to zero and the denormalized operands may: be
2112     flushed to zero.
2113     Denormalized values obtained via unpacking an integer into a vector of
2114     values with smaller bit width and interpreting those values as
2115     floating-point numbers must: be flushed to zero.
2116  ** The following core SPIR-V instructions must: respect the
2117     code:DenormFlushToZero {ExecutionMode}: code:OpSpecConstantOp (with
2118     opcode code:OpFConvert), code:OpFConvert, code:OpFNegate, code:OpFAdd,
2119     code:OpFSub, code:OpFMul, code:OpFDiv, code:OpFRem, code:OpFMod,
2120     code:OpVectorTimesScalar, code:OpMatrixTimesScalar,
2121     code:OpVectorTimesMatrix, code:OpMatrixTimesVector,
2122     code:OpMatrixTimesMatrix, code:OpOuterProduct, code:OpDot; and the
2123     following extended instructions for GLSL: code:Round, code:RoundEven,
2124     code:Trunc, code:FAbs, code:Floor, code:Ceil, code:Fract, code:Radians,
2125     code:Degrees, code:Sin, code:Cos, code:Tan, code:Asin, code:Acos,
2126     code:Atan, code:Sinh, code:Cosh, code:Tanh, code:Asinh, code:Acosh,
2127     code:Atanh, code:Atan2, code:Pow, code:Exp, code:Log, code:Exp2,
2128     code:Log2, code:Sqrt, code:InverseSqrt, code:Determinant,
2129     code:MatrixInverse, code:Modf, code:ModfStruct, code:FMin, code:FMax,
2130     code:FClamp, code:FMix, code:Step, code:SmoothStep, code:Fma,
2131     code:UnpackHalf2x16, code:UnpackDouble2x32, code:Length, code:Distance,
2132     code:Cross, code:Normalize, code:FaceForward, code:Reflect,
2133     code:Refract, code:NMin, code:NMax, code:NClamp.
2134     Other SPIR-V instructions (except those excluded above) may: also flush
2135     denormalized values.
2136  ** The following core SPIR-V instructions must: respect the
2137     code:DenormPreserve {ExecutionMode}: code:OpTranspose,
2138     code:OpSpecConstantOp, code:OpFConvert, code:OpFNegate, code:OpFAdd,
2139     code:OpFSub, code:OpFMul, code:OpVectorTimesScalar,
2140     code:OpMatrixTimesScalar, code:OpVectorTimesMatrix,
2141     code:OpMatrixTimesVector, code:OpMatrixTimesMatrix,
2142     code:OpOuterProduct, code:OpDot, code:OpFOrdEqual, code:OpFUnordEqual,
2143     code:OpFOrdNotEqual, code:OpFUnordNotEqual, code:OpFOrdLessThan,
2144     code:OpFUnordLessThan, code:OpFOrdGreaterThan,
2145     code:OpFUnordGreaterThan, code:OpFOrdLessThanEqual,
2146     code:OpFUnordLessThanEqual, code:OpFOrdGreaterThanEqual,
2147     code:OpFUnordGreaterThanEqual; and the following extended instructions
2148     for GLSL: code:FAbs, code:FSign, code:Radians, code:Degrees, code:FMin,
2149     code:FMax, code:FClamp, code:FMix, code:Fma, code:PackHalf2x16,
2150     code:PackDouble2x32, code:UnpackHalf2x16, code:UnpackDouble2x32,
2151     code:NMin, code:NMax, code:NClamp.
2152     Other SPIR-V instructions may: also preserve denorm values.
2153endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2154
2155The precision of double-precision instructions is at least that of single
2156precision.
2157
2158The precision of individual operations is defined in
2159<<spirvenv-op-prec,Precision of Individual Operations>>.
2160Subject to the constraints below, however, implementations may: reorder or
2161combine operations, resulting in expressions exhibiting different precisions
2162than might be expected from the constituent operations.
2163
2164
2165[[spirvenv-evaluation-expressions]]
2166=== Evaluation of Expressions
2167
2168Implementations may: rearrange floating-point operations using any of the
2169mathematical properties governing the expressions in precise arithmetic,
2170even where the floating- point operations do not share these properties.
2171This includes, but is not limited to, associativity and distributivity, and
2172may: involve a different number of rounding steps than would occur if the
2173operations were not rearranged.
2174In shaders that use the code:SignedZeroInfNanPreserve {ExecutionMode} the
2175values must: be preserved if they are generated after any rearrangement but
2176the {ExecutionMode} does not change which rearrangements are valid.
2177This rearrangement can: be prevented for particular operations by using the
2178code:NoContraction decoration.
2179
2180ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2181[NOTE]
2182.Note
2183====
2184For example, in the absence of the code:NoContraction decoration
2185implementations are allowed to implement [eq]#a + b - a# and latexmath:[{a
2186\times b}\over{a}] as [eq]#b#.
2187The code:SignedZeroInfNanPreserve does not prevent these transformations,
2188even though they may overflow to infinity or NaN when evaluated in
2189floating-point.
2190
2191If the code:NoContraction decoration is applied then operations may not be
2192rearranged, so, for example, [eq]#a + a - a# must account for possible
2193overflow to infinity.
2194If infinities are not preserved then the expression may be replaced with
2195[eq]#a#, since the replacement is exact when overflow does not occur and
2196infinities may be replaced with undefined: values.
2197If both code:NoContraction and code:SignedZeroInfNanPreserve are used then
2198the result must be infinity for sufficiently large [eq]#a#.
2199====
2200endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2201
2202
2203[[spirvenv-op-prec]]
2204=== Precision of Individual Operations
2205
2206The precision of individual operations is defined either in terms of
2207rounding (correctly rounded), as an error bound in ULP, or as inherited from
2208a formula as follows:
2209
2210[[spirvenv-correctly-rounded]]
2211.Correctly Rounded
2212Operations described as "`correctly rounded`" will return the infinitely
2213precise result, [eq]#x#, rounded so as to be representable in
2214floating-point.
2215ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2216The rounding mode is not specified, unless the entry point is declared with
2217the code:RoundingModeRTE or the code:RoundingModeRTZ {ExecutionMode}.
2218These execution modes affect only correctly rounded SPIR-V instructions.
2219These execution modes do not affect code:OpQuantizeToF16.
2220If the rounding mode is not specified then this rounding is implementation
2221specific, subject to the following rules.
2222endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2223ifndef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2224The rounding mode used is not defined but must: obey the following rules.
2225endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2226If [eq]#x# is exactly representable then [eq]#x# will be returned.
2227Otherwise, either the floating-point value closest to and no less than
2228[eq]#x# or the value closest to and no greater than [eq]#x# will be
2229returned.
2230
2231.ULP
2232Where an error bound of [eq]#n# ULP (units in the last place) is given, for
2233an operation with infinitely precise result #x# the value returned must: be
2234in the range [eq]#[x - n {times} ulp(x), x {plus} n {times} ulp(x)]#.
2235The function [eq]#ulp(x)# is defined as follows:
2236
2237  {empty}:: If there exist non-equal, finite floating-point numbers #a# and
2238    #b# such that [eq]#a {leq} x {leq} b# then [eq]#ulp(x)# is the minimum
2239    possible distance between such numbers, latexmath:[ulp(x) =
2240    \mathrm{min}_{a,b} | b - a |].
2241    If such numbers do not exist then [eq]#ulp(x)# is defined to be the
2242    difference between the two non-equal, finite floating-point numbers
2243    nearest to [eq]#x#.
2244
2245Where the range of allowed return values includes any value of magnitude
2246larger than that of the largest representable finite floating-point number,
2247operations may:, additionally, return either an infinity of the appropriate
2248sign or the finite number with the largest magnitude of the appropriate
2249sign.
2250If the infinitely precise result of the operation is not mathematically
2251defined then the value returned is undefined:.
2252
2253.Inherited From ...
2254Where an operation's precision is described as being inherited from a
2255formula, the result returned must: be at least as accurate as the result of
2256computing an approximation to [eq]#x# using a formula equivalent to the
2257given formula applied to the supplied inputs.
2258Specifically, the formula given may be transformed using the mathematical
2259associativity, commutativity and distributivity of the operators involved to
2260yield an equivalent formula.
2261The SPIR-V precision rules, when applied to each such formula and the given
2262input values, define a range of permitted values.
2263If [eq]#NaN# is one of the permitted values then the operation may return
2264any result, otherwise let the largest permitted value in any of the ranges
2265be [eq]#F~max~# and the smallest be [eq]#F~min~#.
2266The operation must: return a value in the range [eq]#[x - E, x {plus} E]#
2267where latexmath:[E = \mathrm{max} \left( | x - F_{\mathrm{min}} |, | x -
2268F_{\mathrm{max}} | \right) ].
2269ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2270If the entry point is declared with the code:DenormFlushToZero execution
2271mode, then any intermediate denormal value(s) while evaluating the formula
2272may: be flushed to zero.
2273Denormal final results must: be flushed to zero.
2274If the entry point is declared with the code:DenormPreserve {ExecutionMode},
2275then denormals must: be preserved throughout the formula.
2276endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
2277
2278ifdef::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
2279For half- (16 bit) and single- (32 bit) precision instructions, precisions
2280are required: to be at least as follows:
2281
2282.Precision of core SPIR-V Instructions
2283[options="header", cols=",,"]
2284|====
2285| Instruction
2286 | Single precision, unless decorated with RelaxedPrecision | Half precision
2287| code:OpFAdd
22882+| Correctly rounded.
2289| code:OpFSub
22902+| Correctly rounded.
2291| code:OpFMul, code:OpVectorTimesScalar, code:OpMatrixTimesScalar
22922+| Correctly rounded.
2293| code:OpDot(x, y)
22942+a| Inherited from latexmath:[\sum_{i = 0}^{n - 1} x_{i} \times y_{i}].
2295| code:OpFOrdEqual, code:OpFUnordEqual
22962+| Correct result.
2297| code:OpFOrdLessThan, code:OpFUnordLessThan
22982+| Correct result.
2299| code:OpFOrdGreaterThan, code:OpFUnordGreaterThan
23002+| Correct result.
2301| code:OpFOrdLessThanEqual, code:OpFUnordLessThanEqual
23022+| Correct result.
2303| code:OpFOrdGreaterThanEqual, code:OpFUnordGreaterThanEqual
23042+| Correct result.
2305| code:OpFDiv(x,y)
2306 | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-126^, 2^126^].   | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-14^, 2^14^].
2307| code:OpFRem(x,y)
23082+| Inherited from [eq]#x - y {times} trunc(x/y)#.
2309| code:OpFMod(x,y)
23102+| Inherited from [eq]#x - y {times} floor(x/y)#.
2311| conversions between types
23122+| Correctly rounded.
2313|====
2314
2315[NOTE]
2316.Note
2317====
2318The code:OpFRem and code:OpFMod instructions use cheap approximations of
2319remainder, and the error can be large due to the discontinuity in trunc()
2320and floor().
2321This can produce mathematically unexpected results in some cases, such as
2322FMod(x,x) computing x rather than 0, and can also cause the result to have a
2323different sign than the infinitely precise result.
2324====
2325
2326.Precision of GLSL.std.450 Instructions
2327[options="header", cols=",,"]
2328|====
2329|Instruction
2330  | Single precision, unless decorated with RelaxedPrecision | Half precision
2331| code:fma()
23322+| Inherited from code:OpFMul followed by code:OpFAdd.
2333| code:exp(x),  code:exp2(x)
2334 a| latexmath:[3 + 2 \times \vert x \vert] ULP.             a| latexmath:[1 + 2 \times \vert x \vert] ULP.
2335| code:log(),  code:log2()
2336 a| 3 ULP outside the range latexmath:[[0.5, 2.0\]]. Absolute error < latexmath:[2^{-21}] inside the range latexmath:[[0.5, 2.0\]].
2337 a| 3 ULP outside the range latexmath:[[0.5, 2.0\]]. Absolute error < latexmath:[2^{-7}] inside the range latexmath:[[0.5, 2.0\]].
2338| code:pow(x, y)
23392+| Inherited from code:exp2(y {times} code:log2(x)).
2340| code:sqrt()
23412+| Inherited from 1.0 / code:inversesqrt().
2342| code:inversesqrt()
23432+| 2 ULP.
2344| code:radians(x)
23452+a| Inherited from latexmath:[x \times C_{\pi\_180}], where latexmath:[C_{\pi\_180}] is a correctly rounded approximation to latexmath:[\frac{\pi}{180}].
2346| code:degrees(x)
23472+a| Inherited from latexmath:[x \times C_{180\_\pi}], where latexmath:[C_{180\_\pi}] is a correctly rounded approximation to latexmath:[\frac{180}{\pi}].
2348| code:sin()
2349  a| Absolute error latexmath:[\leq 2^{-11}] inside the range latexmath:[[-\pi, \pi\]]. a| Absolute error latexmath:[\leq 2^{-7}] inside the range latexmath:[[-\pi, \pi\]].
2350| code:cos()
2351  a| Absolute error latexmath:[\leq 2^{-11}] inside the range latexmath:[[-\pi, \pi\]]. a| Absolute error latexmath:[\leq 2^{-7}] inside the range latexmath:[[-\pi, \pi\]].
2352| code:tan()
23532+a| Inherited from latexmath:[\frac{\sin()}{\cos()}].
2354| code:asin(x)
23552+a| Inherited from latexmath:[\mathrm{atan2}(x, sqrt(1.0 - x \times x))].
2356| code:acos(x)
23572+a| Inherited from latexmath:[\mathrm{atan2}(sqrt(1.0 - x \times x), x)].
2358| code:atan(), code:atan2()
2359   | 4096 ULP                                                      | 5 ULP.
2360| code:sinh(x)
23612+a| Inherited from latexmath:[(\exp(x) - \exp(-x)) \times 0.5].
2362| code:cosh(x)
23632+a| Inherited from latexmath:[(\exp(x) + \exp(-x)) \times 0.5].
2364| code:tanh()
23652+a| Inherited from latexmath:[\frac{\sinh()}{\cosh()}].
2366| code:asinh(x)
23672+a| Inherited from latexmath:[\log(x + sqrt(x \times x + 1.0))].
2368| code:acosh(x)
23692+a| Inherited from latexmath:[\log(x + sqrt(x \times x - 1.0))].
2370| code:atanh(x)
23712+a| Inherited from latexmath:[\log(\frac{1.0 + x}{1.0 - x}) \times 0.5].
2372| code:frexp()
23732+| Correctly rounded.
2374| code:ldexp()
23752+| Correctly rounded.
2376| code:length(x)
23772+a| Inherited from latexmath:[sqrt(dot(x, x))].
2378| code:distance(x, y)
23792+a| Inherited from latexmath:[length(x - y)].
2380| code:cross()
23812+| Inherited from [eq]#code:OpFSub(code:OpFMul, code:OpFMul)#.
2382| code:normalize(x)
23832+a| Inherited from latexmath:[x \times inversesqrt(dot(x, x))].
2384| code:faceforward(N, I, NRef)
23852+| Inherited from [eq]#code:dot(NRef, I) < 0.0 ? N : -N#.
2386| code:reflect(x, y)
23872+| Inherited from [eq]#x - 2.0 {times} code:dot(y, x) {times} y#.
2388| code:refract(I, N, eta)
23892+| Inherited from [eq]#k < 0.0 ? 0.0 : eta {times} I - (eta {times} code:dot(N, I) {plus} code:sqrt(k)) {times} N#, where [eq]#k = 1 - eta {times} eta {times} (1.0 - code:dot(N, I) {times} code:dot(N, I))#.
2390| code:round
23912+| Correctly rounded.
2392| code:roundEven
23932+| Correctly rounded.
2394| code:trunc
23952+| Correctly rounded.
2396| code:fabs
23972+| Correctly rounded.
2398| code:fsign
23992+| Correctly rounded.
2400| code:floor
24012+| Correctly rounded.
2402| code:ceil
24032+| Correctly rounded.
2404| code:fract
24052+| Correctly rounded.
2406| code:modf
24072+| Correctly rounded.
2408| code:fmin
24092+| Correctly rounded.
2410| code:fmax
24112+| Correctly rounded.
2412| code:fclamp
24132+| Correctly rounded.
2414| code:fmix(x, y, a)
24152+a| Inherited from latexmath:[x \times (1.0 - a) + y \times a].
2416| code:step
24172+| Correctly rounded.
2418| code:smoothStep(edge0, edge1, x)
24192+a| Inherited from latexmath:[t \times t \times (3.0 - 2.0 \times t)],
2420where latexmath:[t = clamp(\frac{x - edge0}{edge1 - edge0}, 0.0, 1.0)].
2421| code:nmin
24222+| Correctly rounded.
2423| code:nmax
24242+| Correctly rounded.
2425| code:nclamp
24262+| Correctly rounded.
2427|====
2428endif::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
2429
2430ifndef::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
2431For single precision (32 bit) instructions, precisions are required: to be
2432at least as follows, unless decorated with RelaxedPrecision:
2433
2434.Precision of core SPIR-V Instructions
2435[options="header"]
2436|====
2437| Instruction                                                     | Precision
2438| code:OpFAdd                                                     | Correctly rounded.
2439| code:OpFSub                                                     | Correctly rounded.
2440| code:OpFMul, code:OpVectorTimesScalar, code:OpMatrixTimesScalar | Correctly rounded.
2441| code:OpFOrdEqual, code:OpFUnordEqual                            | Correct result.
2442| code:OpFOrdLessThan, code:OpFUnordLessThan                      | Correct result.
2443| code:OpFOrdGreaterThan, code:OpFUnordGreaterThan                | Correct result.
2444| code:OpFOrdLessThanEqual, code:OpFUnordLessThanEqual            | Correct result.
2445| code:OpFOrdGreaterThanEqual, code:OpFUnordGreaterThanEqual      | Correct result.
2446| code:OpFDiv(x,y)                                                | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-126^, 2^126^].
2447| conversions between types                                       | Correctly rounded.
2448|====
2449
2450.Precision of GLSL.std.450 Instructions
2451[options="header"]
2452|====
2453|Instruction                 | Precision
2454| code:fma()                 | Inherited from code:OpFMul followed by code:OpFAdd.
2455| code:exp(x),  code:exp2(x) | [eq]#3 {plus} 2 {times} {vert}x{vert}# ULP.
2456| code:log(),  code:log2()   | 3 ULP outside the range [eq]#[0.5, 2.0]#. Absolute error < [eq]#2^-21^# inside the range [eq]#[0.5, 2.0]#.
2457| code:pow(x, y)             | Inherited from code:exp2(y {times} code:log2(x)).
2458| code:sqrt()                | Inherited from 1.0 / code:inversesqrt().
2459| code:inversesqrt()         | 2 ULP.
2460|====
2461endif::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
2462
2463GLSL.std.450 extended instructions specifically defined in terms of the
2464above instructions inherit the above errors.
2465GLSL.std.450 extended instructions not listed above and not defined in terms
2466of the above have undefined: precision.
2467
2468For the code:OpSRem and code:OpSMod instructions, if either operand is
2469negative the result is undefined:.
2470
2471[NOTE]
2472.Note
2473====
2474While the code:OpSRem and code:OpSMod instructions are supported by the
2475Vulkan environment, they require non-negative values and thus do not enable
2476additional functionality beyond what code:OpUMod provides.
2477====
2478
2479ifdef::VK_NV_cooperative_matrix[]
2480code:OpCooperativeMatrixMulAddNV performs its operations in an
2481implementation-dependent order and internal precision.
2482endif::VK_NV_cooperative_matrix[]
2483
2484ifdef::VK_KHR_cooperative_matrix[]
2485code:OpCooperativeMatrixMulAddKHR performs its operations in an
2486implementation-dependent order and internal precision.
2487endif::VK_KHR_cooperative_matrix[]
2488
2489[[spirvenv-image-signedness]]
2490== Signedness of SPIR-V Image Accesses
2491
2492SPIR-V associates a signedness with all integer image accesses.
2493This is required in certain parts of the SPIR-V and the Vulkan image access
2494pipeline to ensure defined results.
2495The signedness is determined from a combination of the access instruction's
2496code:Image code:Operands and the underlying image's code:Sampled code:Type
2497as follows:
2498
2499 1. If the instruction's code:Image code:Operands contains the
2500    code:SignExtend operand then the access is signed.
2501 2. If the instruction's code:Image code:Operands contains the
2502    code:ZeroExtend operand then the access is unsigned.
2503 3. Otherwise, the image accesses signedness matches that of the
2504    code:Sampled code:Type of the code:OpTypeImage being accessed.
2505
2506
2507[[spirvenv-format-type-matching]]
2508== Image Format and Type Matching
2509
2510When specifying the code:Image code:Format of an code:OpTypeImage, the
2511converted bit width and type, as shown in the table below, must: match the
2512code:Sampled code:Type.
2513The signedness must: match the <<spirvenv-image-signedness,signedness of any
2514access>> to the image.
2515
2516[NOTE]
2517.Note
2518====
2519Formatted accesses are always converted from a shader readable type to the
2520resource's format or vice versa via <<textures-format-conversion>> for reads
2521and <<textures-output-format-conversion>> for writes.
2522As such, the bit width and format below do not necessarily match 1:1 with
2523what might be expected for some formats.
2524====
2525
2526For a given code:Image code:Format, the code:Sampled code:Type must: be the
2527type described in the _Type_ column of the below table, with its
2528code:Literal code:Width set to that in the _Bit Width_ column.
2529Every access that is made to the image must: have a signedness equal to that
2530in the _Signedness_ column (where applicable).
2531
2532[options="autowidth"]
2533|===
2534| Image Format       | Type-Declaration instructions | Bit Width | Signedness
2535
2536| code:Unknown       | Any                  | Any       | Any
2537| code:Rgba32f   .20+| code:OpTypeFloat .20+| 32    .20+| N/A
2538| code:Rg32f
2539| code:R32f
2540| code:Rgba16f
2541| code:Rg16f
2542| code:R16f
2543| code:Rgba16
2544| code:Rg16
2545| code:R16
2546| code:Rgba16Snorm
2547| code:Rg16Snorm
2548| code:R16Snorm
2549| code:Rgb10A2
2550| code:R11fG11fB10f
2551| code:Rgba8
2552| code:Rg8
2553| code:R8
2554| code:Rgba8Snorm
2555| code:Rg8Snorm
2556| code:R8Snorm
2557| code:Rgba32i   .19+| code:OpTypeInt   .19+| 32     .9+| 1
2558| code:Rg32i
2559| code:R32i
2560| code:Rgba16i
2561| code:Rg16i
2562| code:R16i
2563| code:Rgba8i
2564| code:Rg8i
2565| code:R8i
2566| code:Rgba32ui                                     .10+| 0
2567| code:Rg32ui
2568| code:R32ui
2569| code:Rgba16ui
2570| code:Rg16ui
2571| code:R16ui
2572| code:Rgb10a2ui
2573| code:Rgba8ui
2574| code:Rg8ui
2575| code:R8ui
2576| code:R64i       .2+| code:OpTypeInt    .2+| 64        | 1
2577| code:R64ui                                            | 0
2578|===
2579
2580[[spirv-type]]
2581The _SPIR-V Type_ is defined by an instruction in SPIR-V, declared with the
2582Type-Declaration Instruction, Bit Width, and Signedness from above.
2583
2584[[spirvenv-image-formats]]
2585== Compatibility Between SPIR-V Image Formats and Vulkan Formats
2586
2587SPIR-V code:Image code:Format values are compatible with elink:VkFormat
2588values as defined below:
2589
2590.SPIR-V and Vulkan Image Format Compatibility
2591[cols="2*", options="header"]
2592|====
2593|SPIR-V Image Format    |Compatible Vulkan Format
2594include::{generated}/formats/spirvimageformat.adoc[]
2595|====
2596
2597
2598ifdef::VK_KHR_ray_query+VK_KHR_ray_tracing_position_fetch[]
2599// TODO: add more Ray Query instructions here and move second ifdef down
2600[[spirenv-ray-query-precision-operation]]
2601== Ray Query Precision and Operation
2602
2603The values returned by
2604code:OpRayQueryGetIntersectionTriangleVertexPositionsKHR are transformed by
2605the geometry transform, which is performed at standard
2606<<fundamentals-floatingpoint, floating point>> precision, but without a
2607specifically defined order of floating point operations to perform the
2608matrix multiplication.
2609
2610endif::VK_KHR_ray_query+VK_KHR_ray_tracing_position_fetch[]
2611