Description
The following rules can be validated with only the SPIR-V module itself. They do not depend on knowledge of the implementation and its capabilities or knowledge of runtime information, such as enabled features.
-
VUID-StandaloneSpirv-None-04633
Every entry point must have no return value and accept no arguments -
VUID-StandaloneSpirv-None-04634
The static function-call graph for an entry point must not contain cycles; that is, static recursion is not allowed -
VUID-StandaloneSpirv-None-04635
The Logical or PhysicalStorageBuffer64 addressing model must be selected -
VUID-StandaloneSpirv-None-04636
Scope for execution must be limited to Workgroup or Subgroup -
VUID-StandaloneSpirv-None-04637
If the Scope for execution is Workgroup, then it must only be used in the task, mesh, tessellation control, or compute execution models -
VUID-StandaloneSpirv-None-04638
Scope for memory must be limited to Device, QueueFamily, Workgroup, ShaderCallKHR, Subgroup, or Invocation -
VUID-StandaloneSpirv-None-04639
If the Scope for memory is Workgroup, then it must only be used in the task, mesh, or compute execution models -
VUID-StandaloneSpirv-None-04640
If the Scope for memory is ShaderCallKHR, then it must only be used in ray generation, intersection, closest hit, any-hit, miss, and callable execution models -
VUID-StandaloneSpirv-None-04641
If the Scope for memory is Invocation, then memory semantics must be None -
VUID-StandaloneSpirv-None-04642
Scope for group operations must be limited to Subgroup -
VUID-StandaloneSpirv-None-04643
Storage Class must be limited to UniformConstant, Input, Uniform, Output, Workgroup, Private, Function, PushConstant, Image, StorageBuffer, RayPayloadKHR, IncomingRayPayloadKHR, HitAttributeKHR, CallableDataKHR, IncomingCallableDataKHR, ShaderRecordBufferKHR, or PhysicalStorageBuffer -
VUID-StandaloneSpirv-None-04644
If the Storage Class is Output, then it must not be used in the GlCompute, RayGenerationKHR, IntersectionKHR, AnyHitKHR, ClosestHitKHR, MissKHR, or CallableKHR execution models -
VUID-StandaloneSpirv-None-04645
If the Storage Class is Workgroup, then it must only be used in the task, mesh, or compute execution models -
VUID-StandaloneSpirv-OpAtomicStore-04730
OpAtomicStore
must not use Acquire, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpAtomicLoad-04731
OpAtomicLoad
must not use Release, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpMemoryBarrier-04732
OpMemoryBarrier
must use one of Acquire, Release, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpMemoryBarrier-04733
OpMemoryBarrier
must include at least one storage class -
VUID-StandaloneSpirv-OpControlBarrier-04650
If the semantics forOpControlBarrier
includes one of Acquire, Release, AcquireRelease, or SequentiallyConsistent memory semantics, then it must include at least one storage class -
VUID-StandaloneSpirv-OpVariable-04651
AnyOpVariable
with anInitializer
operand must have Output, Private, Function, or Workgroup as its Storage Class operand -
VUID-StandaloneSpirv-OpVariable-04734
AnyOpVariable
with anInitializer
operand and Workgroup as its Storage Class operand must useOpConstantNull
as the initializer -
VUID-StandaloneSpirv-OpReadClockKHR-04652
Scope forOpReadClockKHR
must be limited to Subgroup or Device -
VUID-StandaloneSpirv-OriginLowerLeft-04653
TheOriginLowerLeft
execution mode must not be used; fragment entry points must declareOriginUpperLeft
-
VUID-StandaloneSpirv-PixelCenterInteger-04654
ThePixelCenterInteger
execution mode must not be used (pixels are always centered at half-integer coordinates) -
VUID-StandaloneSpirv-UniformConstant-04655
Any variable in theUniformConstant
storage class must be typed as eitherOpTypeImage
,OpTypeSampler
,OpTypeSampledImage
,OpTypeAccelerationStructureKHR
, or an array of one of these types -
VUID-StandaloneSpirv-Uniform-06807
Any variable in theUniform
orStorageBuffer
storage class must be typed asOpTypeStruct
or an array of this type -
VUID-StandaloneSpirv-PushConstant-06808
Any variable in thePushConstant
storage class must be typed asOpTypeStruct
-
VUID-StandaloneSpirv-OpTypeImage-04656
OpTypeImage
must declare a scalar 32-bit float, 64-bit integer, or 32-bit integer type for the “Sampled Type” (RelaxedPrecision
can be applied to a sampling instruction and to the variable holding the result of a sampling instruction) -
VUID-StandaloneSpirv-OpTypeImage-04657
OpTypeImage
must have a “Sampled” operand of 1 (sampled image) or 2 (storage image) -
VUID-StandaloneSpirv-OpTypeSampledImage-06671
OpTypeSampledImage
must have aOpTypeImage
with a “Sampled” operand of 1 (sampled image) -
VUID-StandaloneSpirv-Image-04965
The converted bit width, signedness, and numeric type of theImage
Format
operand of anOpTypeImage
must match theSampled
Type
, as defined in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-format-type-matching -
VUID-StandaloneSpirv-OpImageTexelPointer-04658
If anOpImageTexelPointer
is used in an atomic operation, the image type of theimage
parameter toOpImageTexelPointer
must have an image format ofR64i
,R64ui
,R32f
,R32i
, orR32ui
-
VUID-StandaloneSpirv-OpImageQuerySizeLod-04659
OpImageQuerySizeLod
,OpImageQueryLod
, andOpImageQueryLevels
must only consume an “Image” operand whose type has its “Sampled” operand set to 1 -
VUID-StandaloneSpirv-OpTypeImage-06214
AnOpTypeImage
with a “Dim” operand ofSubpassData
must have an “Arrayed” operand of 0 (non-arrayed) and a “Sampled” operand of 2 (storage image) -
VUID-StandaloneSpirv-SubpassData-04660
The (u,v) coordinates used for aSubpassData
must be the <id> of a constant vector (0,0), or if a layer coordinate is used, must be a vector that was formed with constant 0 for the u and v components -
VUID-StandaloneSpirv-OpTypeImage-06924
Objects of typesOpTypeImage
,OpTypeSampler
,OpTypeSampledImage
,OpTypeAccelerationStructureKHR
, and arrays of these types must not be stored to or modified -
VUID-StandaloneSpirv-Uniform-06925
Any variable in theUniform
storage class decorated asBlock
must not be stored to or modified -
VUID-StandaloneSpirv-Offset-04662
Any image operation must use at most one of theOffset
,ConstOffset
, andConstOffsets
image operands -
VUID-StandaloneSpirv-Offset-04663
Image operandOffset
must only be used withOpImage*Gather
instructions -
VUID-StandaloneSpirv-Offset-04865
Any image instruction which uses anOffset
,ConstOffset
, orConstOffsets
image operand, must only consume a “Sampled Image” operand whose type has its “Sampled” operand set to 1 -
VUID-StandaloneSpirv-OpImageGather-04664
The “Component” operand ofOpImageGather
, andOpImageSparseGather
must be the <id> of a constant instruction -
VUID-StandaloneSpirv-OpImage-04777
OpImage*Dref*
instructions must not consume an image whoseDim
is 3D -
VUID-StandaloneSpirv-None-04667
Structure types must not contain opaque types -
VUID-StandaloneSpirv-BuiltIn-04668
AnyBuiltIn
decoration not listed in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables must not be used -
VUID-StandaloneSpirv-Location-06672
TheLocation
orComponent
decorations must only be used with theInput
,Output
,RayPayloadKHR
,IncomingRayPayloadKHR
,HitAttributeKHR
,CallableDataKHR
,IncomingCallableDataKHR
, orShaderRecordBufferKHR
storage classes -
VUID-StandaloneSpirv-Location-04915
TheLocation
orComponent
decorations must not be used withBuiltIn
-
VUID-StandaloneSpirv-Location-04916
TheLocation
decorations must be used on user-defined variables -
VUID-StandaloneSpirv-Location-04917
TheLocation
decorations must be used on anOpVariable
with a structure type that is not a block -
VUID-StandaloneSpirv-Location-04918
TheLocation
decorations must not be used on the members ofOpVariable
with a structure type that is decorated withLocation
-
VUID-StandaloneSpirv-Location-04919
TheLocation
decorations must be used on each member ofOpVariable
with a structure type that is a block not decorated withLocation
-
VUID-StandaloneSpirv-Component-04920
TheComponent
decoration value must not be greater than 3 -
VUID-StandaloneSpirv-Component-04921
If theComponent
decoration is used on anOpVariable
that has aOpTypeVector
type with aComponent
Type
with aWidth
that is less than or equal to 32, the sum of itsComponent
Count
and theComponent
decoration value must be less than 4 -
VUID-StandaloneSpirv-Component-04922
If theComponent
decoration is used on anOpVariable
that has aOpTypeVector
type with aComponent
Type
with aWidth
that is equal to 64, the sum of two times itsComponent
Count
and theComponent
decoration value must be less than 4 -
VUID-StandaloneSpirv-Component-04923
TheComponent
decorations value must not be 1 or 3 for scalar or two-component 64-bit data types -
VUID-StandaloneSpirv-Component-04924
TheComponent
decorations must not used with any type that is not a scalar or vector -
VUID-StandaloneSpirv-GLSLShared-04669
TheGLSLShared
andGLSLPacked
decorations must not be used -
VUID-StandaloneSpirv-Flat-04670
TheFlat
,NoPerspective
,Sample
, andCentroid
decorations must only be used on variables with theOutput
orInput
storage class -
VUID-StandaloneSpirv-Flat-06201
TheFlat
,NoPerspective
,Sample
, andCentroid
decorations must not be used on variables with theOutput
storage class in a fragment shader -
VUID-StandaloneSpirv-Flat-06202
TheFlat
,NoPerspective
,Sample
, andCentroid
decorations must not be used on variables with theInput
storage class in a vertex shader -
VUID-StandaloneSpirv-PerVertexKHR-06777
ThePerVertexKHR
decoration must only be used on variables with theInput
storage class in a fragment shader -
VUID-StandaloneSpirv-Flat-04744
Any variable with integer or double-precision floating-point type and withInput
storage class in a fragment shader, must be decoratedFlat
-
VUID-StandaloneSpirv-ViewportRelativeNV-04672
TheViewportRelativeNV
decoration must only be used on a variable decorated withLayer
in the vertex, tessellation evaluation, or geometry shader stages -
VUID-StandaloneSpirv-ViewportRelativeNV-04673
TheViewportRelativeNV
decoration must not be used unless a variable decorated with one ofViewportIndex
orViewportMaskNV
is also statically used by the sameOpEntryPoint
-
VUID-StandaloneSpirv-ViewportMaskNV-04674
TheViewportMaskNV
andViewportIndex
decorations must not both be statically used by one or moreOpEntryPoint
’s that form the pre-rasterization shader stages of a graphics pipeline -
VUID-StandaloneSpirv-FPRoundingMode-04675
Rounding modes other than round-to-nearest-even and round-towards-zero must not be used for theFPRoundingMode
decoration -
VUID-StandaloneSpirv-Invariant-04677
Variables decorated withInvariant
and variables with structure types that have any members decorated withInvariant
must be in theOutput
orInput
storage class,Invariant
used on anInput
storage class variable or structure member has no effect -
VUID-StandaloneSpirv-VulkanMemoryModel-04678
If theVulkanMemoryModel
capability is not declared, theVolatile
decoration must be used on any variable declaration that includes one of theSMIDNV
,WarpIDNV
,SubgroupSize
,SubgroupLocalInvocationId
,SubgroupEqMask
,SubgroupGeMask
,SubgroupGtMask
,SubgroupLeMask
, orSubgroupLtMask
BuiltIn
decorations when used in the ray generation, closest hit, miss, intersection, or callable shaders, or with theRayTmaxKHR
Builtin
decoration when used in an intersection shader -
VUID-StandaloneSpirv-VulkanMemoryModel-04679
If theVulkanMemoryModel
capability is declared, theOpLoad
instruction must use theVolatile
memory semantics when it accesses into any variable that includes one of theSMIDNV
,WarpIDNV
,SubgroupSize
,SubgroupLocalInvocationId
,SubgroupEqMask
,SubgroupGeMask
,SubgroupGtMask
,SubgroupLeMask
, orSubgroupLtMask
BuiltIn
decorations when used in the ray generation, closest hit, miss, intersection, or callable shaders, or with theRayTmaxKHR
Builtin
decoration when used in an intersection shader -
VUID-StandaloneSpirv-OpTypeRuntimeArray-04680
OpTypeRuntimeArray
must only be used for the last member of aBlock
-decoratedOpTypeStruct
inStorageBuffer
orPhysicalStorageBuffer
storage classes;BufferBlock
-decoratedOpTypeStruct
inUniform
storage class; the outermost dimension of an arrayed variable in theStorageBuffer
,Uniform
, orUniformConstant
storage classes. -
VUID-StandaloneSpirv-Function-04681
A type T that is an array sized with a specialization constant must neither be, nor be contained in, the type T2 of a variable V, unless either: a) T is equal to T2, b) V is declared in theFunction
, orPrivate
storage classes, c) V is a non-Block variable in theWorkgroup
storage class, or d) V is an interface variable with an additional level of arrayness, as described in interface matching, and T is the member type of the array type T2 -
VUID-StandaloneSpirv-OpControlBarrier-04682
IfOpControlBarrier
is used in ray generation, intersection, any-hit, closest hit, miss, fragment, vertex, tessellation evaluation, or geometry shaders, the execution Scope must beSubgroup
-
VUID-StandaloneSpirv-LocalSize-06426
For each compute shader entry point, either aLocalSize
orLocalSizeId
execution mode, or an object decorated with theWorkgroupSize
decoration must be specified -
VUID-StandaloneSpirv-DerivativeGroupQuadsNV-04684
For compute shaders using theDerivativeGroupQuadsNV
execution mode, the first two dimensions of the local workgroup size must be a multiple of two -
VUID-StandaloneSpirv-DerivativeGroupLinearNV-04778
For compute shaders using theDerivativeGroupLinearNV
execution mode, the product of the dimensions of the local workgroup size must be a multiple of four -
VUID-StandaloneSpirv-OpGroupNonUniformBallotBitCount-04685
IfOpGroupNonUniformBallotBitCount
is used, the group operation must be limited to Reduce, InclusiveScan, or ExclusiveScan -
VUID-StandaloneSpirv-None-04686
The Pointer operand of all atomic instructions must have a Storage Class limited to Uniform, Workgroup, Image, StorageBuffer, PhysicalStorageBuffer, or TaskPayloadWorkgroupEXT -
VUID-StandaloneSpirv-Offset-04687
Output variables or block members decorated withOffset
that have a 64-bit type, or a composite type containing a 64-bit type, must specify anOffset
value aligned to a 8 byte boundary -
VUID-StandaloneSpirv-Offset-04689
The size of any output block containing any member decorated withOffset
that is a 64-bit type must be a multiple of 8 -
VUID-StandaloneSpirv-Offset-04690
The first member of an output block specifying aOffset
decoration must specify aOffset
value that is aligned to an 8 byte boundary if that block contains any member decorated withOffset
and is a 64-bit type -
VUID-StandaloneSpirv-Offset-04691
Output variables or block members decorated withOffset
that have a 32-bit type, or a composite type contains a 32-bit type, must specify anOffset
value aligned to a 4 byte boundary -
VUID-StandaloneSpirv-Offset-04692
Output variables, blocks or block members decorated withOffset
must only contain base types that have components that are either 32-bit or 64-bit in size -
VUID-StandaloneSpirv-Offset-04716
Only variables or block members in the output interface decorated withOffset
can be captured for transform feedback, and those variables or block members must also be decorated withXfbBuffer
andXfbStride
, or inheritXfbBuffer
andXfbStride
decorations from a block containing them -
VUID-StandaloneSpirv-XfbBuffer-04693
All variables or block members in the output interface of the entry point being compiled decorated with a specificXfbBuffer
value must all be decorated with identicalXfbStride
values -
VUID-StandaloneSpirv-Stream-04694
If any variables or block members in the output interface of the entry point being compiled are decorated withStream
, then all variables belonging to the sameXfbBuffer
must specify the sameStream
value -
VUID-StandaloneSpirv-XfbBuffer-04696
For any two variables or block members in the output interface of the entry point being compiled with the sameXfbBuffer
value, the ranges determined by theOffset
decoration and the size of the type must not overlap -
VUID-StandaloneSpirv-XfbBuffer-04697
All block members in the output interface of the entry point being compiled that are in the same block and have a declared or inheritedXfbBuffer
decoration must specify the sameXfbBuffer
value -
VUID-StandaloneSpirv-RayPayloadKHR-04698
RayPayloadKHR
storage class must only be used in ray generation, closest hit or miss shaders -
VUID-StandaloneSpirv-IncomingRayPayloadKHR-04699
IncomingRayPayloadKHR
storage class must only be used in closest hit, any-hit, or miss shaders -
VUID-StandaloneSpirv-IncomingRayPayloadKHR-04700
There must be at most one variable with theIncomingRayPayloadKHR
storage class in the input interface of an entry point -
VUID-StandaloneSpirv-HitAttributeKHR-04701
HitAttributeKHR
storage class must only be used in intersection, any-hit, or closest hit shaders -
VUID-StandaloneSpirv-HitAttributeKHR-04702
There must be at most one variable with theHitAttributeKHR
storage class in the input interface of an entry point -
VUID-StandaloneSpirv-HitAttributeKHR-04703
A variable withHitAttributeKHR
storage class must only be written to in an intersection shader -
VUID-StandaloneSpirv-CallableDataKHR-04704
CallableDataKHR
storage class must only be used in ray generation, closest hit, miss, and callable shaders -
VUID-StandaloneSpirv-IncomingCallableDataKHR-04705
IncomingCallableDataKHR
storage class must only be used in callable shaders -
VUID-StandaloneSpirv-IncomingCallableDataKHR-04706
There must be at most one variable with theIncomingCallableDataKHR
storage class in the input interface of an entry point -
VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119
ShaderRecordBufferKHR
storage class must only be used in ray generation, intersection, any-hit, closest hit, callable, or miss shaders -
VUID-StandaloneSpirv-Base-04707
TheBase
operand ofOpPtrAccessChain
must point to one of the following: Workgroup, ifVariablePointers
is enabled; StorageBuffer, ifVariablePointers
orVariablePointersStorageBuffer
is enabled; PhysicalStorageBuffer, if thePhysicalStorageBuffer64
addressing model is enabled -
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708
If thePhysicalStorageBuffer64
addressing model is enabled, all instructions that support memory access operands and that use a physical pointer must include theAligned
operand -
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04709
If thePhysicalStorageBuffer64
addressing model is enabled, any access chain instruction that accesses into aRowMajor
matrix must only be used as thePointer
operand toOpLoad
orOpStore
-
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04710
If thePhysicalStorageBuffer64
addressing model is enabled,OpConvertUToPtr
andOpConvertPtrToU
must use an integer type whoseWidth
is 64 -
VUID-StandaloneSpirv-OpTypeForwardPointer-04711
OpTypeForwardPointer
must have a storage class ofPhysicalStorageBuffer
-
VUID-StandaloneSpirv-None-04745
All block members in a variable with a storage class of PushConstant declared as an array must only be accessed by dynamically uniform indices -
VUID-StandaloneSpirv-OpVariable-06673
There must not be more than oneOpVariable
in thePushConstant
storage class listed in theInterface
for eachOpEntryPoint
-
VUID-StandaloneSpirv-OpEntryPoint-06674
EachOpEntryPoint
must not statically use more than oneOpVariable
in thePushConstant
storage class -
VUID-StandaloneSpirv-Result-04780
TheResult
Type
operand of anyOpImageRead
orOpImageSparseRead
instruction must be a vector of four components -
VUID-StandaloneSpirv-Base-04781
TheBase
operand of anyOpBitCount
,OpBitReverse
,OpBitFieldInsert
,OpBitFieldSExtract
, orOpBitFieldUExtract
instruction must be a 32-bit integer scalar or a vector of 32-bit integers -
VUID-StandaloneSpirv-PushConstant-06675
Any variable in thePushConstant
orStorageBuffer
storage class must be decorated asBlock
-
VUID-StandaloneSpirv-Uniform-06676
Any variable in theUniform
storage class must be decorated asBlock
orBufferBlock
-
VUID-StandaloneSpirv-UniformConstant-06677
Any variable in theUniformConstant
,StorageBuffer
, orUniform
storage class must be decorated withDescriptorSet
andBinding
-
VUID-StandaloneSpirv-InputAttachmentIndex-06678
Variables decorated withInputAttachmentIndex
must be in theUniformConstant
storage class -
VUID-StandaloneSpirv-DescriptorSet-06491
If a variable is decorated byDescriptorSet
orBinding
, the storage class must correspond to an entry in Shader Resource and Storage Class Correspondence -
VUID-StandaloneSpirv-Input-06778
Variables with a storage class ofInput
in a fragment shader stage that are decorated withPerVertexKHR
must be declared as arrays -
VUID-StandaloneSpirv-MeshEXT-07102
The module must not contain both an entry point that uses theTaskEXT
orMeshEXT
Execution
Model
and an entry point that uses theTaskNV
orMeshNV
Execution
Model
-
VUID-StandaloneSpirv-MeshEXT-07106
In mesh shaders using theMeshEXT
Execution
Model
OpSetMeshOutputsEXT
must be called before any outputs are written -
VUID-StandaloneSpirv-MeshEXT-07107
In mesh shaders using theMeshEXT
Execution
Model
all variables declared as output must not be read from -
VUID-StandaloneSpirv-MeshEXT-07108
In mesh shaders using theMeshEXT
Execution
Model
forOpSetMeshOutputsEXT
instructions, the “Vertex Count” and “Primitive Count” operands must not depend onViewIndex
-
VUID-StandaloneSpirv-MeshEXT-07109
In mesh shaders using theMeshEXT
Execution
Model
variables decorated withPrimitivePointIndicesEXT
,PrimitiveLineIndicesEXT
, orPrimitiveTriangleIndicesEXT
declared as an array must not be accessed by indices that depend onViewIndex
-
VUID-StandaloneSpirv-MeshEXT-07110
In mesh shaders using theMeshEXT
Execution
Model
any values stored in variables decorated withPrimitivePointIndicesEXT
,PrimitiveLineIndicesEXT
, orPrimitiveTriangleIndicesEXT
must not depend onViewIndex
-
VUID-StandaloneSpirv-MeshEXT-07111
In mesh shaders using theMeshEXT
Execution
Model
variables in workgroup or private storage class declared as or containing a composite type must not be accessed by indices that depend onViewIndex
-
VUID-StandaloneSpirv-Input-07290
Variables with a storage class ofInput
orOutput
and a type ofOpTypeBool
must be decorated with theBuiltIn
decoration
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.