1 // Copyright (c) 2014-2017 The Khronos Group Inc.
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and/or associated documentation files (the "Materials"),
5 // to deal in the Materials without restriction, including without limitation
6 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 // and/or sell copies of the Materials, and to permit persons to whom the
8 // Materials are furnished to do so, subject to the following conditions:
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Materials.
13 // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
14 // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
15 // HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
17 // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 // FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
25 // This header is automatically generated by the same tool that creates
26 // the Binary Section of the SPIR-V specification.
28 // Enumeration tokens for SPIR-V, in various styles:
29 // C, C++, C++11, JSON, Lua, Python
31 // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
32 // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
33 // - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
34 // - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
35 // - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
37 // Some tokens act like mask values, which can be OR'd together,
38 // while others are mutually exclusive. The mask-like ones have
39 // "Mask" in their name, and a parallel enum that has the shift
40 // amount (1 << x) for each corresponding enumerant.
47 typedef unsigned int Id;
49 #define SPV_VERSION 0x10100
50 #define SPV_REVISION 7
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010100;
54 static const unsigned int Revision = 7;
55 static const unsigned int OpCodeMask = 0xffff;
56 static const unsigned int WordCountShift = 16;
58 enum class SourceLanguage : unsigned {
68 enum class ExecutionModel : unsigned {
70 TessellationControl = 1,
71 TessellationEvaluation = 2,
79 enum class AddressingModel : unsigned {
86 enum class MemoryModel : unsigned {
93 enum class ExecutionMode : unsigned {
96 SpacingFractionalEven = 2,
97 SpacingFractionalOdd = 3,
100 PixelCenterInteger = 6,
103 EarlyFragmentTests = 9,
114 InputLinesAdjacency = 21,
116 InputTrianglesAdjacency = 23,
121 OutputLineStrip = 28,
122 OutputTriangleStrip = 29,
128 SubgroupsPerWorkgroup = 36,
129 PostDepthCoverage = 4446,
133 enum class StorageClass : unsigned {
150 enum class Dim : unsigned {
161 enum class SamplerAddressingMode : unsigned {
170 enum class SamplerFilterMode : unsigned {
176 enum class ImageFormat : unsigned {
220 enum class ImageChannelOrder : unsigned {
244 enum class ImageChannelDataType : unsigned {
261 UnormInt101010_2 = 16,
265 enum class ImageOperandsShift : unsigned {
277 enum class ImageOperandsMask : unsigned {
282 ConstOffset = 0x00000008,
284 ConstOffsets = 0x00000020,
289 enum class FPFastMathModeShift : unsigned {
298 enum class FPFastMathModeMask : unsigned {
303 AllowRecip = 0x00000008,
307 enum class FPRoundingMode : unsigned {
315 enum class LinkageType : unsigned {
321 enum class AccessQualifier : unsigned {
328 enum class FunctionParameterAttribute : unsigned {
340 enum class Decoration : unsigned {
341 RelaxedPrecision = 0,
367 SaturatedConversion = 28,
380 LinkageAttributes = 41,
382 InputAttachmentIndex = 43,
385 ExplicitInterpAMD = 4999,
386 OverrideCoverageNV = 5248,
387 PassthroughNV = 5250,
388 ViewportRelativeNV = 5252,
389 SecondaryViewportRelativeNV = 5256,
393 enum class BuiltIn : unsigned {
415 HelperInvocation = 23,
419 LocalInvocationId = 27,
420 GlobalInvocationId = 28,
421 LocalInvocationIndex = 29,
424 EnqueuedWorkgroupSize = 32,
428 SubgroupMaxSize = 37,
430 NumEnqueuedSubgroups = 39,
432 SubgroupLocalInvocationId = 41,
435 SubgroupEqMaskKHR = 4416,
436 SubgroupGeMaskKHR = 4417,
437 SubgroupGtMaskKHR = 4418,
438 SubgroupLeMaskKHR = 4419,
439 SubgroupLtMaskKHR = 4420,
445 BaryCoordNoPerspAMD = 4992,
446 BaryCoordNoPerspCentroidAMD = 4993,
447 BaryCoordNoPerspSampleAMD = 4994,
448 BaryCoordSmoothAMD = 4995,
449 BaryCoordSmoothCentroidAMD = 4996,
450 BaryCoordSmoothSampleAMD = 4997,
451 BaryCoordPullModelAMD = 4998,
452 ViewportMaskNV = 5253,
453 SecondaryPositionNV = 5257,
454 SecondaryViewportMaskNV = 5258,
455 PositionPerViewNV = 5261,
456 ViewportMaskPerViewNV = 5262,
460 enum class SelectionControlShift : unsigned {
466 enum class SelectionControlMask : unsigned {
468 Flatten = 0x00000001,
469 DontFlatten = 0x00000002,
472 enum class LoopControlShift : unsigned {
475 DependencyInfinite = 2,
476 DependencyLength = 3,
480 enum class LoopControlMask : unsigned {
483 DontUnroll = 0x00000002,
484 DependencyInfinite = 0x00000004,
485 DependencyLength = 0x00000008,
488 enum class FunctionControlShift : unsigned {
496 enum class FunctionControlMask : unsigned {
499 DontInline = 0x00000002,
504 enum class MemorySemanticsShift : unsigned {
508 SequentiallyConsistent = 4,
512 CrossWorkgroupMemory = 9,
513 AtomicCounterMemory = 10,
518 enum class MemorySemanticsMask : unsigned {
520 Acquire = 0x00000002,
521 Release = 0x00000004,
522 AcquireRelease = 0x00000008,
523 SequentiallyConsistent = 0x00000010,
524 UniformMemory = 0x00000040,
525 SubgroupMemory = 0x00000080,
526 WorkgroupMemory = 0x00000100,
527 CrossWorkgroupMemory = 0x00000200,
528 AtomicCounterMemory = 0x00000400,
529 ImageMemory = 0x00000800,
532 enum class MemoryAccessShift : unsigned {
539 enum class MemoryAccessMask : unsigned {
541 Volatile = 0x00000001,
542 Aligned = 0x00000002,
543 Nontemporal = 0x00000004,
546 enum class Scope : unsigned {
555 enum class GroupOperation : unsigned {
562 enum class KernelEnqueueFlags : unsigned {
569 enum class KernelProfilingInfoShift : unsigned {
574 enum class KernelProfilingInfoMask : unsigned {
576 CmdExecTime = 0x00000001,
579 enum class Capability : unsigned {
602 TessellationPointSize = 23,
603 GeometryPointSize = 24,
604 ImageGatherExtended = 25,
605 StorageImageMultisample = 27,
606 UniformBufferArrayDynamicIndexing = 28,
607 SampledImageArrayDynamicIndexing = 29,
608 StorageBufferArrayDynamicIndexing = 30,
609 StorageImageArrayDynamicIndexing = 31,
613 SampleRateShading = 35,
618 InputAttachment = 40,
619 SparseResidency = 41,
623 SampledCubeArray = 45,
627 StorageImageExtendedFormats = 49,
629 DerivativeControl = 51,
630 InterpolationFunction = 52,
631 TransformFeedback = 53,
632 GeometryStreams = 54,
633 StorageImageReadWithoutFormat = 55,
634 StorageImageWriteWithoutFormat = 56,
636 SubgroupDispatch = 58,
639 SubgroupBallotKHR = 4423,
640 DrawParameters = 4427,
641 SubgroupVoteKHR = 4431,
642 StorageBuffer16BitAccess = 4433,
643 StorageUniformBufferBlock16 = 4433,
644 StorageUniform16 = 4434,
645 UniformAndStorageBuffer16BitAccess = 4434,
646 StoragePushConstant16 = 4435,
647 StorageInputOutput16 = 4436,
650 VariablePointersStorageBuffer = 4441,
651 VariablePointers = 4442,
652 AtomicStorageOps = 4445,
653 SampleMaskPostDepthCoverage = 4447,
654 ImageGatherBiasLodAMD = 5009,
655 SampleMaskOverrideCoverageNV = 5249,
656 GeometryShaderPassthroughNV = 5251,
657 ShaderViewportIndexLayerNV = 5254,
658 ShaderViewportMaskNV = 5255,
659 ShaderStereoViewNV = 5259,
660 PerViewAttributesNV = 5260,
664 enum class Op : unsigned {
667 OpSourceContinued = 2,
669 OpSourceExtension = 4,
675 OpExtInstImport = 11,
679 OpExecutionMode = 16,
689 OpTypeSampledImage = 27,
691 OpTypeRuntimeArray = 29,
697 OpTypeDeviceEvent = 35,
698 OpTypeReserveId = 36,
701 OpTypeForwardPointer = 39,
703 OpConstantFalse = 42,
705 OpConstantComposite = 44,
706 OpConstantSampler = 45,
708 OpSpecConstantTrue = 48,
709 OpSpecConstantFalse = 49,
711 OpSpecConstantComposite = 51,
712 OpSpecConstantOp = 52,
714 OpFunctionParameter = 55,
718 OpImageTexelPointer = 60,
722 OpCopyMemorySized = 64,
724 OpInBoundsAccessChain = 66,
725 OpPtrAccessChain = 67,
727 OpGenericPtrMemSemantics = 69,
728 OpInBoundsPtrAccessChain = 70,
730 OpMemberDecorate = 72,
731 OpDecorationGroup = 73,
732 OpGroupDecorate = 74,
733 OpGroupMemberDecorate = 75,
734 OpVectorExtractDynamic = 77,
735 OpVectorInsertDynamic = 78,
736 OpVectorShuffle = 79,
737 OpCompositeConstruct = 80,
738 OpCompositeExtract = 81,
739 OpCompositeInsert = 82,
743 OpImageSampleImplicitLod = 87,
744 OpImageSampleExplicitLod = 88,
745 OpImageSampleDrefImplicitLod = 89,
746 OpImageSampleDrefExplicitLod = 90,
747 OpImageSampleProjImplicitLod = 91,
748 OpImageSampleProjExplicitLod = 92,
749 OpImageSampleProjDrefImplicitLod = 93,
750 OpImageSampleProjDrefExplicitLod = 94,
753 OpImageDrefGather = 97,
757 OpImageQueryFormat = 101,
758 OpImageQueryOrder = 102,
759 OpImageQuerySizeLod = 103,
760 OpImageQuerySize = 104,
761 OpImageQueryLod = 105,
762 OpImageQueryLevels = 106,
763 OpImageQuerySamples = 107,
771 OpQuantizeToF16 = 116,
772 OpConvertPtrToU = 117,
773 OpSatConvertSToU = 118,
774 OpSatConvertUToS = 119,
775 OpConvertUToPtr = 120,
776 OpPtrCastToGeneric = 121,
777 OpGenericCastToPtr = 122,
778 OpGenericCastToPtrExplicit = 123,
796 OpVectorTimesScalar = 142,
797 OpMatrixTimesScalar = 143,
798 OpVectorTimesMatrix = 144,
799 OpMatrixTimesVector = 145,
800 OpMatrixTimesMatrix = 146,
801 OpOuterProduct = 147,
805 OpUMulExtended = 151,
806 OpSMulExtended = 152,
814 OpLessOrGreater = 161,
817 OpLogicalEqual = 164,
818 OpLogicalNotEqual = 165,
825 OpUGreaterThan = 172,
826 OpSGreaterThan = 173,
827 OpUGreaterThanEqual = 174,
828 OpSGreaterThanEqual = 175,
831 OpULessThanEqual = 178,
832 OpSLessThanEqual = 179,
835 OpFOrdNotEqual = 182,
836 OpFUnordNotEqual = 183,
837 OpFOrdLessThan = 184,
838 OpFUnordLessThan = 185,
839 OpFOrdGreaterThan = 186,
840 OpFUnordGreaterThan = 187,
841 OpFOrdLessThanEqual = 188,
842 OpFUnordLessThanEqual = 189,
843 OpFOrdGreaterThanEqual = 190,
844 OpFUnordGreaterThanEqual = 191,
845 OpShiftRightLogical = 194,
846 OpShiftRightArithmetic = 195,
847 OpShiftLeftLogical = 196,
852 OpBitFieldInsert = 201,
853 OpBitFieldSExtract = 202,
854 OpBitFieldUExtract = 203,
865 OpFwidthCoarse = 215,
867 OpEndPrimitive = 219,
868 OpEmitStreamVertex = 220,
869 OpEndStreamPrimitive = 221,
870 OpControlBarrier = 224,
871 OpMemoryBarrier = 225,
874 OpAtomicExchange = 229,
875 OpAtomicCompareExchange = 230,
876 OpAtomicCompareExchangeWeak = 231,
877 OpAtomicIIncrement = 232,
878 OpAtomicIDecrement = 233,
890 OpSelectionMerge = 247,
893 OpBranchConditional = 250,
899 OpLifetimeStart = 256,
900 OpLifetimeStop = 257,
901 OpGroupAsyncCopy = 259,
902 OpGroupWaitEvents = 260,
905 OpGroupBroadcast = 263,
916 OpReservedReadPipe = 276,
917 OpReservedWritePipe = 277,
918 OpReserveReadPipePackets = 278,
919 OpReserveWritePipePackets = 279,
920 OpCommitReadPipe = 280,
921 OpCommitWritePipe = 281,
922 OpIsValidReserveId = 282,
923 OpGetNumPipePackets = 283,
924 OpGetMaxPipePackets = 284,
925 OpGroupReserveReadPipePackets = 285,
926 OpGroupReserveWritePipePackets = 286,
927 OpGroupCommitReadPipe = 287,
928 OpGroupCommitWritePipe = 288,
929 OpEnqueueMarker = 291,
930 OpEnqueueKernel = 292,
931 OpGetKernelNDrangeSubGroupCount = 293,
932 OpGetKernelNDrangeMaxSubGroupSize = 294,
933 OpGetKernelWorkGroupSize = 295,
934 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
936 OpReleaseEvent = 298,
937 OpCreateUserEvent = 299,
938 OpIsValidEvent = 300,
939 OpSetUserEventStatus = 301,
940 OpCaptureEventProfilingInfo = 302,
941 OpGetDefaultQueue = 303,
942 OpBuildNDRange = 304,
943 OpImageSparseSampleImplicitLod = 305,
944 OpImageSparseSampleExplicitLod = 306,
945 OpImageSparseSampleDrefImplicitLod = 307,
946 OpImageSparseSampleDrefExplicitLod = 308,
947 OpImageSparseSampleProjImplicitLod = 309,
948 OpImageSparseSampleProjExplicitLod = 310,
949 OpImageSparseSampleProjDrefImplicitLod = 311,
950 OpImageSparseSampleProjDrefExplicitLod = 312,
951 OpImageSparseFetch = 313,
952 OpImageSparseGather = 314,
953 OpImageSparseDrefGather = 315,
954 OpImageSparseTexelsResident = 316,
956 OpAtomicFlagTestAndSet = 318,
957 OpAtomicFlagClear = 319,
958 OpImageSparseRead = 320,
960 OpTypePipeStorage = 322,
961 OpConstantPipeStorage = 323,
962 OpCreatePipeFromPipeStorage = 324,
963 OpGetKernelLocalSizeForSubgroupCount = 325,
964 OpGetKernelMaxNumSubgroups = 326,
965 OpTypeNamedBarrier = 327,
966 OpNamedBarrierInitialize = 328,
967 OpMemoryNamedBarrier = 329,
968 OpModuleProcessed = 330,
969 OpSubgroupBallotKHR = 4421,
970 OpSubgroupFirstInvocationKHR = 4422,
971 OpSubgroupAllKHR = 4428,
972 OpSubgroupAnyKHR = 4429,
973 OpSubgroupAllEqualKHR = 4430,
974 OpSubgroupReadInvocationKHR = 4432,
975 OpGroupIAddNonUniformAMD = 5000,
976 OpGroupFAddNonUniformAMD = 5001,
977 OpGroupFMinNonUniformAMD = 5002,
978 OpGroupUMinNonUniformAMD = 5003,
979 OpGroupSMinNonUniformAMD = 5004,
980 OpGroupFMaxNonUniformAMD = 5005,
981 OpGroupUMaxNonUniformAMD = 5006,
982 OpGroupSMaxNonUniformAMD = 5007,
986 // Overload operator| for mask bit combining
988 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
989 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
990 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
991 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
992 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
993 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
994 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
995 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
997 } // end namespace spv
999 #endif // #ifndef spirv_HPP