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