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 0x10000
50 #define SPV_REVISION 11
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010000;
54 static const unsigned int Revision = 11;
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,
125 PostDepthCoverage = 4446,
129 enum class StorageClass : unsigned {
146 enum class Dim : unsigned {
157 enum class SamplerAddressingMode : unsigned {
166 enum class SamplerFilterMode : unsigned {
172 enum class ImageFormat : unsigned {
216 enum class ImageChannelOrder : unsigned {
240 enum class ImageChannelDataType : unsigned {
257 UnormInt101010_2 = 16,
261 enum class ImageOperandsShift : unsigned {
273 enum class ImageOperandsMask : unsigned {
278 ConstOffset = 0x00000008,
280 ConstOffsets = 0x00000020,
285 enum class FPFastMathModeShift : unsigned {
294 enum class FPFastMathModeMask : unsigned {
299 AllowRecip = 0x00000008,
303 enum class FPRoundingMode : unsigned {
311 enum class LinkageType : unsigned {
317 enum class AccessQualifier : unsigned {
324 enum class FunctionParameterAttribute : unsigned {
336 enum class Decoration : unsigned {
337 RelaxedPrecision = 0,
363 SaturatedConversion = 28,
376 LinkageAttributes = 41,
378 InputAttachmentIndex = 43,
380 ExplicitInterpAMD = 4999,
381 OverrideCoverageNV = 5248,
382 PassthroughNV = 5250,
383 ViewportRelativeNV = 5252,
384 SecondaryViewportRelativeNV = 5256,
388 enum class BuiltIn : unsigned {
410 HelperInvocation = 23,
414 LocalInvocationId = 27,
415 GlobalInvocationId = 28,
416 LocalInvocationIndex = 29,
419 EnqueuedWorkgroupSize = 32,
423 SubgroupMaxSize = 37,
425 NumEnqueuedSubgroups = 39,
427 SubgroupLocalInvocationId = 41,
430 SubgroupEqMaskKHR = 4416,
431 SubgroupGeMaskKHR = 4417,
432 SubgroupGtMaskKHR = 4418,
433 SubgroupLeMaskKHR = 4419,
434 SubgroupLtMaskKHR = 4420,
440 BaryCoordNoPerspAMD = 4992,
441 BaryCoordNoPerspCentroidAMD = 4993,
442 BaryCoordNoPerspSampleAMD = 4994,
443 BaryCoordSmoothAMD = 4995,
444 BaryCoordSmoothCentroidAMD = 4996,
445 BaryCoordSmoothSampleAMD = 4997,
446 BaryCoordPullModelAMD = 4998,
447 ViewportMaskNV = 5253,
448 SecondaryPositionNV = 5257,
449 SecondaryViewportMaskNV = 5258,
450 PositionPerViewNV = 5261,
451 ViewportMaskPerViewNV = 5262,
455 enum class SelectionControlShift : unsigned {
461 enum class SelectionControlMask : unsigned {
463 Flatten = 0x00000001,
464 DontFlatten = 0x00000002,
467 enum class LoopControlShift : unsigned {
473 enum class LoopControlMask : unsigned {
476 DontUnroll = 0x00000002,
479 enum class FunctionControlShift : unsigned {
487 enum class FunctionControlMask : unsigned {
490 DontInline = 0x00000002,
495 enum class MemorySemanticsShift : unsigned {
499 SequentiallyConsistent = 4,
503 CrossWorkgroupMemory = 9,
504 AtomicCounterMemory = 10,
509 enum class MemorySemanticsMask : unsigned {
511 Acquire = 0x00000002,
512 Release = 0x00000004,
513 AcquireRelease = 0x00000008,
514 SequentiallyConsistent = 0x00000010,
515 UniformMemory = 0x00000040,
516 SubgroupMemory = 0x00000080,
517 WorkgroupMemory = 0x00000100,
518 CrossWorkgroupMemory = 0x00000200,
519 AtomicCounterMemory = 0x00000400,
520 ImageMemory = 0x00000800,
523 enum class MemoryAccessShift : unsigned {
530 enum class MemoryAccessMask : unsigned {
532 Volatile = 0x00000001,
533 Aligned = 0x00000002,
534 Nontemporal = 0x00000004,
537 enum class Scope : unsigned {
546 enum class GroupOperation : unsigned {
553 enum class KernelEnqueueFlags : unsigned {
560 enum class KernelProfilingInfoShift : unsigned {
565 enum class KernelProfilingInfoMask : unsigned {
567 CmdExecTime = 0x00000001,
570 enum class Capability : unsigned {
593 TessellationPointSize = 23,
594 GeometryPointSize = 24,
595 ImageGatherExtended = 25,
596 StorageImageMultisample = 27,
597 UniformBufferArrayDynamicIndexing = 28,
598 SampledImageArrayDynamicIndexing = 29,
599 StorageBufferArrayDynamicIndexing = 30,
600 StorageImageArrayDynamicIndexing = 31,
604 SampleRateShading = 35,
609 InputAttachment = 40,
610 SparseResidency = 41,
614 SampledCubeArray = 45,
618 StorageImageExtendedFormats = 49,
620 DerivativeControl = 51,
621 InterpolationFunction = 52,
622 TransformFeedback = 53,
623 GeometryStreams = 54,
624 StorageImageReadWithoutFormat = 55,
625 StorageImageWriteWithoutFormat = 56,
627 SubgroupBallotKHR = 4423,
628 DrawParameters = 4427,
629 SubgroupVoteKHR = 4431,
630 StorageBuffer16BitAccess = 4433,
631 StorageUniformBufferBlock16 = 4433,
632 StorageUniform16 = 4434,
633 UniformAndStorageBuffer16BitAccess = 4434,
634 StoragePushConstant16 = 4435,
635 StorageInputOutput16 = 4436,
638 VariablePointersStorageBuffer = 4441,
639 VariablePointers = 4442,
640 AtomicStorageOps = 4445,
641 SampleMaskPostDepthCoverage = 4447,
642 ImageGatherBiasLodAMD = 5009,
643 SampleMaskOverrideCoverageNV = 5249,
644 GeometryShaderPassthroughNV = 5251,
645 ShaderViewportIndexLayerNV = 5254,
646 ShaderViewportMaskNV = 5255,
647 ShaderStereoViewNV = 5259,
648 PerViewAttributesNV = 5260,
652 enum class Op : unsigned {
655 OpSourceContinued = 2,
657 OpSourceExtension = 4,
663 OpExtInstImport = 11,
667 OpExecutionMode = 16,
677 OpTypeSampledImage = 27,
679 OpTypeRuntimeArray = 29,
685 OpTypeDeviceEvent = 35,
686 OpTypeReserveId = 36,
689 OpTypeForwardPointer = 39,
691 OpConstantFalse = 42,
693 OpConstantComposite = 44,
694 OpConstantSampler = 45,
696 OpSpecConstantTrue = 48,
697 OpSpecConstantFalse = 49,
699 OpSpecConstantComposite = 51,
700 OpSpecConstantOp = 52,
702 OpFunctionParameter = 55,
706 OpImageTexelPointer = 60,
710 OpCopyMemorySized = 64,
712 OpInBoundsAccessChain = 66,
713 OpPtrAccessChain = 67,
715 OpGenericPtrMemSemantics = 69,
716 OpInBoundsPtrAccessChain = 70,
718 OpMemberDecorate = 72,
719 OpDecorationGroup = 73,
720 OpGroupDecorate = 74,
721 OpGroupMemberDecorate = 75,
722 OpVectorExtractDynamic = 77,
723 OpVectorInsertDynamic = 78,
724 OpVectorShuffle = 79,
725 OpCompositeConstruct = 80,
726 OpCompositeExtract = 81,
727 OpCompositeInsert = 82,
731 OpImageSampleImplicitLod = 87,
732 OpImageSampleExplicitLod = 88,
733 OpImageSampleDrefImplicitLod = 89,
734 OpImageSampleDrefExplicitLod = 90,
735 OpImageSampleProjImplicitLod = 91,
736 OpImageSampleProjExplicitLod = 92,
737 OpImageSampleProjDrefImplicitLod = 93,
738 OpImageSampleProjDrefExplicitLod = 94,
741 OpImageDrefGather = 97,
745 OpImageQueryFormat = 101,
746 OpImageQueryOrder = 102,
747 OpImageQuerySizeLod = 103,
748 OpImageQuerySize = 104,
749 OpImageQueryLod = 105,
750 OpImageQueryLevels = 106,
751 OpImageQuerySamples = 107,
759 OpQuantizeToF16 = 116,
760 OpConvertPtrToU = 117,
761 OpSatConvertSToU = 118,
762 OpSatConvertUToS = 119,
763 OpConvertUToPtr = 120,
764 OpPtrCastToGeneric = 121,
765 OpGenericCastToPtr = 122,
766 OpGenericCastToPtrExplicit = 123,
784 OpVectorTimesScalar = 142,
785 OpMatrixTimesScalar = 143,
786 OpVectorTimesMatrix = 144,
787 OpMatrixTimesVector = 145,
788 OpMatrixTimesMatrix = 146,
789 OpOuterProduct = 147,
793 OpUMulExtended = 151,
794 OpSMulExtended = 152,
802 OpLessOrGreater = 161,
805 OpLogicalEqual = 164,
806 OpLogicalNotEqual = 165,
813 OpUGreaterThan = 172,
814 OpSGreaterThan = 173,
815 OpUGreaterThanEqual = 174,
816 OpSGreaterThanEqual = 175,
819 OpULessThanEqual = 178,
820 OpSLessThanEqual = 179,
823 OpFOrdNotEqual = 182,
824 OpFUnordNotEqual = 183,
825 OpFOrdLessThan = 184,
826 OpFUnordLessThan = 185,
827 OpFOrdGreaterThan = 186,
828 OpFUnordGreaterThan = 187,
829 OpFOrdLessThanEqual = 188,
830 OpFUnordLessThanEqual = 189,
831 OpFOrdGreaterThanEqual = 190,
832 OpFUnordGreaterThanEqual = 191,
833 OpShiftRightLogical = 194,
834 OpShiftRightArithmetic = 195,
835 OpShiftLeftLogical = 196,
840 OpBitFieldInsert = 201,
841 OpBitFieldSExtract = 202,
842 OpBitFieldUExtract = 203,
853 OpFwidthCoarse = 215,
855 OpEndPrimitive = 219,
856 OpEmitStreamVertex = 220,
857 OpEndStreamPrimitive = 221,
858 OpControlBarrier = 224,
859 OpMemoryBarrier = 225,
862 OpAtomicExchange = 229,
863 OpAtomicCompareExchange = 230,
864 OpAtomicCompareExchangeWeak = 231,
865 OpAtomicIIncrement = 232,
866 OpAtomicIDecrement = 233,
878 OpSelectionMerge = 247,
881 OpBranchConditional = 250,
887 OpLifetimeStart = 256,
888 OpLifetimeStop = 257,
889 OpGroupAsyncCopy = 259,
890 OpGroupWaitEvents = 260,
893 OpGroupBroadcast = 263,
904 OpReservedReadPipe = 276,
905 OpReservedWritePipe = 277,
906 OpReserveReadPipePackets = 278,
907 OpReserveWritePipePackets = 279,
908 OpCommitReadPipe = 280,
909 OpCommitWritePipe = 281,
910 OpIsValidReserveId = 282,
911 OpGetNumPipePackets = 283,
912 OpGetMaxPipePackets = 284,
913 OpGroupReserveReadPipePackets = 285,
914 OpGroupReserveWritePipePackets = 286,
915 OpGroupCommitReadPipe = 287,
916 OpGroupCommitWritePipe = 288,
917 OpEnqueueMarker = 291,
918 OpEnqueueKernel = 292,
919 OpGetKernelNDrangeSubGroupCount = 293,
920 OpGetKernelNDrangeMaxSubGroupSize = 294,
921 OpGetKernelWorkGroupSize = 295,
922 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
924 OpReleaseEvent = 298,
925 OpCreateUserEvent = 299,
926 OpIsValidEvent = 300,
927 OpSetUserEventStatus = 301,
928 OpCaptureEventProfilingInfo = 302,
929 OpGetDefaultQueue = 303,
930 OpBuildNDRange = 304,
931 OpImageSparseSampleImplicitLod = 305,
932 OpImageSparseSampleExplicitLod = 306,
933 OpImageSparseSampleDrefImplicitLod = 307,
934 OpImageSparseSampleDrefExplicitLod = 308,
935 OpImageSparseSampleProjImplicitLod = 309,
936 OpImageSparseSampleProjExplicitLod = 310,
937 OpImageSparseSampleProjDrefImplicitLod = 311,
938 OpImageSparseSampleProjDrefExplicitLod = 312,
939 OpImageSparseFetch = 313,
940 OpImageSparseGather = 314,
941 OpImageSparseDrefGather = 315,
942 OpImageSparseTexelsResident = 316,
944 OpAtomicFlagTestAndSet = 318,
945 OpAtomicFlagClear = 319,
946 OpImageSparseRead = 320,
947 OpSubgroupBallotKHR = 4421,
948 OpSubgroupFirstInvocationKHR = 4422,
949 OpSubgroupAllKHR = 4428,
950 OpSubgroupAnyKHR = 4429,
951 OpSubgroupAllEqualKHR = 4430,
952 OpSubgroupReadInvocationKHR = 4432,
953 OpGroupIAddNonUniformAMD = 5000,
954 OpGroupFAddNonUniformAMD = 5001,
955 OpGroupFMinNonUniformAMD = 5002,
956 OpGroupUMinNonUniformAMD = 5003,
957 OpGroupSMinNonUniformAMD = 5004,
958 OpGroupFMaxNonUniformAMD = 5005,
959 OpGroupUMaxNonUniformAMD = 5006,
960 OpGroupSMaxNonUniformAMD = 5007,
964 // Overload operator| for mask bit combining
966 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
967 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
968 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
969 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
970 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
971 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
972 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
973 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
975 } // end namespace spv
977 #endif // #ifndef spirv_HPP