• Home
  • Raw
  • Download

Lines Matching +full:code +full:-

1 // Copyright 2015-2024 The Khronos Group Inc.
3 // SPDX-License-Identifier: CC-BY-4.0
12 * <<interfaces-iointerfaces,Shader Input and Output Interface>>
13 * <<interfaces-vertexinput,Vertex Input Interface>>
14 * <<interfaces-fragmentoutput,Fragment Output Interface>>
16 * <<interfaces-fragmenttileimage,Fragment Tile Image Interface>>
18 * <<interfaces-inputattachment,Fragment Input Attachment Interface>>
20 * <<interfaces-raypipeline, Ray Tracing Pipeline Interface>>
22 * <<interfaces-resources,Shader Resource Interface>>
24 * <<geometry-passthrough-passthrough,Geometry Shader Passthrough>>
29 <<pipelines-offline-compilation,offline>> using the implementation-provided
35 This chapter describes valid uses for a set of SPIR-V decorations.
37 that, when using SPIR-V versions 1.4 and earlier: code:Block,
38 code:BufferBlock, code:Offset, code:ArrayStride, and code:MatrixStride can
39 also decorate types and type members used by variables in the code:Private
40 and code:Function storage classes.
45 In this chapter, there are references to SPIR-V terms such as the
46 code:MeshNV execution model.
49 This is as intended, since these terms appear in the unified SPIR-V
54 [[interfaces-iointerfaces]]
64 listed as operands to the code:OpEntryPoint instruction and are declared
65 with the code:Input or code:Output storage classes, respectively, in the
66 SPIR-V module.
68 regardless of any non-shader stages between the consecutive shader stages.
71 stages, built-in variables and user-defined variables.
74 code:Output variables of a shader stage have undefined: values until the
75 shader writes to them or uses the code:Initializer operand when declaring
79 [[interfaces-iointerfaces-builtin]]
80 === Built-in Interface Block
82 Shader <<interfaces-builtin-variables,built-in>> variables meeting the
83 following requirements define the _built-in interface block_.
86 * be explicitly declared (there are no implicit built-ins),
87 * be identified with a code:BuiltIn decoration,
89 <<interfaces-builtin-variables,Built-in Variables>> section, and
90 * be declared in a block whose top-level members are the built-ins.
92 There must: be no more than one built-in interface block per shader per
96 built-in interface block decorated with the code:PerPrimitiveEXT decoration
97 and at most one built-in interface block without this decoration
101 Built-ins must: not have any code:Location or code:Component decorations.
104 [[interfaces-iointerfaces-user]]
105 === User-defined Variable Interface
107 The non-built-in variables listed by code:OpEntryPoint with the code:Input
108 or code:Output storage class form the _user-defined variable interface_.
109 These must: have <<formats-numericformat, numeric type>> or, recursively,
112 If an implementation supports <<features-storageInputOutput16,
115 These variables must: be identified with a code:Location decoration and can:
116 also be identified with a code:Component decoration.
119 [[interfaces-iointerfaces-matching]]
128 ** code:XfbBuffer, code:XfbStride, code:Offset, and code:Stream
130 ** one is not decorated with code:Component and the other is declared with
131 a code:Component of `0`
132 ** <<shaders-interpolation-decorations,Interpolation decorations>>
133 ** code:RelaxedPrecision if one is an input variable and the other an
137 as an code:OpTypeArray with an code:Element code:Type equivalent to the
138 code:OpType* declaration of the output, and neither is a structure
141 ** if the <<features-maintenance4, pname:maintenance4>> feature is
142 enabled, they are declared as code:OpTypeVector variables, and the
143 output has a code:Component code:Count value higher than that of the
144 input but the same code:Component code:Type; or
147 ** if the output is declared in a mesh shader as an code:OpTypeArray with
148 an code:Element code:Type equivalent to the code:OpType* declaration of
152 ** if the input is decorated with code:PerVertexKHR, and is declared in a
153 fragment shader as an code:OpTypeArray with an code:Element code:Type
154 equivalent to the code:OpType* declaration of the output, and neither
157 ** if in any other case they are declared with an equivalent code:OpType*
165 code:OpTypeStruct type and interface blocks (which are also declared as
166 code:OpTypeStruct).
171 <<limits-graphicsPipelineLibraryIndependentInterpolationDecoration,
174 <<shaders-interpolation-decorations, interpolation decorations>> differ
175 between the last <<pipelines-graphics-subsets-pre-rasterization,
176 pre-rasterization shader stage>> and the fragment shader stage.
180 preceding shader stage, except for built-in variables in fragment shaders.
186 are described in the <<geometry-passthrough-interface,Passthrough Interface
194 [[interfaces-iointerfaces-locations]]
197 This section describes code:Location assignments for user-defined variables
198 and how many code:Location slots are consumed by a given user-variable type.
199 <<interfaces-iointerfaces-matching, As mentioned above>>, some inputs and
203 code:Location slots the type consumes.
205 The code:Location value specifies an interface slot comprised of a 32-bit
206 four-component vector conveyed between stages.
207 The code:Component specifies <<interfaces-iointerfaces-components, word
208 components>> within these vector code:Location slots.
216 code:Location:
219 * 16-bit scalar and vector types, and
221 * 32-bit scalar and vector types, and
222 * 64-bit scalar and 2-component vector types.
224 64-bit three- and four-component vectors consume two consecutive
225 code:Location slots.
228 _m_ code:Location slots, it will be assigned _m_ {times} _n_ consecutive
229 code:Location slots starting with the specified code:Location.
233 16-,
235 32- or 64-bit matrix, it will be assigned multiple code:Location slots
236 starting with the specified code:Location.
237 The number of code:Location slots assigned for each matrix will be the same
238 as for an _n_-element array of _m_-component vectors.
240 An code:OpVariable with a structure type that is not a block must: be
241 decorated with a code:Location.
243 When an code:OpVariable with a structure type (either block or non-block) is
244 decorated with a code:Location, the members in the structure type must: not
245 be decorated with a code:Location.
246 The code:OpVariable's members are assigned consecutive code:Location slots
248 code:Location decoration from the code:OpVariable.
250 When a block-type code:OpVariable is declared without a code:Location
252 code:Location.
253 Types nested deeper than the top-level members must: not have code:Location
256 The code:Location slots consumed by block and structure members are
257 determined by applying the rules above in a depth-first traversal of the
261 Any two inputs listed as operands on the same code:OpEntryPoint must: not be
262 assigned the same code:Location slot and code:Component word, either
264 Any two outputs listed as operands on the same code:OpEntryPoint must: not
265 be assigned the same code:Location slot and code:Component word, either
268 The number of input and output code:Location slots available for a shader
270 described in <<interfaces-iointerfaces-limits>>.
271 All variables in both the <<interfaces-builtin-variables,built-in interface
272 block>> and the <<interfaces-iointerfaces-user,user-defined variable
274 Each effective code:Location must: have a value less than the number of
275 code:Location slots available for the given interface, as specified in the
276 "`Locations Available`" column in <<interfaces-iointerfaces-limits>>.
279 [[interfaces-iointerfaces-limits]]
309 [[interfaces-iointerfaces-components]]
312 The code:Component decoration allows the code:Location to be more finely
313 specified for scalars and vectors, down to the individual code:Component
314 word within a code:Location slot that are consumed.
315 The code:Component word within a code:Location are 0, 1, 2, and 3.
316 A variable or block member starting at code:Component N will consume
317 code:Component words N, N+1, N+2, ...
320 For 16-, and 32-bit types,
325 it is invalid if this sequence of code:Component words gets larger than 3.
326 A scalar 64-bit type will consume two of these code:Component words in
327 sequence, and a two-component 64-bit vector type will consume all four
328 code:Component words available within a code:Location.
329 A three- or four-component 64-bit vector type must: not specify a non-zero
330 code:Component decoration.
331 A three-component 64-bit vector type will consume all four code:Component
332 words of the first code:Location and code:Component 0 and 1 of the second
333 code:Location.
334 This leaves code:Component 2 and 3 available for other component-qualified
337 A scalar or two-component 64-bit data type must: not specify a
338 code:Component decoration of 1 or 3.
339 A code:Component decoration must: not be specified for any type that is not
342 A four-component 64-bit data type will consume all four code:Component words
343 of the first code:Location and all four code:Component words of the second
344 code:Location.
346 [[interfaces-vertexinput]]
351 The vertex shader input variables are matched by the code:Location and
352 code:Component decorations to the vertex input attributes specified in the
356 The vertex shader input variables listed by code:OpEntryPoint with the
357 code:Input storage class form the _vertex input interface_.
358 These variables must: be identified with a code:Location decoration and can:
359 also be identified with a code:Component decoration.
362 code:Component decoration are considered to have a code:Component decoration
364 The number of available vertex input code:Location slots is given by the
368 See <<fxvertex-attrib-location>> for details.
374 [[interfaces-fragmentoutput]]
380 The fragment shader output variables are matched by the code:Location and
381 code:Component decorations to specified color attachments.
383 The fragment shader output variables listed by code:OpEntryPoint with the
384 code:Output storage class form the _fragment output interface_.
385 These variables must: be identified with a code:Location decoration.
386 They can: also be identified with a code:Component decoration and/or an
387 code:Index decoration.
389 code:Component decoration are considered to have a code:Component decoration
390 of zero, and variables declared without an code:Index decoration are
391 considered to have an code:Index decoration of zero.
393 A fragment shader output variable identified with a code:Location decoration
403 unit as described in <<framebuffer-blending>>, if enabled.
405 <<interfaces-iointerfaces-locations,Location Assignment>>.
406 The number of available fragment output code:Location slots is given by the
417 <<interfaces-iointerfaces-components,Component Assignment>>.
418 Output code:Component words identified as 0, 1, 2, and 3 will be directed to
421 If two variables are placed within the same code:Location, they must: have
422 the same underlying type (floating-point or integer).
423 code:Component words which do not correspond to any fragment shader output
427 Fragment outputs identified with an code:Index of zero are directed to the
429 code:Location.
430 Outputs identified with an code:Index of one are directed to the second
433 There must: be no output variable which has the same code:Location,
434 code:Component, and code:Index as any other, either explicitly declared or
438 code:OpTypeFloat or code:OpTypeInt, and a code:Width of 32.
441 fragment shader can: be also declared with either code:OpTypeFloat or
442 code:OpTypeInt and a code:Width of 16.
445 If the color attachment has a signed or unsigned normalized fixed-point
446 format, color values are assumed to be floating-point and are converted to
447 fixed-point as described in <<fundamentals-fpfixedconv>>; If the color
449 and converted to the bit-depth of the target.
458 [[interfaces-legacy-dithering]]
490 [[interfaces-fragmenttileimage]]
494 image variables decorated with code:Location form an interface with the
496 The fragment shader tile image variables are matched by code:Location
501 The fragment shader variables listed by code:OpEntryPoint with the
502 code:TileImageEXT storage class and a decoration of code:Location form the
504 These variables must: be declared with a type of code:OpTypeImage, and a
505 code:Dim operand of code:TileImageDataEXT.
506 The code:Component decoration is not supported for these variables.
508 Reading from a tile image variable with a code:Location decoration of _i_
515 code:Location whether explicitly declared or implied by an array
522 The basic data type (floating-point, integer, unsigned integer) of the tile
527 [[interfaces-inputattachment]]
533 code:InputAttachmentIndex decorations to the input attachments specified in
537 The fragment shader subpass input variables with the code:UniformConstant
538 storage class and a decoration of code:InputAttachmentIndex that are
539 statically used by code:OpEntryPoint form the _fragment input attachment
541 These variables must: be declared with a type of code:OpTypeImage, a
542 code:Dim operand of code:SubpassData, an code:Arrayed operand of 0, and a
543 code:Sampled operand of 2.
544 The code:MS operand of the code:OpTypeImage must: be 0 if the pname:samples
548 <<subpass-multisampledrendertosinglesampled,multisampled-render-to-single-sampled>>
553 A subpass input variable identified with an code:InputAttachmentIndex
559 code:InputAttachmentIndex whether explicitly declared or implied by an array
561 A multi-aspect image (e.g. a depth/stencil format) can: use the same input
567 Variables identified with the code:InputAttachmentIndex must: only be used
569 The <<formats-numericformat, numeric format>> of the subpass input must:
576 See <<descriptorsets-inputattachment>> for more details.
579 [[compatibility-inputattachment]]
587 [[interfaces-raypipeline]]
594 The three types of inter-stage interface variables for ray tracing pipelines
611 * The hit attribute structure read in an any-hit or closest hit shader
629 | Any-Hit | | r/w | r | |
637 [[interfaces-resources]]
642 variables must: be matched with the <<descriptorsets-pipelinelayout,pipeline
646 stage are the variables statically used by that stage's code:OpEntryPoint
647 with a storage class of code:Uniform, code:UniformConstant,
649 code:StorageBuffer,
651 or code:PushConstant.
652 For the fragment shader, this includes the <<interfaces-inputattachment,
655 The shader resource interface consists of two sub-interfaces: the push
659 [[interfaces-resources-pushconst]]
662 The shader variables defined with a storage class of code:PushConstant that
667 * typed as code:OpTypeStruct,
668 * identified with a code:Block decoration, and
669 * laid out explicitly using the code:Offset, code:ArrayStride, and
670 code:MatrixStride decorations as specified in
671 <<interfaces-resources-layout,Offset and Stride Assignment>>.
677 code:Offset such that the entire member is entirely contained within the
678 slink:VkPushConstantRange for each code:OpEntryPoint that uses it, and the
681 The code:Offset decoration for any member of a push constant block must: not
689 [[interfaces-resources-descset]]
695 code:StorageBuffer,
697 code:Uniform or code:UniformConstant (including the variables in the
698 <<interfaces-inputattachment,fragment input attachment interface>>) that are
701 These variables must: have code:DescriptorSet and code:Binding decorations
704 <<interfaces-resources-setandbinding,DescriptorSet and Binding Assignment>>.
706 The code:Image code:Format of an code:OpTypeImage declaration must: not be
707 *Unknown*, for variables which are used for code:OpImageRead,
708 code:OpImageSparseRead, or code:OpImageWrite operations, except under the
711 * For code:OpImageWrite, if the image format is listed in the
712 <<formats-without-shader-storage-format,storage without format>> list
714 and the shader module declares the code:StorageImageWriteWithoutFormat
717 * For code:OpImageWrite, if the image format supports
719 shader module declares the code:StorageImageWriteWithoutFormat
722 * For code:OpImageRead or code:OpImageSparseRead, if the image format is
723 listed in the <<formats-without-shader-storage-format,storage without
726 code:StorageImageReadWithoutFormat capability.
728 * For code:OpImageRead or code:OpImageSparseRead, if the image format
730 the shader module declares the code:StorageImageReadWithoutFormat
733 * For code:OpImageRead, if code:Dim is code:SubpassData (indicating a read
736 The code:Image code:Format of an code:OpTypeImage declaration must: not be
737 *Unknown*, for variables which are used for code:OpAtomic* operations.
739 Variables identified with the code:Uniform storage class are used to access
743 * typed as code:OpTypeStruct, or an array of this type,
744 * identified with a code:Block or code:BufferBlock decoration, and
745 * laid out explicitly using the code:Offset, code:ArrayStride, and
746 code:MatrixStride decorations as specified in
747 <<interfaces-resources-layout,Offset and Stride Assignment>>.
750 Variables identified with the code:StorageBuffer storage class are used to
754 * typed as code:OpTypeStruct, or an array of this type,
755 * identified with a code:Block decoration, and
756 * laid out explicitly using the code:Offset, code:ArrayStride, and
757 code:MatrixStride decorations as specified in
758 <<interfaces-resources-layout,Offset and Stride Assignment>>.
762 The code:Offset decoration for any variable in a code:Block must: not cause
765 The code:Offset decoration for any variable in a code:BufferBlock must: not
771 The code:Offset decoration for any member of a code:Block-decorated variable
772 in the code:Uniform storage class must: not cause the space required for
775 The code:Offset decoration for any member of a code:Block-decorated variable
776 in the code:StorageBuffer storage class must: not cause the space required
782 Variables identified with the code:Uniform storage class can: also be used
786 In this case the variable must: be typed as code:OpTypeStruct and cannot: be
788 Further, the code:Offset decoration for any member of such a variable must:
793 Variables identified with a storage class of code:UniformConstant and a
794 decoration of code:InputAttachmentIndex must: be declared as described in
795 <<interfaces-inputattachment,Fragment Input Attachment Interface>>.
797 SPIR-V variables decorated with a descriptor set and binding that identify a
798 <<descriptorsets-combinedimagesampler, combined image sampler descriptor>>
799 can: have a type of code:OpTypeImage, code:OpTypeSampler (code:Sampled=1),
800 or code:OpTypeSampledImage.
805 in order to index such arrays with dynamically uniform or non-uniform
810 code:StorageImageArrayDynamicIndexing
812 ** Non-uniform: pname:shaderStorageImageArrayNonUniformIndexing and
813 code:StorageImageArrayNonUniformIndexing
816 and code:StorageTexelBufferArrayDynamicIndexing
817 ** Non-uniform: pname:shaderStorageTexelBufferArrayNonUniformIndexing and
818 code:StorageTexelBufferArrayNonUniformIndexing
821 and code:InputAttachmentArrayDynamicIndexing
822 ** Non-uniform: pname:shaderInputAttachmentArrayNonUniformIndexing and
823 code:InputAttachmentArrayNonUniformIndexing
828 code:SampledImageArrayDynamicIndexing
830 ** Non-uniform: pname:shaderSampledImageArrayNonUniformIndexing and
831 code:SampledImageArrayNonUniformIndexing
834 and code:UniformTexelBufferArrayDynamicIndexing
835 ** Non-uniform: pname:shaderUniformTexelBufferArrayNonUniformIndexing and
836 code:UniformTexelBufferArrayNonUniformIndexing
840 code:UniformBufferArrayDynamicIndexing
842 ** Non-uniform: pname:shaderUniformBufferArrayNonUniformIndexing and
843 code:UniformBufferArrayNonUniformIndexing
847 code:StorageBufferArrayDynamicIndexing
849 ** Non-uniform: pname:shaderStorageBufferArrayNonUniformIndexing and
850 code:StorageBufferArrayNonUniformIndexing
855 ** Non-uniform: Always supported.
858 * <<descriptorsets-weightimage,weight image>>:
860 ** Non-uniform: Never supported.
861 * <<descriptorsets-blockmatch, Block matching image>>:
863 ** Non-uniform: Never supported.
869 dynamically uniform, then the corresponding non-uniform indexing feature
874 from an array element with a non-constant index, then the corresponding
877 or non-uniform
887 conversion or samples a <<samplers-subsamplesampler,subsampled image>>,
890 into arrays in shader code, irrespective of the
896 <<samplers-subsamplesampler,subsampled image>>, it must: be indexed only by
897 constant integral expressions when aggregated into arrays in shader code,
902 [[interfaces-resources-correspondence]]
935 [[interfaces-resources-storage-class-correspondence]]
941 | code:UniformConstant | code:OpTypeSampler |
943 | code:UniformConstant | code:OpTypeImage (code:Sampled=1)|
945 | code:UniformConstant | code:OpTypeImage (code:Sampled=2) |
947 | code:UniformConstant | code:OpTypeSampledImage +
948 code:OpTypeImage (code:Sampled=1) +
949 code:OpTypeSampler |
951 | code:UniformConstant | code:OpTypeImage (code:Dim=code:Buffer, code:Sampled=1) |
953 | code:UniformConstant | code:OpTypeImage (code:Dim=code:Buffer, code:Sampled=2) |
955 | code:Uniform | code:OpTypeStruct
956 | code:Block, code:Offset, (code:ArrayStride), (code:MatrixStride)
959 | code:Uniform | code:OpTypeStruct
960 | code:BufferBlock, code:Offset, (code:ArrayStride), (code:MatrixStride)
964 | code:Uniform .2+<.^| code:OpTypeStruct
965 | code:BufferBlock, code:Offset, (code:ArrayStride), (code:MatrixStride)
966 | code:StorageBuffer | code:Block, code:Offset, (code:ArrayStride), (code:MatrixStride)
969 | code:UniformConstant | code:OpTypeImage (code:Dim=code:SubpassData, code:Sampled=2)
970 | code:InputAttachmentIndex
973 | code:Uniform | code:OpTypeStruct
974 | code:Block, code:Offset, (code:ArrayStride), (code:MatrixStride)
978 | code:UniformConstant | code:OpTypeAccelerationStructureKHR |
982 | code:UniformConstant | code:OpTypeImage (code:Depth=0, code:Dim=code:2D, +
983 code:Arrayed=1, code:MS=0, code:Sampled=1)
984 | code:WeightTextureQCOM
986 | code:UniformConstant | code:OpTypeImage (code:Depth=0, code:Dim=code:2D, +
987 code:Arrayed=0, code:MS=0, code:Sampled=1)
988 | code:BlockMatchTextureQCOM
993 Where code:OpTypeImage is referenced, the code:Dim values code:Buffer
994 and code:Subpassdata are only accepted where they are specifically
997 code:OpTypeImage is specified.
999 In addition to code:DescriptorSet and code:Binding.
1002 [[interfaces-resources-setandbinding]]
1005 A variable decorated with a code:DescriptorSet decoration of [eq]#s# and a
1006 code:Binding decoration of [eq]#b# indicates that this variable is
1011 code:DescriptorSet decoration values must: be between zero and
1013 code:Binding decoration values can: be any 32-bit unsigned integer value, as
1014 described in <<descriptorsets-setlayout>>.
1017 If the code:Binding decoration is used with an array, the entire array is
1019 The array must: be a single-dimensional array and size of the array must: be
1022 If the array is runtime-sized, then array elements greater than or equal to
1024 If the array is runtime-sized, the pname:runtimeDescriptorArray feature
1025 must: be enabled and the code:RuntimeDescriptorArray capability must: be
1029 The array must: not be runtime-sized.
1033 <<descriptorsets-updates,operations>>, if a resource variable is not an
1038 <<interfaces-resources-limits,Shader Resource Limits>>.
1059 However, if a variable assigned to a given code:DescriptorSet and
1060 code:Binding is statically used by the entry point for a shader stage, the
1065 The variable must: be of a valid resource type determined by its SPIR-V type
1067 <<interfaces-resources-storage-class-correspondence,Shader Resource and
1070 type, as defined in <<interfaces-resources-correspondence,Shader Resource
1078 <<shaders-staticuse,statically used>> has an impact.
1080 <<shaders-staticuse,statically used>> in a shader, then the underlying
1082 <<interfaces-resources-correspondence,support the declared type in the
1088 However, accesses are not automatically synchronized, and code:Aliased
1090 https://registry.khronos.org/spir-v/specs/unified1/SPIRV.html#_a_id_aliasingsection_a_aliasing[sect…
1091 2.18.2 Aliasing in the SPIR-V specification]).
1099 A noteworthy example of using multiple statically-used shader variables
1102 corresponding shader variables in the code:UniformConstant storage class,
1103 where some could be code:OpTypeImage (code:Sampled=1), some could be
1104 code:OpTypeSampler, and some could be code:OpTypeSampledImage.
1107 [[interfaces-resources-limits]]
1175 [[interfaces-resources-layout]]
1178 Certain objects must: be explicitly laid out using the code:Offset,
1179 code:ArrayStride, and code:MatrixStride, as described in
1180 https://registry.khronos.org/spir-v/specs/unified1/SPIRV.html#ShaderValidation[SPIR-V
1187 The numeric order of code:Offset decorations does not need to follow member
1192 [[interfaces-alignment-requirements]]
1200 * A column-major matrix with [eq]#C# columns and [eq]#R# rows is
1203 * A row-major matrix with [eq]#C# columns and [eq]#R# rows is equivalent
1206 The _scalar alignment_ of the type of an code:OpTypeStruct member is defined
1218 The _base alignment_ of the type of an code:OpTypeStruct member is defined
1222 * A two-component vector has a base alignment equal to twice its scalar
1224 * A three- or four-component vector has a base alignment equal to four
1232 SPIR-V module.
1233 (e.g., for a 1 byte aligned empty struct in the code:StorageBuffer
1234 storage class, code:StorageBuffer8BitAccess or
1235 code:UniformAndStorageBuffer8BitAccess must: be declared in the SPIR-V
1240 The _extended alignment_ of the type of an code:OpTypeStruct member is
1257 code:Offset decorations placing its first byte at [eq]#F# and its last
1260 code:Offset decorations placing its first byte at a non-integer multiple
1265 [[interfaces-resources-standard-layout]]
1268 Every member of an code:OpTypeStruct that is required to be explicitly laid
1274 . If the code:scalarBlockLayout feature is enabled on the device and the
1275 storage class is code:Uniform, code:StorageBuffer,
1277 code:PhysicalStorageBuffer,
1280 code:ShaderRecordBufferKHR,
1282 or code:PushConstant then every member must: be aligned according to its
1286 . If the code:workgroupMemoryExplicitLayoutScalarBlockLayout feature is
1287 enabled on the device and the storage class is code:Workgroup then every
1300 member of an code:OpTypeStruct with a storage class of code:Uniform and
1301 a decoration of code:Block must: be aligned according to its extended
1316 * The code:Offset decoration of any member must: be a multiple of its
1318 * Any code:ArrayStride or code:MatrixStride decoration must: be a multiple
1325 * The storage class is code:Uniform, code:StorageBuffer,
1327 code:PhysicalStorageBuffer,
1330 code:ShaderRecordBufferKHR,
1332 or code:PushConstant, and the code:scalarBlockLayout feature is not
1336 * The storage class is code:Workgroup, and either the struct member is not
1337 part of a code:Block or the
1338 code:workgroupMemoryExplicitLayoutScalarBlockLayout feature is not
1349 * The code:Offset decoration of a member must: not place it between the
1363 [[interfaces-builtin-variables]]
1364 == Built-In Variables
1366 Built-in variables are accessed in shaders by declaring a variable decorated
1367 with a code:BuiltIn SPIR-V decoration.
1368 The meaning of each code:BuiltIn decoration is as follows.
1369 In the remainder of this section, the name of a built-in is used
1371 particular built-in.
1372 Built-ins that represent integer values can: be declared as either signed or
1373 unsigned 32-bit integers.
1375 <<interfaces-iointerfaces-matching, As mentioned above>>, some inputs and
1379 must be included when declaring the built-in.
1382 [[interfaces-builtin-variables-barycoordkhr]]
1384 --
1387 code:BaryCoordKHR::
1389 The code:BaryCoordKHR decoration can: be used to decorate a fragment shader
1391 This variable will contain a three-component floating-point vector with
1393 the screen-space locations of vertices of its primitive, obtained using
1398 * [[VUID-{refpage}-BaryCoordKHR-04154]]
1399 The code:BaryCoordKHR decoration must: be used only within the
1400 code:Fragment {ExecutionModel}
1401 * [[VUID-{refpage}-BaryCoordKHR-04155]]
1402 The variable decorated with code:BaryCoordKHR must: be declared using
1403 the code:Input {StorageClass}
1404 * [[VUID-{refpage}-BaryCoordKHR-04156]]
1405 The variable decorated with code:BaryCoordKHR must: be declared as a
1406 three-component vector of 32-bit floating-point values
1408 --
1412 [open,refpage='BaryCoordNoPerspAMD',desc='Barycentric coordinates of a fragment center in screen-sp…
1413 --
1416 code:BaryCoordNoPerspAMD::
1418 The code:BaryCoordNoPerspAMD decoration can: be used to decorate a fragment
1428 * [[VUID-{refpage}-BaryCoordNoPerspAMD-04157]]
1429 The code:BaryCoordNoPerspAMD decoration must: be used only within the
1430 code:Fragment {ExecutionModel}
1431 * [[VUID-{refpage}-BaryCoordNoPerspAMD-04158]]
1432 The variable decorated with code:BaryCoordNoPerspAMD must: be declared
1433 using the code:Input {StorageClass}
1434 * [[VUID-{refpage}-BaryCoordNoPerspAMD-04159]]
1435 The variable decorated with code:BaryCoordNoPerspAMD must: be declared
1436 as a two-component vector of 32-bit floating-point values
1438 --
1442 [[interfaces-builtin-variables-barycoordnoperspkhr]]
1443 [open,refpage='BaryCoordNoPerspKHR',desc='Barycentric coordinates of a fragment in screen-space',ty…
1444 --
1447 code:BaryCoordNoPerspKHR::
1449 The code:BaryCoordNoPerspKHR decoration can: be used to decorate a fragment
1451 This variable will contain a three-component floating-point vector with
1453 the screen-space locations of vertices of its primitive, obtained using
1458 * [[VUID-{refpage}-BaryCoordNoPerspKHR-04160]]
1459 The code:BaryCoordNoPerspKHR decoration must: be used only within the
1460 code:Fragment {ExecutionModel}
1461 * [[VUID-{refpage}-BaryCoordNoPerspKHR-04161]]
1462 The variable decorated with code:BaryCoordNoPerspKHR must: be declared
1463 using the code:Input {StorageClass}
1464 * [[VUID-{refpage}-BaryCoordNoPerspKHR-04162]]
1465 The variable decorated with code:BaryCoordNoPerspKHR must: be declared
1466 as a three-component vector of 32-bit floating-point values
1468 --
1472 …pCentroidAMD',desc='Barycentric coordinates of a fragment centroid in screen-space',type='builtins…
1473 --
1476 code:BaryCoordNoPerspCentroidAMD::
1478 The code:BaryCoordNoPerspCentroidAMD decoration can: be used to decorate a
1488 * [[VUID-{refpage}-BaryCoordNoPerspCentroidAMD-04163]]
1489 The code:BaryCoordNoPerspCentroidAMD decoration must: be used only
1490 within the code:Fragment {ExecutionModel}
1491 * [[VUID-{refpage}-BaryCoordNoPerspCentroidAMD-04164]]
1492 The variable decorated with code:BaryCoordNoPerspCentroidAMD must: be
1493 declared using the code:Input {StorageClass}
1494 * [[VUID-{refpage}-BaryCoordNoPerspCentroidAMD-04165]]
1495 The variable decorated with code:BaryCoordNoPerspCentroidAMD must: be
1496 declared as a three-component vector of 32-bit floating-point values
1498 --
1500 …NoPerspSampleAMD',desc='Barycentric coordinates of a sample center in screen-space',type='builtins…
1501 --
1504 code:BaryCoordNoPerspSampleAMD::
1506 The code:BaryCoordNoPerspSampleAMD decoration can: be used to decorate a
1516 * [[VUID-{refpage}-BaryCoordNoPerspSampleAMD-04166]]
1517 The code:BaryCoordNoPerspSampleAMD decoration must: be used only within
1518 the code:Fragment {ExecutionModel}
1519 * [[VUID-{refpage}-BaryCoordNoPerspSampleAMD-04167]]
1520 The variable decorated with code:BaryCoordNoPerspSampleAMD must: be
1521 declared using the code:Input {StorageClass}
1522 * [[VUID-{refpage}-BaryCoordNoPerspSampleAMD-04168]]
1523 The variable decorated with code:BaryCoordNoPerspSampleAMD must: be
1524 declared as a two-component vector of 32-bit floating-point values
1526 --
1529 --
1532 code:BaryCoordPullModelAMD::
1534 The code:BaryCoordPullModelAMD decoration can: be used to decorate a
1542 * [[VUID-{refpage}-BaryCoordPullModelAMD-04169]]
1543 The code:BaryCoordPullModelAMD decoration must: be used only within the
1544 code:Fragment {ExecutionModel}
1545 * [[VUID-{refpage}-BaryCoordPullModelAMD-04170]]
1546 The variable decorated with code:BaryCoordPullModelAMD must: be declared
1547 using the code:Input {StorageClass}
1548 * [[VUID-{refpage}-BaryCoordPullModelAMD-04171]]
1549 The variable decorated with code:BaryCoordPullModelAMD must: be declared
1550 as a three-component vector of 32-bit floating-point values
1552 --
1555 --
1558 code:BaryCoordSmoothAMD::
1560 The code:BaryCoordSmoothAMD decoration can: be used to decorate a fragment
1570 * [[VUID-{refpage}-BaryCoordSmoothAMD-04172]]
1571 The code:BaryCoordSmoothAMD decoration must: be used only within the
1572 code:Fragment {ExecutionModel}
1573 * [[VUID-{refpage}-BaryCoordSmoothAMD-04173]]
1574 The variable decorated with code:BaryCoordSmoothAMD must: be declared
1575 using the code:Input {StorageClass}
1576 * [[VUID-{refpage}-BaryCoordSmoothAMD-04174]]
1577 The variable decorated with code:BaryCoordSmoothAMD must: be declared as
1578 a two-component vector of 32-bit floating-point values
1580 --
1583 --
1586 code:BaryCoordSmoothCentroidAMD::
1588 The code:BaryCoordSmoothCentroidAMD decoration can: be used to decorate a
1598 * [[VUID-{refpage}-BaryCoordSmoothCentroidAMD-04175]]
1599 The code:BaryCoordSmoothCentroidAMD decoration must: be used only within
1600 the code:Fragment {ExecutionModel}
1601 * [[VUID-{refpage}-BaryCoordSmoothCentroidAMD-04176]]
1602 The variable decorated with code:BaryCoordSmoothCentroidAMD must: be
1603 declared using the code:Input {StorageClass}
1604 * [[VUID-{refpage}-BaryCoordSmoothCentroidAMD-04177]]
1605 The variable decorated with code:BaryCoordSmoothCentroidAMD must: be
1606 declared as a two-component vector of 32-bit floating-point values
1608 --
1611 --
1614 code:BaryCoordSmoothSampleAMD::
1616 The code:BaryCoordSmoothSampleAMD decoration can: be used to decorate a
1626 * [[VUID-{refpage}-BaryCoordSmoothSampleAMD-04178]]
1627 The code:BaryCoordSmoothSampleAMD decoration must: be used only within
1628 the code:Fragment {ExecutionModel}
1629 * [[VUID-{refpage}-BaryCoordSmoothSampleAMD-04179]]
1630 The variable decorated with code:BaryCoordSmoothSampleAMD must: be
1631 declared using the code:Input {StorageClass}
1632 * [[VUID-{refpage}-BaryCoordSmoothSampleAMD-04180]]
1633 The variable decorated with code:BaryCoordSmoothSampleAMD must: be
1634 declared as a two-component vector of 32-bit floating-point values
1636 --
1641 [[interfaces-builtin-variables-baseinstance]]
1643 --
1646 code:BaseInstance::
1648 Decorating a variable with the code:BaseInstance built-in will make that
1651 code:BaseInstance is the pname:firstInstance parameter to a _direct drawing
1657 * [[VUID-{refpage}-BaseInstance-04181]]
1658 The code:BaseInstance decoration must: be used only within the
1659 code:Vertex {ExecutionModel}
1660 * [[VUID-{refpage}-BaseInstance-04182]]
1661 The variable decorated with code:BaseInstance must: be declared using
1662 the code:Input {StorageClass}
1663 * [[VUID-{refpage}-BaseInstance-04183]]
1664 The variable decorated with code:BaseInstance must: be declared as a
1665 scalar 32-bit integer value
1667 --
1669 [[interfaces-builtin-variables-basevertex]]
1671 --
1674 code:BaseVertex::
1676 Decorating a variable with the code:BaseVertex built-in will make that
1680 For _non-indexed drawing commands_, this variable is the pname:firstVertex
1689 * [[VUID-{refpage}-BaseVertex-04184]]
1690 The code:BaseVertex decoration must: be used only within the code:Vertex
1692 * [[VUID-{refpage}-BaseVertex-04185]]
1693 The variable decorated with code:BaseVertex must: be declared using the
1694 code:Input {StorageClass}
1695 * [[VUID-{refpage}-BaseVertex-04186]]
1696 The variable decorated with code:BaseVertex must: be declared as a
1697 scalar 32-bit integer value
1699 --
1702 [[interfaces-builtin-variables-clipdistance]]
1703 [open,refpage='ClipDistance',desc='Application-specified clip distances',type='builtins']
1704 --
1707 code:ClipDistance::
1709 Decorating a variable with the code:ClipDistance built-in decoration will
1711 code:ClipDistance is an array such that the i^th^ element of the array
1714 means the vertex is inside the clip half-space, and a negative distance
1715 means the vertex is outside the clip half-space.
1720 The array variable decorated with code:ClipDistance is explicitly sized by
1727 In the last <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization
1731 If code:ClipDistance is then used by a fragment shader, code:ClipDistance
1737 * [[VUID-{refpage}-ClipDistance-04187]]
1738 The code:ClipDistance decoration must: be used only within the
1739 code:MeshEXT, code:MeshNV, code:Vertex, code:Fragment,
1740 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
1742 * [[VUID-{refpage}-ClipDistance-04188]]
1743 The variable decorated with code:ClipDistance within the code:MeshEXT,
1744 code:MeshNV, or code:Vertex {ExecutionModel} must: be declared using the
1745 code:Output {StorageClass}
1746 * [[VUID-{refpage}-ClipDistance-04189]]
1747 The variable decorated with code:ClipDistance within the code:Fragment
1748 {ExecutionModel} must: be declared using the code:Input {StorageClass}
1749 * [[VUID-{refpage}-ClipDistance-04190]]
1750 The variable decorated with code:ClipDistance within the
1751 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
1753 code:Input or code:Output
1754 * [[VUID-{refpage}-ClipDistance-04191]]
1755 The variable decorated with code:ClipDistance must: be declared as an
1756 array of 32-bit floating-point values
1758 --
1761 [[interfaces-builtin-variables-clipdistancepv]]
1762 [open,refpage='ClipDistancePerViewNV',desc='Application-specified clip distances per view',type='bu…
1763 --
1766 code:ClipDistancePerViewNV::
1768 Decorating a variable with the code:ClipDistancePerViewNV built-in
1769 decoration will make that variable contain the per-view clip distances.
1770 The per-view clip distances have the same semantics as code:ClipDistance.
1774 * [[VUID-{refpage}-ClipDistancePerViewNV-04192]]
1775 The code:ClipDistancePerViewNV decoration must: be used only within the
1776 code:MeshNV {ExecutionModel}
1777 * [[VUID-{refpage}-ClipDistancePerViewNV-04193]]
1778 The variable decorated with code:ClipDistancePerViewNV must: be declared
1779 using the code:Output {StorageClass}
1780 * [[VUID-{refpage}-ClipDistancePerViewNV-04194]]
1781 The variable decorated with code:ClipDistancePerViewNV must: also be
1782 decorated with the code:PerViewNV decoration
1783 * [[VUID-{refpage}-ClipDistancePerViewNV-04195]]
1784 The variable decorated with code:ClipDistancePerViewNV must: be declared
1785 as a two-dimensional array of 32-bit floating-point values
1787 --
1792 [[interfaces-builtin-variables-clusteridhuawei]]
1794 --
1797 code:ClusterIDHUAWEI::
1799 The code:ClusterIDHUAWEI decoration can be used to decorate a cluster
1802 When Cluster Culling Shader enable, code:ClusterIDHUAWEI will replace
1803 gl_DrawID pass to vertex shader for cluster-related information fetching.
1808 * [[VUID-{refpage}-ClusterIDHUAWEI-07797]]
1809 The code:ClusterIDHUAWEI decoration must: be used only within the
1810 code:ClusterCullingHUAWEI {ExecutionModel}
1811 * [[VUID-{refpage}-ClusterIDHUAWEI-07798]]
1812 The variable decorated with code:ClusterIDHUAWEI must: be declared as a
1813 scalar 32-bit integer value
1815 --
1819 [[interfaces-builtin-variables-clustershadingratehuawei]]
1821 --
1824 code:ClusterShadingRateHUAWEI::
1826 The code:ClusterShadingRateHUAWEI decoration can be used to decorate a
1833 * [[VUID-{refpage}-ClusterShadingRateHUAWEI-09448]]
1834 The code:ClusterShadingRateHUAWEI decoration must: be used only within
1835 the code:ClusterCullingHUAWEI {ExecutionModel}
1836 * [[VUID-{refpage}-ClusterShadingRateHUAWEI-09449]]
1837 The variable decorated with code:ClusterShadingRateHUAWEI must: be
1838 declared as a scalar 32-bit integer value
1840 --
1845 [[interfaces-builtin-variables-culldistance]]
1846 [open,refpage='CullDistance',desc='Application-specified cull distances',type='builtins']
1847 --
1850 code:CullDistance::
1852 Decorating a variable with the code:CullDistance built-in decoration will
1861 In fragment shaders, the values of the code:CullDistance array are linearly
1868 If code:CullDistance decorates an input variable, that variable will contain
1869 the corresponding value from the code:CullDistance decorated output variable
1875 * [[VUID-{refpage}-CullDistance-04196]]
1876 The code:CullDistance decoration must: be used only within the
1877 code:MeshEXT, code:MeshNV, code:Vertex, code:Fragment,
1878 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
1880 * [[VUID-{refpage}-CullDistance-04197]]
1881 The variable decorated with code:CullDistance within the code:MeshEXT,
1882 code:MeshNV or code:Vertex {ExecutionModel} must: be declared using the
1883 code:Output {StorageClass}
1884 * [[VUID-{refpage}-CullDistance-04198]]
1885 The variable decorated with code:CullDistance within the code:Fragment
1886 {ExecutionModel} must: be declared using the code:Input {StorageClass}
1887 * [[VUID-{refpage}-CullDistance-04199]]
1888 The variable decorated with code:CullDistance within the
1889 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
1891 code:Input or code:Output
1892 * [[VUID-{refpage}-CullDistance-04200]]
1893 The variable decorated with code:CullDistance must: be declared as an
1894 array of 32-bit floating-point values
1896 --
1899 [[interfaces-builtin-variables-culldistancepv]]
1900 [open,refpage='CullDistancePerViewNV',desc='Application-specified cull distances per view',type='bu…
1901 --
1904 code:CullDistancePerViewNV::
1906 Decorating a variable with the code:CullDistancePerViewNV built-in
1907 decoration will make that variable contain the per-view cull distances.
1908 The per-view cull distances have the same semantics as code:CullDistance.
1912 * [[VUID-{refpage}-CullDistancePerViewNV-04201]]
1913 The code:CullDistancePerViewNV decoration must: be used only within the
1914 code:MeshNV {ExecutionModel}
1915 * [[VUID-{refpage}-CullDistancePerViewNV-04202]]
1916 The variable decorated with code:CullDistancePerViewNV must: be declared
1917 using the code:Output {StorageClass}
1918 * [[VUID-{refpage}-CullDistancePerViewNV-04203]]
1919 The variable decorated with code:CullDistancePerViewNV must: also be
1920 decorated with the code:PerViewNV decoration
1921 * [[VUID-{refpage}-CullDistancePerViewNV-04204]]
1922 The variable decorated with code:CullDistancePerViewNV must: be declared
1923 as a two-dimensional array of 32-bit floating-point values
1925 --
1929 [[interfaces-builtin-variables-cullprimitive]]
1930 [open,refpage='CullPrimitiveEXT',desc='Application-specified culling state per primitive',type='bui…
1931 --
1934 code:CullPrimitiveEXT::
1936 Decorating a variable with the code:CullPrimitiveEXT built-in decoration
1938 If the per-primitive boolean value is code:true, the primitive will be
1939 culled, if it is code:false it will not be culled.
1943 * [[VUID-{refpage}-CullPrimitiveEXT-07034]]
1944 The code:CullPrimitiveEXT decoration must: be used only within the
1945 code:MeshEXT {ExecutionModel}
1946 * [[VUID-{refpage}-CullPrimitiveEXT-07035]]
1947 The variable decorated with code:CullPrimitiveEXT must: be declared
1948 using the code:Output {StorageClass}
1949 * [[VUID-{refpage}-CullPrimitiveEXT-07036]]
1950 The variable decorated with code:CullPrimitiveEXT must: be declared as
1952 * [[VUID-{refpage}-CullPrimitiveEXT-07037]]
1953 The size of the array decorated with code:CullPrimitiveEXT must: match
1954 the value specified by code:OutputPrimitivesEXT
1955 * [[VUID-{refpage}-CullPrimitiveEXT-07038]]
1956 The variable decorated with code:CullPrimitiveEXT within the
1957 code:MeshEXT {ExecutionModel} must: also be decorated with the
1958 code:PerPrimitiveEXT decoration
1960 --
1964 [[interfaces-builtin-variables-cullmask]]
1966 --
1969 code:CullMaskKHR::
1971 A variable decorated with the code:CullMaskKHR decoration will specify the
1974 code:OpTrace* instructions.
1978 * [[VUID-{refpage}-CullMaskKHR-06735]]
1979 The code:CullMaskKHR decoration must: be used only within the
1980 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
1981 code:MissKHR {ExecutionModel}
1982 * [[VUID-{refpage}-CullMaskKHR-06736]]
1983 The variable decorated with code:CullMaskKHR must: be declared using the
1984 code:Input {StorageClass}
1985 * [[VUID-{refpage}-CullMaskKHR-06737]]
1986 The variable decorated with code:CullMaskKHR must: be declared as a
1987 scalar 32-bit integer value
1989 --
1993 [[interfaces-builtin-variables-currentraytime]]
1995 --
1998 code:CurrentRayTimeNV::
2000 A variable decorated with the code:CurrentRayTimeNV decoration contains the
2001 time value passed in to code:OpTraceRayMotionNV which called this shader.
2005 * [[VUID-{refpage}-CurrentRayTimeNV-04942]]
2006 The code:CurrentRayTimeNV decoration must: be used only within the
2007 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
2008 code:MissKHR {ExecutionModel}
2009 * [[VUID-{refpage}-CurrentRayTimeNV-04943]]
2010 The variable decorated with code:CurrentRayTimeNV must: be declared
2011 using the code:Input {StorageClass}
2012 * [[VUID-{refpage}-CurrentRayTimeNV-04944]]
2013 The variable decorated with code:CurrentRayTimeNV must: be declared as a
2014 scalar 32-bit floating-point value
2016 --
2021 [[interfaces-builtin-variables-deviceindex]]
2023 --
2026 code:DeviceIndex::
2028 The code:DeviceIndex decoration can: be applied to a shader input which will
2037 * [[VUID-{refpage}-DeviceIndex-04205]]
2038 The variable decorated with code:DeviceIndex must: be declared using the
2039 code:Input {StorageClass}
2040 * [[VUID-{refpage}-DeviceIndex-04206]]
2041 The variable decorated with code:DeviceIndex must: be declared as a
2042 scalar 32-bit integer value
2044 --
2048 [[interfaces-builtin-variables-drawindex]]
2050 --
2053 code:DrawIndex::
2055 Decorating a variable with the code:DrawIndex built-in will make that
2056 variable contain the integer value corresponding to the zero-based index of
2060 For _indirect drawing commands_, code:DrawIndex begins at zero and
2066 variable contains the integer value corresponding to the zero-based index of
2070 code:DrawIndex is always zero.
2071 code:DrawIndex is dynamically uniform.
2081 * [[VUID-{refpage}-DrawIndex-04207]]
2082 The code:DrawIndex decoration must: be used only within the code:Vertex,
2083 code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV {ExecutionModel}
2084 * [[VUID-{refpage}-DrawIndex-04208]]
2085 The variable decorated with code:DrawIndex must: be declared using the
2086 code:Input {StorageClass}
2087 * [[VUID-{refpage}-DrawIndex-04209]]
2088 The variable decorated with code:DrawIndex must: be declared as a scalar
2089 32-bit integer value
2091 --
2095 [[interfaces-builtin-variables-firstindexhuawei]]
2097 --
2100 code:FirstIndexHUAWEI::
2102 The code:FirstIndexHUAWEI decoration can be used to decorate a cluster
2110 * [[VUID-{refpage}-FirstIndexHUAWEI-07799]]
2111 The code:FirstIndexHUAWEI decoration must: be used only within the
2112 code:ClusterCullingHUAWEI {ExecutionModel}
2113 * [[VUID-{refpage}-FirstIndexHUAWEI-07800]]
2114 The variable decorated with code:FirstIndexHUAWEI must: be declared as a
2115 scalar 32-bit integer value
2117 --
2121 [[interfaces-builtin-variables-fragcoord]]
2122 [open,refpage='FragCoord',desc='Screen-space coordinate of the fragment center',type='builtins']
2123 --
2126 code:FragCoord::
2128 Decorating a variable with the code:FragCoord built-in decoration will make
2134 When <<primsrast-sampleshading,Sample Shading>> is enabled, the [eq]#x# and
2135 [eq]#y# components of code:FragCoord reflect the location of one of the
2138 Otherwise, the [eq]#x# and [eq]#y# components of code:FragCoord reflect the
2141 The [eq]#z# component of code:FragCoord is the interpolated depth value of
2146 The code:Centroid interpolation decoration is ignored, but allowed, on
2147 code:FragCoord.
2151 * [[VUID-{refpage}-FragCoord-04210]]
2152 The code:FragCoord decoration must: be used only within the
2153 code:Fragment {ExecutionModel}
2154 * [[VUID-{refpage}-FragCoord-04211]]
2155 The variable decorated with code:FragCoord must: be declared using the
2156 code:Input {StorageClass}
2157 * [[VUID-{refpage}-FragCoord-04212]]
2158 The variable decorated with code:FragCoord must: be declared as a
2159 four-component vector of 32-bit floating-point values
2161 --
2163 [[interfaces-builtin-variables-fragdepth]]
2164 [open,refpage='FragDepth',desc='Application-specified depth for depth testing',type='builtins']
2165 --
2168 code:FragDepth::
2170 To have a shader supply a fragment-depth value, the shader must: declare the
2171 code:DepthReplacing execution mode.
2172 Such a shader's fragment-depth value will come from the variable decorated
2173 with the code:FragDepth built-in decoration.
2177 See <<fragops-shader-depthreplacement, fragment shader depth replacement>>
2182 * [[VUID-{refpage}-FragDepth-04213]]
2183 The code:FragDepth decoration must: be used only within the
2184 code:Fragment {ExecutionModel}
2185 * [[VUID-{refpage}-FragDepth-04214]]
2186 The variable decorated with code:FragDepth must: be declared using the
2187 code:Output {StorageClass}
2188 * [[VUID-{refpage}-FragDepth-04215]]
2189 The variable decorated with code:FragDepth must: be declared as a scalar
2190 32-bit floating-point value
2191 * [[VUID-{refpage}-FragDepth-04216]]
2193 code:FragDepth, the code:DepthReplacing {ExecutionMode} must: be
2196 --
2199 [[interfaces-builtin-variables-firstinstancehuawei]]
2201 --
2204 code:FirstInstanceHUAWEI::
2206 The code:FirstInstanceHUAWEI decoration can be used to decorate a cluster
2212 * [[VUID-{refpage}-FirstInstanceHUAWEI-07801]]
2213 The code:FirstInstanceHUAWEI decoration must: be used only within the
2214 code:ClusterCullingHUAWEI {ExecutionModel}
2215 * [[VUID-{refpage}-FirstInstanceHUAWEI-07802]]
2216 The variable decorated with code:FirstInstanceHUAWEI must: be declared
2217 as a scalar 32-bit integer value
2219 --
2224 [[interfaces-builtin-variables-firstvertexhuawei]]
2226 --
2229 code:FirstVertexHUAWEI::
2231 The code:FirstVertexHUAWEI decoration can be used to decorate a cluster
2232 culling shader output variable,this non-indexed mode specific variable will
2238 * [[VUID-{refpage}-FirstVertexHUAWEI-07803]]
2239 The code:FirstVertexHUAWEI decoration must: be used only within the
2240 code:FirstVertexHUAWEI {ExecutionModel}
2241 * [[VUID-{refpage}-FirstVertexHUAWEI-07804]]
2242 The variable decorated with code:FirstVertexHUAWEI must: be declared as
2243 a scalar 32-bit integer value
2245 --
2250 [[interfaces-builtin-variables-fraginvocationcount]]
2252 --
2255 code:FragInvocationCountEXT::
2257 Decorating a variable with the code:FragInvocationCountEXT built-in
2262 If <<primsrast-sampleshading,Sample Shading>> is not enabled,
2263 code:FragInvocationCountEXT will be filled with a value of 1.
2267 * [[VUID-{refpage}-FragInvocationCountEXT-04217]]
2268 The code:FragInvocationCountEXT decoration must: be used only within the
2269 code:Fragment {ExecutionModel}
2270 * [[VUID-{refpage}-FragInvocationCountEXT-04218]]
2271 The variable decorated with code:FragInvocationCountEXT must: be
2272 declared using the code:Input {StorageClass}
2273 * [[VUID-{refpage}-FragInvocationCountEXT-04219]]
2274 The variable decorated with code:FragInvocationCountEXT must: be
2275 declared as a scalar 32-bit integer value
2277 --
2281 [[interfaces-builtin-variables-fragsize]]
2282 [open,refpage='FragSizeEXT',desc='Size of the screen-space area covered by the fragment',type='buil…
2283 --
2286 code:FragSizeEXT::
2288 Decorating a variable with the code:FragSizeEXT built-in decoration will
2290 <<glossary-fragment-area,area>> that the fragment covers for that
2293 If fragment density map is not enabled, code:FragSizeEXT will be filled with
2298 * [[VUID-{refpage}-FragSizeEXT-04220]]
2299 The code:FragSizeEXT decoration must: be used only within the
2300 code:Fragment {ExecutionModel}
2301 * [[VUID-{refpage}-FragSizeEXT-04221]]
2302 The variable decorated with code:FragSizeEXT must: be declared using the
2303 code:Input {StorageClass}
2304 * [[VUID-{refpage}-FragSizeEXT-04222]]
2305 The variable decorated with code:FragSizeEXT must: be declared as a
2306 two-component vector of 32-bit integer values
2308 --
2312 [[interfaces-builtin-variables-fragstencilref]]
2313 [open,refpage='FragStencilRefEXT',desc='Application-specified stencil reference value used in stenc…
2314 --
2317 code:FragStencilRefEXT::
2319 Decorating a variable with the code:FragStencilRefEXT built-in decoration
2325 To write to code:FragStencilRefEXT, a shader must: declare the
2326 code:StencilRefReplacingEXT execution mode.
2327 If a shader declares the code:StencilRefReplacingEXT execution mode and
2329 code:FragStencilRefEXT, then the fragment's stencil reference value is
2333 decorated with code:FragStencilRefEXT are considered for stencil testing,
2337 See <<fragops-shader-stencilrefreplacement, fragment shader stencil
2342 * [[VUID-{refpage}-FragStencilRefEXT-04223]]
2343 The code:FragStencilRefEXT decoration must: be used only within the
2344 code:Fragment {ExecutionModel}
2345 * [[VUID-{refpage}-FragStencilRefEXT-04224]]
2346 The variable decorated with code:FragStencilRefEXT must: be declared
2347 using the code:Output {StorageClass}
2348 * [[VUID-{refpage}-FragStencilRefEXT-04225]]
2349 The variable decorated with code:FragStencilRefEXT must: be declared as
2352 --
2356 [open,refpage='FragmentSizeNV',desc='Size of the screen-space area covered by the fragment',type='b…
2357 --
2360 code:FragmentSizeNV::
2362 Decorating a variable with the code:FragmentSizeNV built-in decoration will
2367 * [[VUID-{refpage}-FragmentSizeNV-04226]]
2368 The code:FragmentSizeNV decoration must: be used only within the
2369 code:Fragment {ExecutionModel}
2370 * [[VUID-{refpage}-FragmentSizeNV-04227]]
2371 The variable decorated with code:FragmentSizeNV must: be declared using
2372 the code:Input {StorageClass}
2373 * [[VUID-{refpage}-FragmentSizeNV-04228]]
2374 The variable decorated with code:FragmentSizeNV must: be declared as a
2375 two-component vector of 32-bit integer values
2377 --
2381 [[interfaces-builtin-variables-frontfacing]]
2383 --
2386 code:FrontFacing::
2388 Decorating a variable with the code:FrontFacing built-in decoration will
2390 This variable is non-zero if the current fragment is considered to be part
2391 of a <<primsrast-polygons-basic,front-facing>> polygon primitive or of a
2392 non-polygon primitive and is zero if the fragment is considered to be part
2393 of a back-facing polygon primitive.
2397 * [[VUID-{refpage}-FrontFacing-04229]]
2398 The code:FrontFacing decoration must: be used only within the
2399 code:Fragment {ExecutionModel}
2400 * [[VUID-{refpage}-FrontFacing-04230]]
2401 The variable decorated with code:FrontFacing must: be declared using the
2402 code:Input {StorageClass}
2403 * [[VUID-{refpage}-FrontFacing-04231]]
2404 The variable decorated with code:FrontFacing must: be declared as a
2407 --
2410 [[interfaces-builtin-variables-fullycoveredext]]
2412 --
2415 code:FullyCoveredEXT::
2417 Decorating a variable with the code:FullyCoveredEXT built-in decoration will
2418 make that variable indicate whether the <<glossary-fragment-area,fragment
2420 This variable is non-zero if conservative rasterization is enabled and the
2427 * [[VUID-{refpage}-FullyCoveredEXT-04232]]
2428 The code:FullyCoveredEXT decoration must: be used only within the
2429 code:Fragment {ExecutionModel}
2430 * [[VUID-{refpage}-FullyCoveredEXT-04233]]
2431 The variable decorated with code:FullyCoveredEXT must: be declared using
2432 the code:Input {StorageClass}
2433 * [[VUID-{refpage}-FullyCoveredEXT-04234]]
2434 The variable decorated with code:FullyCoveredEXT must: be declared as a
2437 * [[VUID-{refpage}-conservativeRasterizationPostDepthCoverage-04235]]
2440 is not supported the code:PostDepthCoverage {ExecutionMode} must: not be
2441 declared, when a variable with the code:FullyCoveredEXT decoration is
2445 --
2448 [[interfaces-builtin-variables-globalinvocationid]]
2450 --
2453 code:GlobalInvocationId::
2455 Decorating a variable with the code:GlobalInvocationId built-in decoration
2459 the size of the local workgroup plus code:LocalInvocationId.
2463 * [[VUID-{refpage}-GlobalInvocationId-04236]]
2464 The code:GlobalInvocationId decoration must: be used only within the
2465 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
2467 * [[VUID-{refpage}-GlobalInvocationId-04237]]
2468 The variable decorated with code:GlobalInvocationId must: be declared
2469 using the code:Input {StorageClass}
2470 * [[VUID-{refpage}-GlobalInvocationId-04238]]
2471 The variable decorated with code:GlobalInvocationId must: be declared as
2472 a three-component vector of 32-bit integer values
2474 --
2476 [[interfaces-builtin-variables-helperinvocation]]
2478 --
2481 code:HelperInvocation::
2483 Decorating a variable with the code:HelperInvocation built-in decoration
2486 This variable is non-zero if the current fragment being shaded is a helper
2495 code:SampleMask fragment shader input value that is zero.
2500 * [[VUID-{refpage}-HelperInvocation-04239]]
2501 The code:HelperInvocation decoration must: be used only within the
2502 code:Fragment {ExecutionModel}
2503 * [[VUID-{refpage}-HelperInvocation-04240]]
2504 The variable decorated with code:HelperInvocation must: be declared
2505 using the code:Input {StorageClass}
2506 * [[VUID-{refpage}-HelperInvocation-04241]]
2507 The variable decorated with code:HelperInvocation must: be declared as a
2510 --
2513 [[interfaces-builtin-variables-hitkind]]
2514 [open,refpage='HitKindKHR',desc='Kind of hit that triggered an any-hit or closest hit ray shader',t…
2515 --
2518 code:HitKindKHR::
2520 A variable decorated with the code:HitKindKHR decoration will describe the
2523 For user-defined intersection shaders this is the value that was passed to
2524 the "`Hit Kind`" operand of code:OpReportIntersectionKHR.
2526 code:HitKindFrontFacingTriangleKHR or code:HitKindBackFacingTriangleKHR.
2530 * [[VUID-{refpage}-HitKindKHR-04242]]
2531 The code:HitKindKHR decoration must: be used only within the
2532 code:AnyHitKHR or code:ClosestHitKHR {ExecutionModel}
2533 * [[VUID-{refpage}-HitKindKHR-04243]]
2534 The variable decorated with code:HitKindKHR must: be declared using the
2535 code:Input {StorageClass}
2536 * [[VUID-{refpage}-HitKindKHR-04244]]
2537 The variable decorated with code:HitKindKHR must: be declared as a
2538 scalar 32-bit integer value
2540 --
2543 [[interfaces-builtin-variables-hitt]]
2545 --
2548 code:HitTNV::
2550 A variable decorated with the code:HitTNV decoration is equivalent to a
2551 variable decorated with the code:RayTmaxKHR decoration.
2555 * [[VUID-{refpage}-HitTNV-04245]]
2556 The code:HitTNV decoration must: be used only within the code:AnyHitNV
2557 or code:ClosestHitNV {ExecutionModel}
2558 * [[VUID-{refpage}-HitTNV-04246]]
2559 The variable decorated with code:HitTNV must: be declared using the
2560 code:Input {StorageClass}
2561 * [[VUID-{refpage}-HitTNV-04247]]
2562 The variable decorated with code:HitTNV must: be declared as a scalar
2563 32-bit floating-point value
2565 --
2569 [[interfaces-builtin-variables-hittrianglevertexpositions]]
2571 --
2574 code:HitTriangleVertexPositionsKHR::
2576 A variable decorated with the code:HitTriangleVertexPositionsKHR decoration
2578 intersection in application-provided order.
2580 performed at standard <<fundamentals-floatingpoint, floating point>>
2586 * [[VUID-{refpage}-HitTriangleVertexPositionsKHR-08747]]
2587 The code:HitTriangleVertexPositionsKHR decoration must: be used only
2588 within the code:AnyHitKHR or code:ClosestHitKHR {ExecutionModel}
2589 * [[VUID-{refpage}-HitTriangleVertexPositionsKHR-08748]]
2590 The variable decorated with code:HitTriangleVertexPositionsKHR must: be
2591 declared using the code:Input {StorageClass}
2592 * [[VUID-{refpage}-HitTriangleVertexPositionsKHR-08749]]
2593 The variable decorated with code:HitTriangleVertexPositionsKHR must: be
2594 declared as an array of three vectors of three 32-bit float values
2595 * [[VUID-{refpage}-HitTriangleVertexPositionsKHR-08750]]
2596 The variable decorated with code:HitTriangleVertexPositionsKHR must: be
2597 used only if the value of code:HitKindKHR is
2598 code:HitKindFrontFacingTriangleKHR or code:HitKindBackFacingTriangleKHR
2599 * [[VUID-{refpage}-None-08751]]
2604 --
2607 [[interfaces-builtin-variables-incomingrayflags]]
2609 --
2612 code:IncomingRayFlagsKHR::
2614 A variable with the code:IncomingRayFlagsKHR decoration will contain the ray
2621 * [[VUID-{refpage}-IncomingRayFlagsKHR-04248]]
2622 The code:IncomingRayFlagsKHR decoration must: be used only within the
2623 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
2624 code:MissKHR {ExecutionModel}
2625 * [[VUID-{refpage}-IncomingRayFlagsKHR-04249]]
2626 The variable decorated with code:IncomingRayFlagsKHR must: be declared
2627 using the code:Input {StorageClass}
2628 * [[VUID-{refpage}-IncomingRayFlagsKHR-04250]]
2629 The variable decorated with code:IncomingRayFlagsKHR must: be declared
2630 as a scalar 32-bit integer value
2632 --
2635 [[interfaces-builtin-variables-indexcounthuawei]]
2637 --
2640 code:IndexCountHUAWEI::
2642 The code:IndexCountHUAWEI decoration can be used to decorate a cluster
2649 * [[VUID-{refpage}-IndexCountHUAWEI-07805]]
2650 The code:IndexCountHUAWEI decoration must: be used only within the
2651 code:ClusterCullingHUAWEI {ExecutionModel}
2652 * [[VUID-{refpage}-IndexCountHUAWEI-07806]]
2653 The variable decorated with code:IndexCountHUAWEI must: be declared as a
2654 scalar 32-bit integer value
2656 --
2660 [[interfaces-builtin-variables-instancecounthuawei]]
2662 --
2665 code:InstanceCountHUAWEI::
2667 The code:InstanceCountHUAWEI decoration can be used to decorate a cluster
2673 * [[VUID-{refpage}-InstanceCountHUAWEI-07807]]
2674 The code:InstanceCountHUAWEI decoration must: be used only within the
2675 code:ClusterCullingHUAWEI {ExecutionModel}
2676 * [[VUID-{refpage}-InstanceCountHUAWEI-07808]]
2677 The variable decorated with code:InstanceCountHUAWEI must: be declared
2678 as a scalar 32-bit integer value
2680 --
2683 [[interfaces-builtin-variables-instancecustomindex]]
2685 --
2688 code:InstanceCustomIndexKHR::
2690 A variable decorated with the code:InstanceCustomIndexKHR decoration will
2691 contain the application-defined value of the instance that intersects the
2700 * [[VUID-{refpage}-InstanceCustomIndexKHR-04251]]
2701 The code:InstanceCustomIndexKHR decoration must: be used only within the
2702 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
2704 * [[VUID-{refpage}-InstanceCustomIndexKHR-04252]]
2705 The variable decorated with code:InstanceCustomIndexKHR must: be
2706 declared using the code:Input {StorageClass}
2707 * [[VUID-{refpage}-InstanceCustomIndexKHR-04253]]
2708 The variable decorated with code:InstanceCustomIndexKHR must: be
2709 declared as a scalar 32-bit integer value
2711 --
2713 [[interfaces-builtin-variables-instanceid]]
2715 --
2718 code:InstanceId::
2720 Decorating a variable in an intersection, any-hit, or closest hit shader
2721 with the code:InstanceId decoration will make that variable contain the
2726 * [[VUID-{refpage}-InstanceId-04254]]
2727 The code:InstanceId decoration must: be used only within the
2728 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
2730 * [[VUID-{refpage}-InstanceId-04255]]
2731 The variable decorated with code:InstanceId must: be declared using the
2732 code:Input {StorageClass}
2733 * [[VUID-{refpage}-InstanceId-04256]]
2734 The variable decorated with code:InstanceId must: be declared as a
2735 scalar 32-bit integer value
2737 --
2740 [[interfaces-builtin-variables-invocationid]]
2742 --
2745 code:InvocationId::
2747 Decorating a variable with the code:InvocationId built-in decoration will
2753 zero to the number of <<geometry-invocations,instances>> declared in the
2756 then code:InvocationId will be zero.
2760 * [[VUID-{refpage}-InvocationId-04257]]
2761 The code:InvocationId decoration must: be used only within the
2762 code:TessellationControl or code:Geometry {ExecutionModel}
2763 * [[VUID-{refpage}-InvocationId-04258]]
2764 The variable decorated with code:InvocationId must: be declared using
2765 the code:Input {StorageClass}
2766 * [[VUID-{refpage}-InvocationId-04259]]
2767 The variable decorated with code:InvocationId must: be declared as a
2768 scalar 32-bit integer value
2770 --
2774 --
2777 code:InvocationsPerPixelNV::
2779 Decorating a variable with the code:InvocationsPerPixelNV built-in
2785 code:InvocationsPerPixelNV.
2787 code:InvocationsPerPixelNV will be one.
2791 * [[VUID-{refpage}-InvocationsPerPixelNV-04260]]
2792 The code:InvocationsPerPixelNV decoration must: be used only within the
2793 code:Fragment {ExecutionModel}
2794 * [[VUID-{refpage}-InvocationsPerPixelNV-04261]]
2795 The variable decorated with code:InvocationsPerPixelNV must: be declared
2796 using the code:Input {StorageClass}
2797 * [[VUID-{refpage}-InvocationsPerPixelNV-04262]]
2798 The variable decorated with code:InvocationsPerPixelNV must: be declared
2799 as a scalar 32-bit integer value
2801 --
2804 [[interfaces-builtin-variables-instanceindex]]
2806 --
2809 code:InstanceIndex::
2811 Decorating a variable in a vertex shader with the code:InstanceIndex
2812 built-in decoration will make that variable contain the index of the
2814 code:InstanceIndex begins at the pname:firstInstance parameter to
2821 * [[VUID-{refpage}-InstanceIndex-04263]]
2822 The code:InstanceIndex decoration must: be used only within the
2823 code:Vertex {ExecutionModel}
2824 * [[VUID-{refpage}-InstanceIndex-04264]]
2825 The variable decorated with code:InstanceIndex must: be declared using
2826 the code:Input {StorageClass}
2827 * [[VUID-{refpage}-InstanceIndex-04265]]
2828 The variable decorated with code:InstanceIndex must: be declared as a
2829 scalar 32-bit integer value
2831 --
2834 [[interfaces-builtin-variables-launchid]]
2836 --
2839 code:LaunchIdKHR::
2841 A variable decorated with the code:LaunchIdKHR decoration will specify the
2846 code:LaunchIdKHR.
2850 * [[VUID-{refpage}-LaunchIdKHR-04266]]
2851 The code:LaunchIdKHR decoration must: be used only within the
2852 code:RayGenerationKHR, code:IntersectionKHR, code:AnyHitKHR,
2853 code:ClosestHitKHR, code:MissKHR, or code:CallableKHR {ExecutionModel}
2854 * [[VUID-{refpage}-LaunchIdKHR-04267]]
2855 The variable decorated with code:LaunchIdKHR must: be declared using the
2856 code:Input {StorageClass}
2857 * [[VUID-{refpage}-LaunchIdKHR-04268]]
2858 The variable decorated with code:LaunchIdKHR must: be declared as a
2859 three-component vector of 32-bit integer values
2861 --
2863 [[interfaces-builtin-variables-launchsize]]
2865 --
2868 code:LaunchSizeKHR::
2870 A variable decorated with the code:LaunchSizeKHR decoration will contain the
2878 * [[VUID-{refpage}-LaunchSizeKHR-04269]]
2879 The code:LaunchSizeKHR decoration must: be used only within the
2880 code:RayGenerationKHR, code:IntersectionKHR, code:AnyHitKHR,
2881 code:ClosestHitKHR, code:MissKHR, or code:CallableKHR {ExecutionModel}
2882 * [[VUID-{refpage}-LaunchSizeKHR-04270]]
2883 The variable decorated with code:LaunchSizeKHR must: be declared using
2884 the code:Input {StorageClass}
2885 * [[VUID-{refpage}-LaunchSizeKHR-04271]]
2886 The variable decorated with code:LaunchSizeKHR must: be declared as a
2887 three-component vector of 32-bit integer values
2889 --
2892 [[interfaces-builtin-variables-layer]]
2894 --
2897 code:Layer::
2900 ----
2901 Decorating a variable with the code:Layer built-in decoration will make that
2902 variable contain the select layer of a multi-layer framebuffer attachment.
2909 geometry shader, any variable decorated with code:Layer can be written with
2915 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2916 stage>> (in pipeline order) controls the code:Layer that is used.
2918 to write the code:Layer.
2922 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2924 with code:Layer, then the first layer is used.
2925 If a <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
2927 code:Layer, it must: write the same value to code:Layer for all output
2929 If the code:Layer value is less than 0 or greater than or equal to the
2934 In a mesh shader this also applies when the code:Layer value is greater than
2939 If a variable with the code:Layer decoration is also decorated with
2940 code:ViewportRelativeNV, then the code:ViewportIndex is added to the layer
2944 If the shader writes to a variable decorated code:ViewportMaskNV, then the
2949 In a fragment shader, a variable decorated with code:Layer contains the
2951 ----
2955 * [[VUID-{refpage}-Layer-04272]]
2956 The code:Layer decoration must: be used only within the code:MeshEXT,
2957 code:MeshNV, code:Vertex, code:TessellationEvaluation, code:Geometry, or
2958 code:Fragment {ExecutionModel}
2960 * [[VUID-{refpage}-Layer-04273]]
2961 If the <<features-shaderOutputLayer, pname:shaderOutputLayer>> feature
2962 is not enabled then the code:Layer decoration must: be used only within
2963 the code:Geometry or code:Fragment {ExecutionModel}
2965 * [[VUID-{refpage}-Layer-04274]]
2966 The variable decorated with code:Layer within the code:MeshEXT,
2967 code:MeshNV, code:Vertex, code:TessellationEvaluation, or code:Geometry
2968 {ExecutionModel} must: be declared using the code:Output {StorageClass}
2969 * [[VUID-{refpage}-Layer-04275]]
2970 The variable decorated with code:Layer within the code:Fragment
2971 {ExecutionModel} must: be declared using the code:Input {StorageClass}
2972 * [[VUID-{refpage}-Layer-04276]]
2973 The variable decorated with code:Layer must: be declared as a scalar
2974 32-bit integer value
2975 * [[VUID-{refpage}-Layer-07039]]
2976 The variable decorated with code:Layer within the code:MeshEXT
2977 {ExecutionModel} must: also be decorated with the code:PerPrimitiveEXT
2980 --
2983 [[interfaces-builtin-variables-layerpv]]
2985 --
2988 code:LayerPerViewNV::
2990 Decorating a variable with the code:LayerPerViewNV built-in decoration will
2991 make that variable contain the per-view layer information.
2992 The per-view layer has the same semantics as code:Layer, for each view.
2996 * [[VUID-{refpage}-LayerPerViewNV-04277]]
2997 The code:LayerPerViewNV decoration must: be used only within the
2998 code:MeshNV {ExecutionModel}
2999 * [[VUID-{refpage}-LayerPerViewNV-04278]]
3000 The variable decorated with code:LayerPerViewNV must: be declared using
3001 the code:Output {StorageClass}
3002 * [[VUID-{refpage}-LayerPerViewNV-04279]]
3003 The variable decorated with code:LayerPerViewNV must: also be decorated
3004 with the code:PerViewNV decoration
3005 * [[VUID-{refpage}-LayerPerViewNV-04280]]
3006 The variable decorated with code:LayerPerViewNV must: be declared as an
3007 array of scalar 32-bit integer values
3009 --
3012 [[interfaces-builtin-variables-localinvocationid]]
3014 --
3017 code:LocalInvocationId::
3019 Decorating a variable with the code:LocalInvocationId built-in decoration
3031 code:LocalInvocationId in that dimension will be zero.
3032 If the workgroup is effectively two-dimensional, then
3033 code:LocalInvocationId.z will be zero.
3034 If the workgroup is effectively one-dimensional, then both
3035 code:LocalInvocationId.y and code:LocalInvocationId.z will be zero.
3040 * [[VUID-{refpage}-LocalInvocationId-04281]]
3041 The code:LocalInvocationId decoration must: be used only within the
3042 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
3044 * [[VUID-{refpage}-LocalInvocationId-04282]]
3045 The variable decorated with code:LocalInvocationId must: be declared
3046 using the code:Input {StorageClass}
3047 * [[VUID-{refpage}-LocalInvocationId-04283]]
3048 The variable decorated with code:LocalInvocationId must: be declared as
3049 a three-component vector of 32-bit integer values
3051 --
3053 [[interfaces-builtin-variables-localinvocationindex]]
3055 --
3058 code:LocalInvocationIndex::
3060 Decorating a variable with the code:LocalInvocationIndex built-in decoration
3061 will make that variable contain a one-dimensional representation of
3062 code:LocalInvocationId.
3066 ----
3071 ----
3075 * [[VUID-{refpage}-LocalInvocationIndex-04284]]
3076 The code:LocalInvocationIndex decoration must: be used only within the
3077 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
3079 * [[VUID-{refpage}-LocalInvocationIndex-04285]]
3080 The variable decorated with code:LocalInvocationIndex must: be declared
3081 using the code:Input {StorageClass}
3082 * [[VUID-{refpage}-LocalInvocationIndex-04286]]
3083 The variable decorated with code:LocalInvocationIndex must: be declared
3084 as a scalar 32-bit integer value
3086 --
3089 [[interfaces-builtin-variables-meshviewcount]]
3091 --
3094 code:MeshViewCountNV::
3096 Decorating a variable with the code:MeshViewCountNV built-in decoration will
3102 * [[VUID-{refpage}-MeshViewCountNV-04287]]
3103 The code:MeshViewCountNV decoration must: be used only within the
3104 code:MeshNV or code:TaskNV {ExecutionModel}
3105 * [[VUID-{refpage}-MeshViewCountNV-04288]]
3106 The variable decorated with code:MeshViewCountNV must: be declared using
3107 the code:Input {StorageClass}
3108 * [[VUID-{refpage}-MeshViewCountNV-04289]]
3109 The variable decorated with code:MeshViewCountNV must: be declared as a
3110 scalar 32-bit integer value
3112 --
3114 [[interfaces-builtin-variables-meshviewindices]]
3116 --
3119 code:MeshViewIndicesNV::
3121 Decorating a variable with the code:MeshViewIndicesNV built-in decoration
3127 code:MeshViewCountNV are undefined:.
3128 If the value of code:MeshViewIndicesNV[i] is [eq]#j#, then any outputs
3129 decorated with code:PerViewNV will take on the value of array element
3134 * [[VUID-{refpage}-MeshViewIndicesNV-04290]]
3135 The code:MeshViewIndicesNV decoration must: be used only within the
3136 code:MeshNV or code:TaskNV {ExecutionModel}
3137 * [[VUID-{refpage}-MeshViewIndicesNV-04291]]
3138 The variable decorated with code:MeshViewIndicesNV must: be declared
3139 using the code:Input {StorageClass}
3140 * [[VUID-{refpage}-MeshViewIndicesNV-04292]]
3141 The variable decorated with code:MeshViewIndicesNV must: be declared as
3142 an array of scalar 32-bit integer values
3144 --
3148 [[interfaces-builtin-variables-numsubgroups]]
3150 --
3153 code:NumSubgroups::
3155 Decorating a variable with the code:NumSubgroups built-in decoration will
3160 * [[VUID-{refpage}-NumSubgroups-04293]]
3161 The code:NumSubgroups decoration must: be used only within the
3162 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
3164 * [[VUID-{refpage}-NumSubgroups-04294]]
3165 The variable decorated with code:NumSubgroups must: be declared using
3166 the code:Input {StorageClass}
3167 * [[VUID-{refpage}-NumSubgroups-04295]]
3168 The variable decorated with code:NumSubgroups must: be declared as a
3169 scalar 32-bit integer value
3171 --
3174 [[interfaces-builtin-variables-numworkgroups]]
3176 --
3179 code:NumWorkgroups::
3181 Decorating a variable with the code:NumWorkgroups built-in decoration will
3189 * [[VUID-{refpage}-NumWorkgroups-04296]]
3190 The code:NumWorkgroups decoration must: be used only within the
3191 code:GLCompute, code:MeshEXT, or code:TaskEXT {ExecutionModel}
3192 * [[VUID-{refpage}-NumWorkgroups-04297]]
3193 The variable decorated with code:NumWorkgroups must: be declared using
3194 the code:Input {StorageClass}
3195 * [[VUID-{refpage}-NumWorkgroups-04298]]
3196 The variable decorated with code:NumWorkgroups must: be declared as a
3197 three-component vector of 32-bit integer values
3199 --
3202 [[interfaces-builtin-variables-objectraydirection]]
3204 --
3207 code:ObjectRayDirectionKHR::
3209 A variable decorated with the code:ObjectRayDirectionKHR decoration will
3214 * [[VUID-{refpage}-ObjectRayDirectionKHR-04299]]
3215 The code:ObjectRayDirectionKHR decoration must: be used only within the
3216 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
3218 * [[VUID-{refpage}-ObjectRayDirectionKHR-04300]]
3219 The variable decorated with code:ObjectRayDirectionKHR must: be declared
3220 using the code:Input {StorageClass}
3221 * [[VUID-{refpage}-ObjectRayDirectionKHR-04301]]
3222 The variable decorated with code:ObjectRayDirectionKHR must: be declared
3223 as a three-component vector of 32-bit floating-point values
3225 --
3227 [[interfaces-builtin-variables-objectrayorigin]]
3229 --
3232 code:ObjectRayOriginKHR::
3234 A variable decorated with the code:ObjectRayOriginKHR decoration will
3239 * [[VUID-{refpage}-ObjectRayOriginKHR-04302]]
3240 The code:ObjectRayOriginKHR decoration must: be used only within the
3241 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
3243 * [[VUID-{refpage}-ObjectRayOriginKHR-04303]]
3244 The variable decorated with code:ObjectRayOriginKHR must: be declared
3245 using the code:Input {StorageClass}
3246 * [[VUID-{refpage}-ObjectRayOriginKHR-04304]]
3247 The variable decorated with code:ObjectRayOriginKHR must: be declared as
3248 a three-component vector of 32-bit floating-point values
3250 --
3252 [[interfaces-builtin-variables-objecttoworld]]
3254 --
3257 code:ObjectToWorldKHR::
3259 A variable decorated with the code:ObjectToWorldKHR decoration will contain
3260 the current object-to-world transformation matrix, which is determined by
3265 * [[VUID-{refpage}-ObjectToWorldKHR-04305]]
3266 The code:ObjectToWorldKHR decoration must: be used only within the
3267 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
3269 * [[VUID-{refpage}-ObjectToWorldKHR-04306]]
3270 The variable decorated with code:ObjectToWorldKHR must: be declared
3271 using the code:Input {StorageClass}
3272 * [[VUID-{refpage}-ObjectToWorldKHR-04307]]
3273 The variable decorated with code:ObjectToWorldKHR must: be declared as a
3274 matrix with four columns of three-component vectors of 32-bit
3275 floating-point values
3277 --
3280 [[interfaces-builtin-variables-patchvertices]]
3282 --
3285 code:PatchVertices::
3287 Decorating a variable with the code:PatchVertices built-in decoration will
3293 In a Tessellation Evaluation Shader, code:PatchVertices is equal to the
3296 are configured differently, the value of the code:PatchVertices variable
3301 * [[VUID-{refpage}-PatchVertices-04308]]
3302 The code:PatchVertices decoration must: be used only within the
3303 code:TessellationControl or code:TessellationEvaluation {ExecutionModel}
3304 * [[VUID-{refpage}-PatchVertices-04309]]
3305 The variable decorated with code:PatchVertices must: be declared using
3306 the code:Input {StorageClass}
3307 * [[VUID-{refpage}-PatchVertices-04310]]
3308 The variable decorated with code:PatchVertices must: be declared as a
3309 scalar 32-bit integer value
3311 --
3313 [[interfaces-builtin-variables-pointcoord]]
3314 [open,refpage='PointCoord',desc='Fragment coordinates in screen-space within a point primitive',typ…
3315 --
3318 code:PointCoord::
3320 Decorating a variable with the code:PointCoord built-in decoration will make
3324 <<primsrast-points-basic,Basic Point Rasterization>>.
3326 then the variable decorated with code:PointCoord contains an undefined:
3332 Depending on how the point is rasterized, code:PointCoord may: never reach
3338 * [[VUID-{refpage}-PointCoord-04311]]
3339 The code:PointCoord decoration must: be used only within the
3340 code:Fragment {ExecutionModel}
3341 * [[VUID-{refpage}-PointCoord-04312]]
3342 The variable decorated with code:PointCoord must: be declared using the
3343 code:Input {StorageClass}
3344 * [[VUID-{refpage}-PointCoord-04313]]
3345 The variable decorated with code:PointCoord must: be declared as a
3346 two-component vector of 32-bit floating-point values
3348 --
3350 [[interfaces-builtin-variables-pointsize]]
3352 --
3355 code:PointSize::
3357 Decorating a variable with the code:PointSize built-in decoration will make
3360 or the final rasterization of polygons if <<primsrast-polygonmode, polygon
3366 The value written to the variable decorated with code:PointSize by the last
3367 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3368 stage>> in the pipeline is used as the framebuffer-space size of points
3371 If <<features-maintenance5, pname:maintenance5>> is enabled and a value is
3372 not written to a variable decorated with code:PointSize, a value of 1.0 is
3379 When code:PointSize decorates a variable in the code:Input {StorageClass},
3381 code:PointSize from the previous shader stage.
3386 * [[VUID-{refpage}-PointSize-04314]]
3387 The code:PointSize decoration must: be used only within the
3388 code:MeshEXT, code:MeshNV, code:Vertex, code:TessellationControl,
3389 code:TessellationEvaluation, or code:Geometry {ExecutionModel}
3390 * [[VUID-{refpage}-PointSize-04315]]
3391 The variable decorated with code:PointSize within the code:MeshEXT,
3392 code:MeshNV, or code:Vertex {ExecutionModel} must: be declared using the
3393 code:Output {StorageClass}
3394 * [[VUID-{refpage}-PointSize-04316]]
3395 The variable decorated with code:PointSize within the
3396 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
3398 code:Input or code:Output
3399 * [[VUID-{refpage}-PointSize-04317]]
3400 The variable decorated with code:PointSize must: be declared as a scalar
3401 32-bit floating-point value
3403 --
3405 [[interfaces-builtin-variables-position]]
3407 --
3410 code:Position::
3412 Decorating a variable with the code:Position built-in decoration will make
3414 In the last <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization
3415 shader stage>>, the value of the variable decorated with code:Position is
3422 When code:Position decorates a variable in the code:Input {StorageClass}, it
3424 code:Position from the previous shader stage.
3429 * [[VUID-{refpage}-Position-04318]]
3430 The code:Position decoration must: be used only within the code:MeshEXT,
3431 code:MeshNV, code:Vertex, code:TessellationControl,
3432 code:TessellationEvaluation, or code:Geometry {ExecutionModel}
3433 * [[VUID-{refpage}-Position-04319]]
3434 The variable decorated with code:Position within the code:MeshEXT,
3435 code:MeshNV, or code:Vertex {ExecutionModel} must: be declared using the
3436 code:Output {StorageClass}
3437 * [[VUID-{refpage}-Position-04320]]
3438 The variable decorated with code:Position within the
3439 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
3441 code:Input or code:Output
3442 * [[VUID-{refpage}-Position-04321]]
3443 The variable decorated with code:Position must: be declared as a
3444 four-component vector of 32-bit floating-point values
3446 --
3449 [[interfaces-builtin-variables-positionperview]]
3451 --
3454 code:PositionPerViewNV::
3456 Decorating a variable with the code:PositionPerViewNV built-in decoration
3464 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3466 code:PositionPerViewNV are used in subsequent primitive assembly, clipping,
3467 and rasterization operations, as with code:Position.
3468 code:PositionPerViewNV output in an earlier
3469 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3471 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3478 If the values do differ, one will be chosen in an implementation-dependent
3483 * [[VUID-{refpage}-PositionPerViewNV-04322]]
3484 The code:PositionPerViewNV decoration must: be used only within the
3485 code:MeshNV, code:Vertex, code:TessellationControl,
3486 code:TessellationEvaluation, or code:Geometry {ExecutionModel}
3487 * [[VUID-{refpage}-PositionPerViewNV-04323]]
3488 The variable decorated with code:PositionPerViewNV within the
3489 code:Vertex, or code:MeshNV {ExecutionModel} must: be declared using the
3490 code:Output {StorageClass}
3491 * [[VUID-{refpage}-PositionPerViewNV-04324]]
3492 The variable decorated with code:PositionPerViewNV within the
3493 code:TessellationControl, code:TessellationEvaluation, or code:Geometry
3495 code:Input or code:Output
3496 * [[VUID-{refpage}-PositionPerViewNV-04325]]
3497 The variable decorated with code:PositionPerViewNV must: be declared as
3498 an array of four-component vector of 32-bit floating-point values with
3501 * [[VUID-{refpage}-PositionPerViewNV-04326]]
3502 The array variable decorated with code:PositionPerViewNV must: only be
3505 --
3509 [[interfaces-builtin-variables-primitivecount]]
3511 --
3514 code:PrimitiveCountNV::
3516 Decorating a variable with the code:PrimitiveCountNV decoration will make
3524 * [[VUID-{refpage}-PrimitiveCountNV-04327]]
3525 The code:PrimitiveCountNV decoration must: be used only within the
3526 code:MeshNV {ExecutionModel}
3527 * [[VUID-{refpage}-PrimitiveCountNV-04328]]
3528 The variable decorated with code:PrimitiveCountNV must: be declared
3529 using the code:Output {StorageClass}
3530 * [[VUID-{refpage}-PrimitiveCountNV-04329]]
3531 The variable decorated with code:PrimitiveCountNV must: be declared as a
3532 scalar 32-bit integer value
3534 --
3537 [[interfaces-builtin-variables-primitiveid]]
3539 --
3542 code:PrimitiveId::
3544 Decorating a variable with the code:PrimitiveId built-in decoration will
3551 For triangles drawn as points or line segments (see <<primsrast-polygonmode,
3555 Variables decorated with code:PrimitiveId are reset to zero between each
3559 value of variables decorated with code:PrimitiveId.
3579 In an intersection, any-hit, or closest hit shader, it will contain the
3586 When the code:PrimitiveId decoration is applied to an output variable in the
3588 geometry shader, the resulting value is seen through the code:PrimitiveId
3591 The fragment shader using code:PrimitiveId will need to declare either the
3592 ifdef::VK_NV_mesh_shader[code:MeshShadingNV,]
3593 ifdef::VK_EXT_mesh_shader[code:MeshShadingEXT,]
3594 code:Geometry or code:Tessellation capability to satisfy the requirement
3595 SPIR-V has to use code:PrimitiveId.
3600 * [[VUID-{refpage}-PrimitiveId-04330]]
3601 The code:PrimitiveId decoration must: be used only within the
3602 code:MeshEXT, code:MeshNV, code:IntersectionKHR, code:AnyHitKHR,
3603 code:ClosestHitKHR, code:TessellationControl,
3604 code:TessellationEvaluation, code:Geometry, or code:Fragment
3606 * [[VUID-{refpage}-Fragment-04331]]
3607 If pipeline contains both the code:Fragment and code:Geometry
3608 {ExecutionModel} and a variable decorated with code:PrimitiveId is read
3609 from code:Fragment shader, then the code:Geometry shader must: write to
3610 the output variables decorated with code:PrimitiveId in all execution
3612 * [[VUID-{refpage}-Fragment-04332]]
3613 If pipeline contains both the code:Fragment and code:MeshEXT or
3614 code:MeshNV {ExecutionModel} and a variable decorated with
3615 code:PrimitiveId is read from code:Fragment shader, then the
3616 code:MeshEXT or code:MeshNV shader must: write to the output variables
3617 decorated with code:PrimitiveId in all execution paths
3618 * [[VUID-{refpage}-Fragment-04333]]
3619 If code:Fragment {ExecutionModel} contains a variable decorated with
3620 code:PrimitiveId, then either the code:MeshShadingEXT,
3621 code:MeshShadingNV, code:Geometry or code:Tessellation capability must:
3623 * [[VUID-{refpage}-PrimitiveId-04334]]
3624 The variable decorated with code:PrimitiveId within the
3625 code:TessellationControl, code:TessellationEvaluation, code:Fragment,
3626 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
3627 {ExecutionModel} must: be declared using the code:Input {StorageClass}
3628 * [[VUID-{refpage}-PrimitiveId-04335]]
3629 The variable decorated with code:PrimitiveId within the code:Geometry
3630 {ExecutionModel} must: be declared using the code:Input or code:Output
3632 * [[VUID-{refpage}-PrimitiveId-04336]]
3633 The variable decorated with code:PrimitiveId within the code:MeshEXT or
3634 code:MeshNV {ExecutionModel} must: be declared using the code:Output
3636 * [[VUID-{refpage}-PrimitiveId-04337]]
3637 The variable decorated with code:PrimitiveId must: be declared as a
3638 scalar 32-bit integer value
3639 * [[VUID-{refpage}-PrimitiveId-07040]]
3640 The variable decorated with code:PrimitiveId within the code:MeshEXT
3641 {ExecutionModel} must: also be decorated with the code:PerPrimitiveEXT
3644 --
3647 [[interfaces-builtin-variables-primitiveindices]]
3649 --
3652 code:PrimitiveIndicesNV::
3654 Decorating a variable with the code:PrimitiveIndicesNV decoration will make
3657 the indices are split into groups of one (code:OutputPoints), two
3658 (code:OutputLinesNV), or three (code:OutputTrianglesNV) indices and each
3663 * [[VUID-{refpage}-PrimitiveIndicesNV-04338]]
3664 The code:PrimitiveIndicesNV decoration must: be used only within the
3665 code:MeshNV {ExecutionModel}
3666 * [[VUID-{refpage}-PrimitiveIndicesNV-04339]]
3667 The variable decorated with code:PrimitiveIndicesNV must: be declared
3668 using the code:Output {StorageClass}
3669 * [[VUID-{refpage}-PrimitiveIndicesNV-04340]]
3670 The variable decorated with code:PrimitiveIndicesNV must: be declared as
3671 an array of scalar 32-bit integer values
3672 * [[VUID-{refpage}-PrimitiveIndicesNV-04341]]
3673 All index values of the array decorated with code:PrimitiveIndicesNV
3674 must: be in the range [eq]#[0, N-1]#, where [eq]#N# is the value
3675 specified by the code:OutputVertices {ExecutionMode}
3676 * [[VUID-{refpage}-OutputPoints-04342]]
3677 If the {ExecutionMode} is code:OutputPoints, then the array decorated
3678 with code:PrimitiveIndicesNV must: be the size of the value specified by
3679 code:OutputPrimitivesNV
3680 * [[VUID-{refpage}-OutputLinesNV-04343]]
3681 If the {ExecutionMode} is code:OutputLinesNV, then the array decorated
3682 with code:PrimitiveIndicesNV must: be the size of two times the value
3683 specified by code:OutputPrimitivesNV
3684 * [[VUID-{refpage}-OutputTrianglesNV-04344]]
3685 If the {ExecutionMode} is code:OutputTrianglesNV, then the array
3686 decorated with code:PrimitiveIndicesNV must: be the size of three times
3687 the value specified by code:OutputPrimitivesNV
3689 --
3693 [[interfaces-builtin-variables-primitivepointindices]]
3695 --
3698 code:PrimitivePointIndicesEXT::
3700 Decorating a variable with the code:PrimitivePointIndicesEXT decoration will
3706 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07041]]
3707 The code:PrimitivePointIndicesEXT decoration must: be used only within
3708 the code:MeshEXT {ExecutionModel}
3709 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07042]]
3710 The code:PrimitivePointIndicesEXT decoration must: be used with the
3711 code:OutputPoints {ExecutionMode}
3712 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07043]]
3713 The variable decorated with code:PrimitivePointIndicesEXT must: be
3714 declared using the code:Output {StorageClass}
3715 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07044]]
3716 The variable decorated with code:PrimitivePointIndicesEXT must: be
3717 declared as an array of scalar 32-bit integer values
3718 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07045]]
3720 code:PrimitivePointIndicesEXT must: be in the range [eq]#[0, N-1]#,
3721 where [eq]#N# is the value specified by the code:OutputVertices
3723 * [[VUID-{refpage}-PrimitivePointIndicesEXT-07046]]
3724 The size of the array decorated with code:PrimitivePointIndicesEXT must:
3725 match the value specified by code:OutputPrimitivesEXT
3727 --
3729 [[interfaces-builtin-variables-primitivelineindices]]
3731 --
3734 code:PrimitiveLineIndicesEXT::
3736 Decorating a variable with the code:PrimitiveLineIndicesEXT decoration will
3742 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07047]]
3743 The code:PrimitiveLineIndicesEXT decoration must: be used only within
3744 the code:MeshEXT {ExecutionModel}
3745 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07048]]
3746 The code:PrimitiveLineIndicesEXT decoration must: be used with the
3747 code:OutputLinesEXT {ExecutionMode}
3748 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07049]]
3749 The variable decorated with code:PrimitiveLineIndicesEXT must: be
3750 declared using the code:Output {StorageClass}
3751 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07050]]
3752 The variable decorated with code:PrimitiveLineIndicesEXT must: be
3753 declared as an array of two component vector 32-bit integer values
3754 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07051]]
3756 code:PrimitiveLineIndicesEXT must: be in the range [eq]#[0, N-1]#, where
3757 [eq]#N# is the value specified by the code:OutputVertices
3759 * [[VUID-{refpage}-PrimitiveLineIndicesEXT-07052]]
3760 The size of the array decorated with code:PrimitiveLineIndicesEXT must:
3761 match the value specified by code:OutputPrimitivesEXT
3763 --
3765 [[interfaces-builtin-variables-primitivetriangleindices]]
3767 --
3770 code:PrimitiveTriangleIndicesEXT::
3772 Decorating a variable with the code:PrimitiveTriangleIndicesEXT decoration
3778 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07053]]
3779 The code:PrimitiveTriangleIndicesEXT decoration must: be used only
3780 within the code:MeshEXT {ExecutionModel}
3781 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07054]]
3782 The code:PrimitiveTriangleIndicesEXT decoration must: be used with the
3783 code:OutputTrianglesEXT {ExecutionMode}
3784 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07055]]
3785 The variable decorated with code:PrimitiveTriangleIndicesEXT must: be
3786 declared using the code:Output {StorageClass}
3787 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07056]]
3788 The variable decorated with code:PrimitiveTriangleIndicesEXT must: be
3789 declared as an array of three component vector 32-bit integer values
3790 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07057]]
3792 code:PrimitiveTriangleIndicesEXT must: be in the range [eq]#[0, N-1]#,
3793 where [eq]#N# is the value specified by the code:OutputVertices
3795 * [[VUID-{refpage}-PrimitiveTriangleIndicesEXT-07058]]
3796 The size of the array decorated with code:PrimitiveTriangleIndicesEXT
3797 must: match the value specified by code:OutputPrimitivesEXT
3799 --
3803 [[interfaces-builtin-variables-primitiveshadingrate]]
3805 --
3808 code:PrimitiveShadingRateKHR::
3810 Decorating a variable with the code:PrimitiveShadingRateKHR built-in
3812 <<primsrast-fragment-shading-rate-primitive, primitive fragment shading
3816 code:PrimitiveShadingRateKHR by the last
3817 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3819 <<primsrast-fragment-shading-rate-primitive, primitive fragment shading
3824 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
3826 with code:PrimitiveShadingRateKHR, then it is as if the shader specified a
3830 If a shader has code:PrimitiveShadingRateKHR in the output interface and
3836 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04484]]
3837 The code:PrimitiveShadingRateKHR decoration must: be used only within
3838 the code:MeshEXT, code:MeshNV, code:Vertex, or code:Geometry
3840 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04485]]
3841 The variable decorated with code:PrimitiveShadingRateKHR must: be
3842 declared using the code:Output {StorageClass}
3843 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04486]]
3844 The variable decorated with code:PrimitiveShadingRateKHR must: be
3845 declared as a scalar 32-bit integer value
3846 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04487]]
3847 The value written to code:PrimitiveShadingRateKHR must: include no more
3848 than one of code:Vertical2Pixels and code:Vertical4Pixels
3849 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04488]]
3850 The value written to code:PrimitiveShadingRateKHR must: include no more
3851 than one of code:Horizontal2Pixels and code:Horizontal4Pixels
3852 * [[VUID-{refpage}-PrimitiveShadingRateKHR-04489]]
3853 The value written to code:PrimitiveShadingRateKHR must: not have any
3855 enumerants in the SPIR-V specification
3856 * [[VUID-{refpage}-PrimitiveShadingRateKHR-07059]]
3857 The variable decorated with code:PrimitiveShadingRateKHR within the
3858 code:MeshEXT {ExecutionModel} must: also be decorated with the
3859 code:PerPrimitiveEXT decoration
3861 --
3865 [[interfaces-builtin-variables-raygeometryindex]]
3867 --
3870 code:RayGeometryIndexKHR::
3872 A variable decorated with the code:RayGeometryIndexKHR decoration will
3873 contain the <<acceleration-structure-geometry-index, geometry index>> for
3878 * [[VUID-{refpage}-RayGeometryIndexKHR-04345]]
3879 The code:RayGeometryIndexKHR decoration must: be used only within the
3880 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
3882 * [[VUID-{refpage}-RayGeometryIndexKHR-04346]]
3883 The variable decorated with code:RayGeometryIndexKHR must: be declared
3884 using the code:Input {StorageClass}
3885 * [[VUID-{refpage}-RayGeometryIndexKHR-04347]]
3886 The variable decorated with code:RayGeometryIndexKHR must: be declared
3887 as a scalar 32-bit integer value
3889 --
3893 [[interfaces-builtin-variables-raytmax]]
3895 --
3898 code:RayTmaxKHR::
3900 A variable decorated with the code:RayTmaxKHR decoration will contain the
3905 <<glossary-pipeline-trace-ray, pipeline trace ray>> instruction.
3911 In the any-hit shader, it reflects the distance to the primitive currently
3916 code:OpReportIntersectionKHR if the corresponding any-hit shader does not
3919 <<glossary-pipeline-trace-ray, pipeline trace ray>> instruction.
3923 * [[VUID-{refpage}-RayTmaxKHR-04348]]
3924 The code:RayTmaxKHR decoration must: be used only within the
3925 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
3926 code:MissKHR {ExecutionModel}
3927 * [[VUID-{refpage}-RayTmaxKHR-04349]]
3928 The variable decorated with code:RayTmaxKHR must: be declared using the
3929 code:Input {StorageClass}
3930 * [[VUID-{refpage}-RayTmaxKHR-04350]]
3931 The variable decorated with code:RayTmaxKHR must: be declared as a
3932 scalar 32-bit floating-point value
3934 --
3936 [[interfaces-builtin-variables-raytmin]]
3938 --
3941 code:RayTminKHR::
3943 A variable decorated with the code:RayTminKHR decoration will contain the
3947 The value is the parameter passed into the <<glossary-pipeline-trace-ray,
3954 * [[VUID-{refpage}-RayTminKHR-04351]]
3955 The code:RayTminKHR decoration must: be used only within the
3956 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
3957 code:MissKHR {ExecutionModel}
3958 * [[VUID-{refpage}-RayTminKHR-04352]]
3959 The variable decorated with code:RayTminKHR must: be declared using the
3960 code:Input {StorageClass}
3961 * [[VUID-{refpage}-RayTminKHR-04353]]
3962 The variable decorated with code:RayTminKHR must: be declared as a
3963 scalar 32-bit floating-point value
3965 --
3968 [[interfaces-builtin-variables-sampleid]]
3970 --
3973 code:SampleId::
3975 Decorating a variable with the code:SampleId built-in decoration will make
3976 that variable contain the <<primsrast-multisampling-coverage-mask, coverage
3978 code:SampleId ranges from zero to the number of samples in the framebuffer
3981 decorated with code:SampleId, <<primsrast-sampleshading,Sample Shading>> is
3986 * [[VUID-{refpage}-SampleId-04354]]
3987 The code:SampleId decoration must: be used only within the code:Fragment
3989 * [[VUID-{refpage}-SampleId-04355]]
3990 The variable decorated with code:SampleId must: be declared using the
3991 code:Input {StorageClass}
3992 * [[VUID-{refpage}-SampleId-04356]]
3993 The variable decorated with code:SampleId must: be declared as a scalar
3994 32-bit integer value
3996 --
3998 [[interfaces-builtin-variables-samplemask]]
4000 --
4003 code:SampleMask::
4005 Decorating a variable with the code:SampleMask built-in decoration will make
4006 any variable contain the <<fragops-shader-samplemask, sample mask>> for the
4009 A variable in the code:Input storage class decorated with code:SampleMask
4014 code:SampleMask[] is an array of integers.
4018 A variable in the code:Output storage class decorated with code:SampleMask
4020 variable decorated with code:SampleMask, but where each bit represents
4022 This computed code:SampleMask is combined with the generated coverage mask
4023 in the <<fragops-covg, multisample coverage>> operation.
4025 Variables decorated with code:SampleMask must: be either an unsized array,
4026 or explicitly sized to be no larger than the implementation-dependent
4027 maximum sample-mask (as an array of 32-bit elements), determined by the
4031 decorated with code:SampleMask, the sample mask will be undefined: for any
4035 variable decorated with code:SampleMask, the sample mask has no effect on
4040 * [[VUID-{refpage}-SampleMask-04357]]
4041 The code:SampleMask decoration must: be used only within the
4042 code:Fragment {ExecutionModel}
4043 * [[VUID-{refpage}-SampleMask-04358]]
4044 The variable decorated with code:SampleMask must: be declared using the
4045 code:Input or code:Output {StorageClass}
4046 * [[VUID-{refpage}-SampleMask-04359]]
4047 The variable decorated with code:SampleMask must: be declared as an
4048 array of 32-bit integer values
4050 --
4052 [[interfaces-builtin-variables-sampleposition]]
4054 --
4057 code:SamplePosition::
4059 Decorating a variable with the code:SamplePosition built-in decoration will
4060 make that variable contain the sub-pixel position of the sample being
4069 instead contain the sub-fragment position of the sample being shaded.
4076 decorated with code:SamplePosition, <<primsrast-sampleshading,Sample
4080 If the current pipeline uses <<primsrast-samplelocations, custom sample
4081 locations>> the value of any variable decorated with the code:SamplePosition
4082 built-in decoration is undefined:.
4087 * [[VUID-{refpage}-SamplePosition-04360]]
4088 The code:SamplePosition decoration must: be used only within the
4089 code:Fragment {ExecutionModel}
4090 * [[VUID-{refpage}-SamplePosition-04361]]
4091 The variable decorated with code:SamplePosition must: be declared using
4092 the code:Input {StorageClass}
4093 * [[VUID-{refpage}-SamplePosition-04362]]
4094 The variable decorated with code:SamplePosition must: be declared as a
4095 two-component vector of 32-bit floating-point values
4097 --
4100 [[interfaces-builtin-variables-shadingratekhr]]
4102 --
4105 code:ShadingRateKHR::
4107 Decorating a variable with the code:ShadingRateKHR built-in decoration will
4108 make that variable contain the <<primsrast-fragment-shading-rate, fragment
4113 * [[VUID-{refpage}-ShadingRateKHR-04490]]
4114 The code:ShadingRateKHR decoration must: be used only within the
4115 code:Fragment {ExecutionModel}
4116 * [[VUID-{refpage}-ShadingRateKHR-04491]]
4117 The variable decorated with code:ShadingRateKHR must: be declared using
4118 the code:Input {StorageClass}
4119 * [[VUID-{refpage}-ShadingRateKHR-04492]]
4120 The variable decorated with code:ShadingRateKHR must: be declared as a
4121 scalar 32-bit integer value
4123 --
4127 [[interfaces-builtin-variables-smcountnv]]
4129 --
4132 code:SMCountNV::
4134 Decorating a variable with the code:SMCountNV built-in decoration will make
4139 * [[VUID-{refpage}-SMCountNV-04363]]
4140 The variable decorated with code:SMCountNV must: be declared using the
4141 code:Input {StorageClass}
4142 * [[VUID-{refpage}-SMCountNV-04364]]
4143 The variable decorated with code:SMCountNV must: be declared as a scalar
4144 32-bit integer value
4146 --
4148 [[interfaces-builtin-variables-smidnv]]
4150 --
4153 code:SMIDNV::
4155 Decorating a variable with the code:SMIDNV built-in decoration will make
4158 This variable is in the range [eq]#[0, code:SMCountNV-1]#.
4162 * [[VUID-{refpage}-SMIDNV-04365]]
4163 The variable decorated with code:SMIDNV must: be declared using the
4164 code:Input {StorageClass}
4165 * [[VUID-{refpage}-SMIDNV-04366]]
4166 The variable decorated with code:SMIDNV must: be declared as a scalar
4167 32-bit integer value
4169 --
4173 [[interfaces-builtin-variables-subgroupid]]
4175 --
4178 code:SubgroupId::
4180 Decorating a variable with the code:SubgroupId built-in decoration will make
4182 This variable is in range [0, code:NumSubgroups-1].
4186 * [[VUID-{refpage}-SubgroupId-04367]]
4187 The code:SubgroupId decoration must: be used only within the
4188 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
4190 * [[VUID-{refpage}-SubgroupId-04368]]
4191 The variable decorated with code:SubgroupId must: be declared using the
4192 code:Input {StorageClass}
4193 * [[VUID-{refpage}-SubgroupId-04369]]
4194 The variable decorated with code:SubgroupId must: be declared as a
4195 scalar 32-bit integer value
4197 --
4201 [[interfaces-builtin-variables-sgeq]]
4203 --
4206 code:SubgroupEqMask::
4208 Decorating a variable with the code:SubgroupEqMask builtin decoration will
4211 The bit corresponding to the code:SubgroupLocalInvocationId is set in the
4212 variable decorated with code:SubgroupEqMask.
4215 code:SubgroupEqMaskKHR is an alias of code:SubgroupEqMask.
4219 * [[VUID-{refpage}-SubgroupEqMask-04370]]
4220 The variable decorated with code:SubgroupEqMask must: be declared using
4221 the code:Input {StorageClass}
4222 * [[VUID-{refpage}-SubgroupEqMask-04371]]
4223 The variable decorated with code:SubgroupEqMask must: be declared as a
4224 four-component vector of 32-bit integer values
4226 --
4228 [[interfaces-builtin-variables-sgge]]
4230 --
4233 code:SubgroupGeMask::
4235 Decorating a variable with the code:SubgroupGeMask builtin decoration will
4239 code:SubgroupLocalInvocationId through code:SubgroupSize-1 are set in the
4240 variable decorated with code:SubgroupGeMask.
4243 code:SubgroupGeMaskKHR is an alias of code:SubgroupGeMask.
4247 * [[VUID-{refpage}-SubgroupGeMask-04372]]
4248 The variable decorated with code:SubgroupGeMask must: be declared using
4249 the code:Input {StorageClass}
4250 * [[VUID-{refpage}-SubgroupGeMask-04373]]
4251 The variable decorated with code:SubgroupGeMask must: be declared as a
4252 four-component vector of 32-bit integer values
4254 --
4256 [[interfaces-builtin-variables-sggt]]
4258 --
4261 code:SubgroupGtMask::
4263 Decorating a variable with the code:SubgroupGtMask builtin decoration will
4267 code:SubgroupLocalInvocationId through code:SubgroupSize-1 are set in the
4268 variable decorated with code:SubgroupGtMask.
4271 code:SubgroupGtMaskKHR is an alias of code:SubgroupGtMask.
4275 * [[VUID-{refpage}-SubgroupGtMask-04374]]
4276 The variable decorated with code:SubgroupGtMask must: be declared using
4277 the code:Input {StorageClass}
4278 * [[VUID-{refpage}-SubgroupGtMask-04375]]
4279 The variable decorated with code:SubgroupGtMask must: be declared as a
4280 four-component vector of 32-bit integer values
4282 --
4284 [[interfaces-builtin-variables-sgle]]
4286 --
4289 code:SubgroupLeMask::
4291 Decorating a variable with the code:SubgroupLeMask builtin decoration will
4295 code:SubgroupLocalInvocationId are set in the variable decorated with
4296 code:SubgroupLeMask.
4299 code:SubgroupLeMaskKHR is an alias of code:SubgroupLeMask.
4303 * [[VUID-{refpage}-SubgroupLeMask-04376]]
4304 The variable decorated with code:SubgroupLeMask must: be declared using
4305 the code:Input {StorageClass}
4306 * [[VUID-{refpage}-SubgroupLeMask-04377]]
4307 The variable decorated with code:SubgroupLeMask must: be declared as a
4308 four-component vector of 32-bit integer values
4310 --
4312 [[interfaces-builtin-variables-sglt]]
4314 --
4317 code:SubgroupLtMask::
4319 Decorating a variable with the code:SubgroupLtMask builtin decoration will
4323 code:SubgroupLocalInvocationId are set in the variable decorated with
4324 code:SubgroupLtMask.
4327 code:SubgroupLtMaskKHR is an alias of code:SubgroupLtMask.
4331 * [[VUID-{refpage}-SubgroupLtMask-04378]]
4332 The variable decorated with code:SubgroupLtMask must: be declared using
4333 the code:Input {StorageClass}
4334 * [[VUID-{refpage}-SubgroupLtMask-04379]]
4335 The variable decorated with code:SubgroupLtMask must: be declared as a
4336 four-component vector of 32-bit integer values
4338 --
4340 [[interfaces-builtin-variables-sgli]]
4342 --
4345 code:SubgroupLocalInvocationId::
4347 Decorating a variable with the code:SubgroupLocalInvocationId builtin
4350 This variable is in range [0,code:SubgroupSize-1].
4356 or if pname:module declares SPIR-V version 1.6 or higher, and the local
4358 <<interfaces-builtin-variables-sgs,code:SubgroupSize>>,
4363 code:SubgroupLocalInvocationId for each value in range
4364 [0,code:SubgroupSize-1].
4370 There is no direct relationship between code:SubgroupLocalInvocationId and
4371 code:LocalInvocationId or code:LocalInvocationIndex.
4380 [eq]#index = code:SubgroupLocalInvocationId + code:SubgroupId {times}
4381 code:SubgroupSize#
4400 effectively deprecated when compiling SPIR-V 1.6 shaders, as this behavior
4401 is the default for Vulkan with SPIR-V 1.6.
4409 * [[VUID-{refpage}-SubgroupLocalInvocationId-04380]]
4410 The variable decorated with code:SubgroupLocalInvocationId must: be
4411 declared using the code:Input {StorageClass}
4412 * [[VUID-{refpage}-SubgroupLocalInvocationId-04381]]
4413 The variable decorated with code:SubgroupLocalInvocationId must: be
4414 declared as a scalar 32-bit integer value
4416 --
4418 [[interfaces-builtin-variables-sgs]]
4420 --
4423 code:SubgroupSize::
4425 Decorating a variable with the code:SubgroupSize builtin decoration will
4426 make that variable contain the implementation-dependent
4427 <<limits-subgroup-size, number of invocations in a subgroup>>.
4428 This value must: be a power-of-two integer.
4439 or the SPIR-V pname:module is at least version 1.6,
4441 the code:SubgroupSize decorated variable will contain the subgroup size for
4443 This value must: be between <<limits-minSubgroupSize,
4444 pname:minSubgroupSize>> and <<limits-maxSubgroupSize,
4445 pname:maxSubgroupSize>> and must: be uniform with <<shaders-scope-subgroup,
4449 In compute dispatches, code:SubgroupSize must: be uniform with
4450 <<shaders-scope-command, command scope>>.
4458 the code:SubgroupSize decorated variable will match
4459 <<pipelines-required-subgroup-size, pname:requiredSubgroupSize>>.
4463 SPIR-V pname:module is less than version 1.6 and
4479 variable decorated with code:SubgroupSize will match <<limits-subgroup-size,
4489 The old behavior for code:SubgroupSize is considered deprecated as certain
4498 * [[VUID-{refpage}-SubgroupSize-04382]]
4499 The variable decorated with code:SubgroupSize must: be declared using
4500 the code:Input {StorageClass}
4501 * [[VUID-{refpage}-SubgroupSize-04383]]
4502 The variable decorated with code:SubgroupSize must: be declared as a
4503 scalar 32-bit integer value
4505 --
4509 [[interfaces-builtin-variables-taskcount]]
4511 --
4514 code:TaskCountNV::
4516 Decorating a variable with the code:TaskCountNV decoration will make that
4523 * [[VUID-{refpage}-TaskCountNV-04384]]
4524 The code:TaskCountNV decoration must: be used only within the
4525 code:TaskNV {ExecutionModel}
4526 * [[VUID-{refpage}-TaskCountNV-04385]]
4527 The variable decorated with code:TaskCountNV must: be declared using the
4528 code:Output {StorageClass}
4529 * [[VUID-{refpage}-TaskCountNV-04386]]
4530 The variable decorated with code:TaskCountNV must: be declared as a
4531 scalar 32-bit integer value
4533 --
4536 [[interfaces-builtin-variables-tesscoord]]
4538 --
4541 code:TessCoord::
4543 Decorating a variable with the code:TessCoord built-in decoration will make
4544 that variable contain the three-dimensional [eq]#(u,v,w)# barycentric
4548 For the tessellation modes of code:Quads or code:IsoLines, the third
4553 * [[VUID-{refpage}-TessCoord-04387]]
4554 The code:TessCoord decoration must: be used only within the
4555 code:TessellationEvaluation {ExecutionModel}
4556 * [[VUID-{refpage}-TessCoord-04388]]
4557 The variable decorated with code:TessCoord must: be declared using the
4558 code:Input {StorageClass}
4559 * [[VUID-{refpage}-TessCoord-04389]]
4560 The variable decorated with code:TessCoord must: be declared as a
4561 three-component vector of 32-bit floating-point values
4563 --
4565 [[interfaces-builtin-variables-tesslevelouter]]
4567 --
4570 code:TessLevelOuter::
4572 Decorating a variable with the code:TessLevelOuter built-in decoration will
4577 code:TessLevelOuter can: be written to, controlling the tessellation factors
4583 code:TessLevelOuter can: read the values written by the tessellation control
4588 * [[VUID-{refpage}-TessLevelOuter-04390]]
4589 The code:TessLevelOuter decoration must: be used only within the
4590 code:TessellationControl or code:TessellationEvaluation {ExecutionModel}
4591 * [[VUID-{refpage}-TessLevelOuter-04391]]
4592 The variable decorated with code:TessLevelOuter within the
4593 code:TessellationControl {ExecutionModel} must: be declared using the
4594 code:Output {StorageClass}
4595 * [[VUID-{refpage}-TessLevelOuter-04392]]
4596 The variable decorated with code:TessLevelOuter within the
4597 code:TessellationEvaluation {ExecutionModel} must: be declared using the
4598 code:Input {StorageClass}
4599 * [[VUID-{refpage}-TessLevelOuter-04393]]
4600 The variable decorated with code:TessLevelOuter must: be declared as an
4601 array of size four, containing 32-bit floating-point values
4603 --
4605 [[interfaces-builtin-variables-tesslevelinner]]
4607 --
4610 code:TessLevelInner::
4612 Decorating a variable with the code:TessLevelInner built-in decoration will
4617 code:TessLevelInner can: be written to, controlling the tessellation factors
4623 code:TessLevelInner can: read the values written by the tessellation control
4628 * [[VUID-{refpage}-TessLevelInner-04394]]
4629 The code:TessLevelInner decoration must: be used only within the
4630 code:TessellationControl or code:TessellationEvaluation {ExecutionModel}
4631 * [[VUID-{refpage}-TessLevelInner-04395]]
4632 The variable decorated with code:TessLevelInner within the
4633 code:TessellationControl {ExecutionModel} must: be declared using the
4634 code:Output {StorageClass}
4635 * [[VUID-{refpage}-TessLevelInner-04396]]
4636 The variable decorated with code:TessLevelInner within the
4637 code:TessellationEvaluation {ExecutionModel} must: be declared using the
4638 code:Input {StorageClass}
4639 * [[VUID-{refpage}-TessLevelInner-04397]]
4640 The variable decorated with code:TessLevelInner must: be declared as an
4641 array of size two, containing 32-bit floating-point values
4643 --
4646 [[interfaces-builtin-variables-vertexcounthuawei]]
4648 --
4651 code:VertexCountHUAWEI::
4653 The code:VertexCountHUAWEI decoration can be used to decorate a cluster
4654 culling shader output variable,this non-indexed mode specific variable will
4660 * [[VUID-{refpage}-VertexCountHUAWEI-07809]]
4661 The code:VertexCountHUAWEI decoration must: be used only within the
4662 code:ClusterCullingHUAWEI {ExecutionModel}
4663 * [[VUID-{refpage}-VertexCountHUAWEI-07810]]
4664 The variable decorated with code:VertexCountHUAWEI must: be declared as
4665 a scalar 32-bit integer value
4667 --
4670 [[interfaces-builtin-variables-vertexindex]]
4672 --
4675 code:VertexIndex::
4677 Decorating a variable with the code:VertexIndex built-in decoration will
4680 For non-indexed draws, this variable begins at the pname:firstVertex
4692 code:VertexIndex starts at the same starting value for each instance.
4697 * [[VUID-{refpage}-VertexIndex-04398]]
4698 The code:VertexIndex decoration must: be used only within the
4699 code:Vertex {ExecutionModel}
4700 * [[VUID-{refpage}-VertexIndex-04399]]
4701 The variable decorated with code:VertexIndex must: be declared using the
4702 code:Input {StorageClass}
4703 * [[VUID-{refpage}-VertexIndex-04400]]
4704 The variable decorated with code:VertexIndex must: be declared as a
4705 scalar 32-bit integer value
4707 --
4710 [[interfaces-builtin-variables-vertexoffsethuawei]]
4712 --
4715 code:VertexOffsetHUAWEI::
4717 The code:VertexOffsetHUAWEI decoration can be used to decorate a cluster
4724 * [[VUID-{refpage}-VertexOffsetHUAWEI-07811]]
4725 The code:VertexOffsetHUAWEI decoration must: be used only within the
4726 code:ClusterCullingHUAWEI {ExecutionModel}
4727 * [[VUID-{refpage}-VertexOffsetHUAWEI-07812]]
4728 The variable decorated with code:VertexOffsetHUAWEI must: be declared as
4729 a scalar 32-bit integer value
4731 --
4735 [[interfaces-builtin-variables-viewindex]]
4737 --
4740 code:ViewIndex::
4742 The code:ViewIndex decoration can: be applied to a shader input which will
4752 * [[VUID-{refpage}-ViewIndex-04401]]
4753 The code:ViewIndex decoration must: be used only within the
4754 code:MeshEXT, code:Vertex, code:Geometry, code:TessellationControl,
4755 code:TessellationEvaluation or code:Fragment {ExecutionModel}
4756 * [[VUID-{refpage}-ViewIndex-04402]]
4757 The variable decorated with code:ViewIndex must: be declared using the
4758 code:Input {StorageClass}
4759 * [[VUID-{refpage}-ViewIndex-04403]]
4760 The variable decorated with code:ViewIndex must: be declared as a scalar
4761 32-bit integer value
4763 --
4766 [[interfaces-builtin-variables-viewportindex]]
4768 --
4771 code:ViewportIndex::
4773 Decorating a variable with the code:ViewportIndex built-in decoration will
4781 geometry shader, the variable decorated with code:ViewportIndex can be
4796 _<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4797 stage>>_ (in pipeline order) controls the code:ViewportIndex that is used.
4799 to write the code:ViewportIndex.
4803 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4805 with code:ViewportIndex
4807 , and if <<features-multiview-per-view-viewports,
4811 If a <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4813 code:ViewportIndex, it must: write the same value to code:ViewportIndex for
4816 In a fragment shader, the variable decorated with code:ViewportIndex
4821 If <<features-multiview-per-view-viewports,
4823 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4825 with code:ViewportIndex, then the value of code:ViewIndex is used as an
4827 of code:ViewportIndex in the fragment shader is undefined::.
4832 * [[VUID-{refpage}-ViewportIndex-04404]]
4833 The code:ViewportIndex decoration must: be used only within the
4834 code:MeshEXT, code:MeshNV, code:Vertex, code:TessellationEvaluation,
4835 code:Geometry, or code:Fragment {ExecutionModel}
4837 * [[VUID-{refpage}-ViewportIndex-04405]]
4838 If the <<features-shaderOutputViewportIndex,
4840 code:ViewportIndex decoration must: be used only within the
4841 code:Geometry or code:Fragment {ExecutionModel}
4843 * [[VUID-{refpage}-ViewportIndex-04406]]
4844 The variable decorated with code:ViewportIndex within the code:MeshEXT,
4845 code:MeshNV, code:Vertex, code:TessellationEvaluation, or code:Geometry
4846 {ExecutionModel} must: be declared using the code:Output {StorageClass}
4847 * [[VUID-{refpage}-ViewportIndex-04407]]
4848 The variable decorated with code:ViewportIndex within the code:Fragment
4849 {ExecutionModel} must: be declared using the code:Input {StorageClass}
4850 * [[VUID-{refpage}-ViewportIndex-04408]]
4851 The variable decorated with code:ViewportIndex must: be declared as a
4852 scalar 32-bit integer value
4853 * [[VUID-{refpage}-ViewportIndex-07060]]
4854 The variable decorated with code:ViewportIndex within the code:MeshEXT
4855 {ExecutionModel} must: also be decorated with the code:PerPrimitiveEXT
4858 --
4861 [[interfaces-builtin-variables-viewportmask]]
4863 --
4866 code:ViewportMaskNV::
4868 Decorating a variable with the code:ViewportMaskNV built-in decoration will
4876 with code:ViewportMaskNV can be written to with the mask of which viewports
4879 The code:ViewportMaskNV variable must: be an array that has
4894 _<<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4895 stage>>_ (in pipeline order) controls the code:ViewportMaskNV that is used.
4897 to write the code:ViewportMaskNV.
4898 When code:ViewportMaskNV is written by the final
4899 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4900 stage>>, any variable decorated with code:ViewportIndex in the fragment
4904 If a <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4906 code:ViewportMaskNV, it must: write the same value to code:ViewportMaskNV
4911 * [[VUID-{refpage}-ViewportMaskNV-04409]]
4912 The code:ViewportMaskNV decoration must: be used only within the
4913 code:Vertex, code:MeshNV, code:TessellationEvaluation, or code:Geometry
4915 * [[VUID-{refpage}-ViewportMaskNV-04410]]
4916 The variable decorated with code:ViewportMaskNV must: be declared using
4917 the code:Output {StorageClass}
4918 * [[VUID-{refpage}-ViewportMaskNV-04411]]
4919 The variable decorated with code:ViewportMaskNV must: be declared as an
4920 array of 32-bit integer values
4922 --
4926 [[interfaces-builtin-variables-viewportmaskperview]]
4928 --
4931 code:ViewportMaskPerViewNV::
4933 Decorating a variable with the code:ViewportMaskPerViewNV built-in
4937 The value written to an element of code:ViewportMaskPerViewNV in the last
4938 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4942 non-zero bit of the bitmask, and that viewport index is used to select the
4956 code:ViewportMaskPerViewNV output in an earlier
4957 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4959 <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
4962 Although code:ViewportMaskNV is an array, code:ViewportMaskPerViewNV is not
4963 a two-dimensional array.
4964 Instead, code:ViewportMaskPerViewNV is limited to 32 viewports.
4968 * [[VUID-{refpage}-ViewportMaskPerViewNV-04412]]
4969 The code:ViewportMaskPerViewNV decoration must: be used only within the
4970 code:Vertex, code:MeshNV, code:TessellationControl,
4971 code:TessellationEvaluation, or code:Geometry {ExecutionModel}
4972 * [[VUID-{refpage}-ViewportMaskPerViewNV-04413]]
4973 The variable decorated with code:ViewportMaskPerViewNV must: be declared
4974 using the code:Output {StorageClass}
4975 * [[VUID-{refpage}-ViewportMaskPerViewNV-04414]]
4976 The variable decorated with code:ViewportMaskPerViewNV must: be declared
4977 as an array of 32-bit integer values
4978 * [[VUID-{refpage}-ViewportMaskPerViewNV-04415]]
4979 The array decorated with code:ViewportMaskPerViewNV must: be a size less
4981 * [[VUID-{refpage}-ViewportMaskPerViewNV-04416]]
4982 The array decorated with code:ViewportMaskPerViewNV must: be a size
4984 * [[VUID-{refpage}-ViewportMaskPerViewNV-04417]]
4985 The array variable decorated with code:ViewportMaskPerViewNV must: only
4988 --
4992 [[interfaces-builtin-variables-warpspersmnv]]
4994 --
4997 code:WarpsPerSMNV::
4999 Decorating a variable with the code:WarpsPerSMNV built-in decoration will
5004 * [[VUID-{refpage}-WarpsPerSMNV-04418]]
5005 The variable decorated with code:WarpsPerSMNV must: be declared using
5006 the code:Input {StorageClass}
5007 * [[VUID-{refpage}-WarpsPerSMNV-04419]]
5008 The variable decorated with code:WarpsPerSMNV must: be declared as a
5009 scalar 32-bit integer value
5011 --
5013 [[interfaces-builtin-variables-warpidnv]]
5015 --
5018 code:WarpIDNV::
5020 Decorating a variable with the code:WarpIDNV built-in decoration will make
5023 This variable is in the range [eq]#[0, code:WarpsPerSMNV-1]#.
5027 * [[VUID-{refpage}-WarpIDNV-04420]]
5028 The variable decorated with code:WarpIDNV must: be declared using the
5029 code:Input {StorageClass}
5030 * [[VUID-{refpage}-WarpIDNV-04421]]
5031 The variable decorated with code:WarpIDNV must: be declared as a scalar
5032 32-bit integer value
5034 --
5037 [[interfaces-builtin-variables-workgroupid]]
5039 --
5042 code:WorkgroupId::
5044 Decorating a variable with the code:WorkgroupId built-in decoration will
5052 * [[VUID-{refpage}-WorkgroupId-04422]]
5053 The code:WorkgroupId decoration must: be used only within the
5054 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
5056 * [[VUID-{refpage}-WorkgroupId-04423]]
5057 The variable decorated with code:WorkgroupId must: be declared using the
5058 code:Input {StorageClass}
5059 * [[VUID-{refpage}-WorkgroupId-04424]]
5060 The variable decorated with code:WorkgroupId must: be declared as a
5061 three-component vector of 32-bit integer values
5063 --
5065 [[interfaces-builtin-variables-workgroupsize]]
5067 --
5070 code:WorkgroupSize::
5076 SPIR-V 1.6 deprecated code:WorkgroupSize in favor of using the
5077 code:LocalSizeId Execution Mode instead.
5078 Support for code:LocalSizeId was added with `apiext:VK_KHR_maintenance4` and
5083 Decorating an object with the code:WorkgroupSize built-in decoration will
5085 If an object is decorated with the code:WorkgroupSize decoration, this takes
5086 precedence over any code:LocalSize
5087 ifdef::VK_VERSION_1_3,VK_KHR_maintenance4[or code:LocalSizeId]
5092 * [[VUID-{refpage}-WorkgroupSize-04425]]
5093 The code:WorkgroupSize decoration must: be used only within the
5094 code:GLCompute, code:MeshEXT, code:TaskEXT, code:MeshNV, or code:TaskNV
5096 * [[VUID-{refpage}-WorkgroupSize-04426]]
5097 The variable decorated with code:WorkgroupSize must: be a specialization
5099 * [[VUID-{refpage}-WorkgroupSize-04427]]
5100 The variable decorated with code:WorkgroupSize must: be declared as a
5101 three-component vector of 32-bit integer values
5103 --
5106 [[interfaces-builtin-variables-worldraydirection]]
5108 --
5111 code:WorldRayDirectionKHR::
5113 A variable decorated with the code:WorldRayDirectionKHR decoration will
5115 The value is the parameter passed into the <<glossary-pipeline-trace-ray,
5120 * [[VUID-{refpage}-WorldRayDirectionKHR-04428]]
5121 The code:WorldRayDirectionKHR decoration must: be used only within the
5122 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
5123 code:MissKHR {ExecutionModel}
5124 * [[VUID-{refpage}-WorldRayDirectionKHR-04429]]
5125 The variable decorated with code:WorldRayDirectionKHR must: be declared
5126 using the code:Input {StorageClass}
5127 * [[VUID-{refpage}-WorldRayDirectionKHR-04430]]
5128 The variable decorated with code:WorldRayDirectionKHR must: be declared
5129 as a three-component vector of 32-bit floating-point values
5131 --
5133 [[interfaces-builtin-variables-worldrayorigin]]
5135 --
5138 code:WorldRayOriginKHR::
5140 A variable decorated with the code:WorldRayOriginKHR decoration will specify
5142 The value is the parameter passed into the <<glossary-pipeline-trace-ray,
5147 * [[VUID-{refpage}-WorldRayOriginKHR-04431]]
5148 The code:WorldRayOriginKHR decoration must: be used only within the
5149 code:IntersectionKHR, code:AnyHitKHR, code:ClosestHitKHR, or
5150 code:MissKHR {ExecutionModel}
5151 * [[VUID-{refpage}-WorldRayOriginKHR-04432]]
5152 The variable decorated with code:WorldRayOriginKHR must: be declared
5153 using the code:Input {StorageClass}
5154 * [[VUID-{refpage}-WorldRayOriginKHR-04433]]
5155 The variable decorated with code:WorldRayOriginKHR must: be declared as
5156 a three-component vector of 32-bit floating-point values
5158 --
5160 [[interfaces-builtin-variables-worldtoobject]]
5162 --
5165 code:WorldToObjectKHR::
5167 A variable decorated with the code:WorldToObjectKHR decoration will contain
5168 the current world-to-object transformation matrix, which is determined by
5173 * [[VUID-{refpage}-WorldToObjectKHR-04434]]
5174 The code:WorldToObjectKHR decoration must: be used only within the
5175 code:IntersectionKHR, code:AnyHitKHR, or code:ClosestHitKHR
5177 * [[VUID-{refpage}-WorldToObjectKHR-04435]]
5178 The variable decorated with code:WorldToObjectKHR must: be declared
5179 using the code:Input {StorageClass}
5180 * [[VUID-{refpage}-WorldToObjectKHR-04436]]
5181 The variable decorated with code:WorldToObjectKHR must: be declared as a
5182 matrix with four columns of three-component vectors of 32-bit
5183 floating-point values
5185 --
5189 [[interfaces-builtin-variables-corecountarm]]
5191 --
5194 code:CoreCountARM::
5196 Decorating a variable with the code:CoreCountARM built-in decoration will
5201 * [[VUID-{refpage}-CoreCountARM-07595]]
5202 The variable decorated with code:CoreCountARM must: be declared using
5203 the code:Input {StorageClass}
5204 * [[VUID-{refpage}-CoreCountARM-07596]]
5205 The variable decorated with code:CoreCountARM must: be declared as a
5206 scalar 32-bit integer value
5208 --
5210 [[interfaces-builtin-variables-coremaxidarm]]
5212 --
5215 code:CoreMaxIDARM::
5217 Decorating a variable with the code:CoreMaxIDARM built-in decoration will
5223 * [[VUID-{refpage}-CoreMaxIDARM-07597]]
5224 The variable decorated with code:CoreMaxIDARM must: be declared using
5225 the code:Input {StorageClass}
5226 * [[VUID-{refpage}-CoreMaxIDARM-07598]]
5227 The variable decorated with code:CoreMaxIDARM must: be declared as a
5228 scalar 32-bit integer value
5230 --
5232 [[interfaces-builtin-variables-coreidarm]]
5234 --
5237 code:CoreIDARM::
5239 Decorating a variable with the code:CoreIDARM built-in decoration will make
5242 This variable is in the range [eq]#[0, code:CoreMaxIDARM]#.
5246 * [[VUID-{refpage}-CoreIDARM-07599]]
5247 The variable decorated with code:CoreIDARM must: be declared using the
5248 code:Input {StorageClass}
5249 * [[VUID-{refpage}-CoreIDARM-07600]]
5250 The variable decorated with code:CoreIDARM must: be declared as a scalar
5251 32-bit integer value
5253 --
5255 [[interfaces-builtin-variables-warpmaxidarm]]
5257 --
5260 code:WarpMaxIDARM::
5262 Decorating a variable with the code:WarpMaxIDARM built-in decoration will
5268 * [[VUID-{refpage}-WarpMaxIDARM-07601]]
5269 The variable decorated with code:WarpMaxIDARM must: be declared using
5270 the code:Input {StorageClass}
5271 * [[VUID-{refpage}-WarpMaxIDARM-07602]]
5272 The variable decorated with code:WarpMaxIDARM must: be declared as a
5273 scalar 32-bit integer value
5275 --
5277 [[interfaces-builtin-variables-warpidarm]]
5279 --
5282 code:WarpIDARM::
5284 Decorating a variable with the code:WarpIDARM built-in decoration will make
5287 This variable is in the range [eq]#[0, code:WarpMaxIDARM]#.
5291 * [[VUID-{refpage}-WarpIDARM-07603]]
5292 The variable decorated with code:WarpIDARM must: be declared using the
5293 code:Input {StorageClass}
5294 * [[VUID-{refpage}-WarpIDARM-07604]]
5295 The variable decorated with code:WarpIDARM must: be declared as a scalar
5296 32-bit integer value
5298 --
5302 [[interfaces-builtin-variables-coalescedinputcountamd]]
5304 --
5307 code:CoalescedInputCountAMDX::
5309 Decorating a variable with the code:CoalescedInputCountAMDX built-in
5318 * [[VUID-{refpage}-CoalescedInputCountAMDX-09172]]
5319 The variable decorated with code:CoalescedInputCountAMDX must: be
5320 declared using the code:Input {StorageClass}
5321 * [[VUID-{refpage}-CoalescedInputCountAMDX-09173]]
5322 If a variable is decorated with code:CoalescedInputCountAMDX, the
5323 code:CoalescingAMDX execution mode must: be declared
5324 * [[VUID-{refpage}-CoalescedInputCountAMDX-09174]]
5325 The variable decorated with code:CoalescedInputCountAMDX must: be
5326 declared as a scalar 32-bit integer value
5328 --
5331 --
5334 code:ShaderIndexAMDX::
5336 Decorating a variable with the code:ShaderIndexAMDX built-in decoration will
5340 code:ShaderIndexAMDX execution mode.
5344 * [[VUID-{refpage}-ShaderIndexAMDX-09175]]
5345 The variable decorated with code:ShaderIndexAMDX must: be declared using
5346 the code:Input {StorageClass}
5347 * [[VUID-{refpage}-ShaderIndexAMDX-09176]]
5348 The variable decorated with code:ShaderIndexAMDX must: be declared as a
5349 scalar 32-bit integer value
5351 --