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
OpAtomicStoremust not use Acquire, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpAtomicLoad-04731
OpAtomicLoadmust not use Release, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpMemoryBarrier-04732
OpMemoryBarriermust use one of Acquire, Release, AcquireRelease, or SequentiallyConsistent memory semantics -
VUID-StandaloneSpirv-OpMemoryBarrier-04733
OpMemoryBarriermust include at least one storage class -
VUID-StandaloneSpirv-OpControlBarrier-04650
If the semantics forOpControlBarrierincludes one of Acquire, Release, AcquireRelease, or SequentiallyConsistent memory semantics, then it must include at least one storage class -
VUID-StandaloneSpirv-OpVariable-04651
AnyOpVariablewith anInitializeroperand must have Output, Private, Function, or Workgroup as its Storage Class operand -
VUID-StandaloneSpirv-OpVariable-04734
AnyOpVariablewith anInitializeroperand and Workgroup as its Storage Class operand must useOpConstantNullas the initializer -
VUID-StandaloneSpirv-OpReadClockKHR-04652
Scope forOpReadClockKHRmust be limited to Subgroup or Device -
VUID-StandaloneSpirv-OriginLowerLeft-04653
TheOriginLowerLeftexecution mode must not be used; fragment entry points must declareOriginUpperLeft -
VUID-StandaloneSpirv-PixelCenterInteger-04654
ThePixelCenterIntegerexecution mode must not be used (pixels are always centered at half-integer coordinates) -
VUID-StandaloneSpirv-UniformConstant-04655
Any variable in theUniformConstantstorage class must be typed as eitherOpTypeImage,OpTypeSampler,OpTypeSampledImage,OpTypeAccelerationStructureKHR, or an array of one of these types -
VUID-StandaloneSpirv-Uniform-06807
Any variable in theUniformorStorageBufferstorage class must be typed asOpTypeStructor an array of this type -
VUID-StandaloneSpirv-PushConstant-06808
Any variable in thePushConstantstorage class must be typed asOpTypeStruct -
VUID-StandaloneSpirv-OpTypeImage-04656
OpTypeImagemust declare a scalar 32-bit float, 64-bit integer, or 32-bit integer type for the “Sampled Type” (RelaxedPrecisioncan be applied to a sampling instruction and to the variable holding the result of a sampling instruction) -
VUID-StandaloneSpirv-OpTypeImage-04657
OpTypeImagemust have a “Sampled” operand of 1 (sampled image) or 2 (storage image) -
VUID-StandaloneSpirv-OpTypeSampledImage-06671
OpTypeSampledImagemust have aOpTypeImagewith a “Sampled” operand of 1 (sampled image) -
VUID-StandaloneSpirv-Image-04965
The converted bit width, signedness, and numeric type of theImageFormatoperand of anOpTypeImagemust match theSampledType, as defined in https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-format-type-matching -
VUID-StandaloneSpirv-OpImageTexelPointer-04658
If anOpImageTexelPointeris used in an atomic operation, the image type of theimageparameter toOpImageTexelPointermust have an image format ofR64i,R64ui,R32f,R32i, orR32ui -
VUID-StandaloneSpirv-OpImageQuerySizeLod-04659
OpImageQuerySizeLod,OpImageQueryLod, andOpImageQueryLevelsmust only consume an “Image” operand whose type has its “Sampled” operand set to 1 -
VUID-StandaloneSpirv-OpTypeImage-06214
AnOpTypeImagewith a “Dim” operand ofSubpassDatamust 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 aSubpassDatamust 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 theUniformstorage class decorated asBlockmust not be stored to or modified -
VUID-StandaloneSpirv-Offset-04662
Any image operation must use at most one of theOffset,ConstOffset, andConstOffsetsimage operands -
VUID-StandaloneSpirv-Offset-04663
Image operandOffsetmust only be used withOpImage*Gatherinstructions -
VUID-StandaloneSpirv-Offset-04865
Any image instruction which uses anOffset,ConstOffset, orConstOffsetsimage 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, andOpImageSparseGathermust be the <id> of a constant instruction -
VUID-StandaloneSpirv-OpImage-04777
OpImage*Dref*instructions must not consume an image whoseDimis 3D -
VUID-StandaloneSpirv-OpReportIntersectionKHR-04666
The value of the “Hit Kind” operand ofOpReportIntersectionKHRmust be in the range [0,127] -
VUID-StandaloneSpirv-None-04667
Structure types must not contain opaque types -
VUID-StandaloneSpirv-BuiltIn-04668
AnyBuiltIndecoration not listed in https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#interfaces-builtin-variables must not be used -
VUID-StandaloneSpirv-Location-06672
TheLocationorComponentdecorations must only be used with theInput,Output,RayPayloadKHR,IncomingRayPayloadKHR,HitAttributeKHR,CallableDataKHR,IncomingCallableDataKHR, orShaderRecordBufferKHRstorage classes -
VUID-StandaloneSpirv-Location-04915
TheLocationorComponentdecorations must not be used withBuiltIn -
VUID-StandaloneSpirv-Location-04916
TheLocationdecorations must be used on user-defined variables -
VUID-StandaloneSpirv-Location-04917
TheLocationdecorations must be used on anOpVariablewith a structure type that is not a block -
VUID-StandaloneSpirv-Location-04918
TheLocationdecorations must not be used on the members ofOpVariablewith a structure type that is decorated withLocation -
VUID-StandaloneSpirv-Location-04919
TheLocationdecorations must be used on each member ofOpVariablewith a structure type that is a block not decorated withLocation -
VUID-StandaloneSpirv-Component-04920
TheComponentdecoration value must not be greater than 3 -
VUID-StandaloneSpirv-Component-04921
If theComponentdecoration is used on anOpVariablethat has aOpTypeVectortype with aComponentTypewith aWidththat is less than or equal to 32, the sum of itsComponentCountand theComponentdecoration value must be less than 4 -
VUID-StandaloneSpirv-Component-04922
If theComponentdecoration is used on anOpVariablethat has aOpTypeVectortype with aComponentTypewith aWidththat is equal to 64, the sum of two times itsComponentCountand theComponentdecoration value must be less than 4 -
VUID-StandaloneSpirv-Component-04923
TheComponentdecorations value must not be 1 or 3 for scalar or two-component 64-bit data types -
VUID-StandaloneSpirv-Component-04924
TheComponentdecorations must not used with any type that is not a scalar or vector -
VUID-StandaloneSpirv-GLSLShared-04669
TheGLSLSharedandGLSLPackeddecorations must not be used -
VUID-StandaloneSpirv-Flat-04670
TheFlat,NoPerspective,Sample, andCentroiddecorations must only be used on variables with theOutputorInputstorage class -
VUID-StandaloneSpirv-Flat-06201
TheFlat,NoPerspective,Sample, andCentroiddecorations must not be used on variables with theOutputstorage class in a fragment shader -
VUID-StandaloneSpirv-Flat-06202
TheFlat,NoPerspective,Sample, andCentroiddecorations must not be used on variables with theInputstorage class in a vertex shader -
VUID-StandaloneSpirv-PerVertexKHR-06777
ThePerVertexKHRdecoration must only be used on variables with theInputstorage class in a fragment shader -
VUID-StandaloneSpirv-Flat-04744
Any variable with integer or double-precision floating-point type and withInputstorage class in a fragment shader, must be decoratedFlat -
VUID-StandaloneSpirv-ViewportRelativeNV-04672
TheViewportRelativeNVdecoration must only be used on a variable decorated withLayerin the vertex, tessellation evaluation, or geometry shader stages -
VUID-StandaloneSpirv-ViewportRelativeNV-04673
TheViewportRelativeNVdecoration must not be used unless a variable decorated with one ofViewportIndexorViewportMaskNVis also statically used by the sameOpEntryPoint -
VUID-StandaloneSpirv-ViewportMaskNV-04674
TheViewportMaskNVandViewportIndexdecorations 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 theFPRoundingModedecoration -
VUID-StandaloneSpirv-Invariant-04677
Variables decorated withInvariantand variables with structure types that have any members decorated withInvariantmust be in theOutputorInputstorage class,Invariantused on anInputstorage class variable or structure member has no effect -
VUID-StandaloneSpirv-VulkanMemoryModel-04678
If theVulkanMemoryModelcapability is not declared, theVolatiledecoration must be used on any variable declaration that includes one of theSMIDNV,WarpIDNV,SubgroupSize,SubgroupLocalInvocationId,SubgroupEqMask,SubgroupGeMask,SubgroupGtMask,SubgroupLeMask, orSubgroupLtMaskBuiltIndecorations when used in the ray generation, closest hit, miss, intersection, or callable shaders, or with theRayTmaxKHRBuiltindecoration when used in an intersection shader -
VUID-StandaloneSpirv-VulkanMemoryModel-04679
If theVulkanMemoryModelcapability is declared, theOpLoadinstruction must use theVolatilememory semantics when it accesses into any variable that includes one of theSMIDNV,WarpIDNV,SubgroupSize,SubgroupLocalInvocationId,SubgroupEqMask,SubgroupGeMask,SubgroupGtMask,SubgroupLeMask, orSubgroupLtMaskBuiltIndecorations when used in the ray generation, closest hit, miss, intersection, or callable shaders, or with theRayTmaxKHRBuiltindecoration when used in an intersection shader -
VUID-StandaloneSpirv-OpTypeRuntimeArray-04680
OpTypeRuntimeArraymust only be used for the last member of aBlock-decoratedOpTypeStructinStorageBufferorPhysicalStorageBufferstorage classes;BufferBlock-decoratedOpTypeStructinUniformstorage class; the outermost dimension of an arrayed variable in theStorageBuffer,Uniform, orUniformConstantstorage 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, orPrivatestorage classes, c) V is a non-Block variable in theWorkgroupstorage 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
IfOpControlBarrieris 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 aLocalSizeorLocalSizeIdexecution mode, or an object decorated with theWorkgroupSizedecoration must be specified -
VUID-StandaloneSpirv-DerivativeGroupQuadsNV-04684
For compute shaders using theDerivativeGroupQuadsNVexecution mode, the first two dimensions of the local workgroup size must be a multiple of two -
VUID-StandaloneSpirv-DerivativeGroupLinearNV-04778
For compute shaders using theDerivativeGroupLinearNVexecution mode, the product of the dimensions of the local workgroup size must be a multiple of four -
VUID-StandaloneSpirv-OpGroupNonUniformBallotBitCount-04685
IfOpGroupNonUniformBallotBitCountis 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, or PhysicalStorageBuffer -
VUID-StandaloneSpirv-Offset-04687
Output variables or block members decorated withOffsetthat have a 64-bit type, or a composite type containing a 64-bit type, must specify anOffsetvalue aligned to a 8 byte boundary -
VUID-StandaloneSpirv-Offset-04689
The size of any output block containing any member decorated withOffsetthat is a 64-bit type must be a multiple of 8 -
VUID-StandaloneSpirv-Offset-04690
The first member of an output block specifying aOffsetdecoration must specify aOffsetvalue that is aligned to an 8 byte boundary if that block contains any member decorated withOffsetand is a 64-bit type -
VUID-StandaloneSpirv-Offset-04691
Output variables or block members decorated withOffsetthat have a 32-bit type, or a composite type contains a 32-bit type, must specify anOffsetvalue aligned to a 4 byte boundary -
VUID-StandaloneSpirv-Offset-04692
Output variables, blocks or block members decorated withOffsetmust 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 withOffsetcan be captured for transform feedback, and those variables or block members must also be decorated withXfbBufferandXfbStride, or inheritXfbBufferandXfbStridedecorations 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 specificXfbBuffervalue must all be decorated with identicalXfbStridevalues -
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 sameXfbBuffermust specify the sameStreamvalue -
VUID-StandaloneSpirv-XfbBuffer-04696
For any two variables or block members in the output interface of the entry point being compiled with the sameXfbBuffervalue, the ranges determined by theOffsetdecoration 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 inheritedXfbBufferdecoration must specify the sameXfbBuffervalue -
VUID-StandaloneSpirv-RayPayloadKHR-04698
RayPayloadKHRstorage class must only be used in ray generation, closest hit or miss shaders -
VUID-StandaloneSpirv-IncomingRayPayloadKHR-04699
IncomingRayPayloadKHRstorage 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 theIncomingRayPayloadKHRstorage class in the input interface of an entry point -
VUID-StandaloneSpirv-HitAttributeKHR-04701
HitAttributeKHRstorage 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 theHitAttributeKHRstorage class in the input interface of an entry point -
VUID-StandaloneSpirv-HitAttributeKHR-04703
A variable withHitAttributeKHRstorage class must only be written to in an intersection shader -
VUID-StandaloneSpirv-CallableDataKHR-04704
CallableDataKHRstorage class must only be used in ray generation, closest hit, miss, and callable shaders -
VUID-StandaloneSpirv-IncomingCallableDataKHR-04705
IncomingCallableDataKHRstorage class must only be used in callable shaders -
VUID-StandaloneSpirv-IncomingCallableDataKHR-04706
There must be at most one variable with theIncomingCallableDataKHRstorage class in the input interface of an entry point -
VUID-StandaloneSpirv-Base-04707
TheBaseoperand ofOpPtrAccessChainmust point to one of the following: Workgroup, ifVariablePointersis enabled; StorageBuffer, ifVariablePointersorVariablePointersStorageBufferis enabled; PhysicalStorageBuffer, if thePhysicalStorageBuffer64addressing model is enabled -
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708
If thePhysicalStorageBuffer64addressing model is enabled, all instructions that support memory access operands and that use a physical pointer must include theAlignedoperand -
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04709
If thePhysicalStorageBuffer64addressing model is enabled, any access chain instruction that accesses into aRowMajormatrix must only be used as thePointeroperand toOpLoadorOpStore -
VUID-StandaloneSpirv-PhysicalStorageBuffer64-04710
If thePhysicalStorageBuffer64addressing model is enabled,OpConvertUToPtrandOpConvertPtrToUmust use an integer type whoseWidthis 64 -
VUID-StandaloneSpirv-OpTypeForwardPointer-04711
OpTypeForwardPointermust 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 oneOpVariablein thePushConstantstorage class listed in theInterfacefor eachOpEntryPoint -
VUID-StandaloneSpirv-OpEntryPoint-06674
EachOpEntryPointmust not statically use more than oneOpVariablein thePushConstantstorage class -
VUID-StandaloneSpirv-Result-04780
TheResultTypeoperand of anyOpImageReadorOpImageSparseReadinstruction must be a vector of four components -
VUID-StandaloneSpirv-Base-04781
TheBaseoperand of anyOpBitCount,OpBitReverse,OpBitFieldInsert,OpBitFieldSExtract, orOpBitFieldUExtractinstruction must be a 32-bit integer scalar or a vector of 32-bit integers -
VUID-StandaloneSpirv-PushConstant-06675
Any variable in thePushConstantorStorageBufferstorage class must be decorated asBlock -
VUID-StandaloneSpirv-Uniform-06676
Any variable in theUniformstorage class must be decorated asBlockorBufferBlock -
VUID-StandaloneSpirv-UniformConstant-06677
Any variable in theUniformConstant,StorageBuffer, orUniformstorage class must be decorated withDescriptorSetandBinding -
VUID-StandaloneSpirv-InputAttachmentIndex-06678
Variables decorated withInputAttachmentIndexmust be in theUniformConstantstorage class -
VUID-StandaloneSpirv-DescriptorSet-06491
If a variable is decorated byDescriptorSetorBinding, the storage class must correspond to an entry in Shader Resource and Storage Class Correspondence -
VUID-StandaloneSpirv-Input-06778
Variables with a storage class ofInputin a fragment shader stage that are decorated withPerVertexKHRmust be declared as arrays
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.