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 8
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010100;
54 static const unsigned int Revision = 8;
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,
130 StencilRefReplacingEXT = 5027,
134 enum class StorageClass : unsigned {
151 enum class Dim : unsigned {
162 enum class SamplerAddressingMode : unsigned {
171 enum class SamplerFilterMode : unsigned {
177 enum class ImageFormat : unsigned {
221 enum class ImageChannelOrder : unsigned {
245 enum class ImageChannelDataType : unsigned {
262 UnormInt101010_2 = 16,
266 enum class ImageOperandsShift : unsigned {
278 enum class ImageOperandsMask : unsigned {
283 ConstOffset = 0x00000008,
285 ConstOffsets = 0x00000020,
290 enum class FPFastMathModeShift : unsigned {
299 enum class FPFastMathModeMask : unsigned {
304 AllowRecip = 0x00000008,
308 enum class FPRoundingMode : unsigned {
316 enum class LinkageType : unsigned {
322 enum class AccessQualifier : unsigned {
329 enum class FunctionParameterAttribute : unsigned {
341 enum class Decoration : unsigned {
342 RelaxedPrecision = 0,
368 SaturatedConversion = 28,
381 LinkageAttributes = 41,
383 InputAttachmentIndex = 43,
386 ExplicitInterpAMD = 4999,
387 OverrideCoverageNV = 5248,
388 PassthroughNV = 5250,
389 ViewportRelativeNV = 5252,
390 SecondaryViewportRelativeNV = 5256,
394 enum class BuiltIn : unsigned {
416 HelperInvocation = 23,
420 LocalInvocationId = 27,
421 GlobalInvocationId = 28,
422 LocalInvocationIndex = 29,
425 EnqueuedWorkgroupSize = 32,
429 SubgroupMaxSize = 37,
431 NumEnqueuedSubgroups = 39,
433 SubgroupLocalInvocationId = 41,
436 SubgroupEqMaskKHR = 4416,
437 SubgroupGeMaskKHR = 4417,
438 SubgroupGtMaskKHR = 4418,
439 SubgroupLeMaskKHR = 4419,
440 SubgroupLtMaskKHR = 4420,
446 BaryCoordNoPerspAMD = 4992,
447 BaryCoordNoPerspCentroidAMD = 4993,
448 BaryCoordNoPerspSampleAMD = 4994,
449 BaryCoordSmoothAMD = 4995,
450 BaryCoordSmoothCentroidAMD = 4996,
451 BaryCoordSmoothSampleAMD = 4997,
452 BaryCoordPullModelAMD = 4998,
453 FragStencilRefEXT = 5014,
454 ViewportMaskNV = 5253,
455 SecondaryPositionNV = 5257,
456 SecondaryViewportMaskNV = 5258,
457 PositionPerViewNV = 5261,
458 ViewportMaskPerViewNV = 5262,
462 enum class SelectionControlShift : unsigned {
468 enum class SelectionControlMask : unsigned {
470 Flatten = 0x00000001,
471 DontFlatten = 0x00000002,
474 enum class LoopControlShift : unsigned {
477 DependencyInfinite = 2,
478 DependencyLength = 3,
482 enum class LoopControlMask : unsigned {
485 DontUnroll = 0x00000002,
486 DependencyInfinite = 0x00000004,
487 DependencyLength = 0x00000008,
490 enum class FunctionControlShift : unsigned {
498 enum class FunctionControlMask : unsigned {
501 DontInline = 0x00000002,
506 enum class MemorySemanticsShift : unsigned {
510 SequentiallyConsistent = 4,
514 CrossWorkgroupMemory = 9,
515 AtomicCounterMemory = 10,
520 enum class MemorySemanticsMask : unsigned {
522 Acquire = 0x00000002,
523 Release = 0x00000004,
524 AcquireRelease = 0x00000008,
525 SequentiallyConsistent = 0x00000010,
526 UniformMemory = 0x00000040,
527 SubgroupMemory = 0x00000080,
528 WorkgroupMemory = 0x00000100,
529 CrossWorkgroupMemory = 0x00000200,
530 AtomicCounterMemory = 0x00000400,
531 ImageMemory = 0x00000800,
534 enum class MemoryAccessShift : unsigned {
541 enum class MemoryAccessMask : unsigned {
543 Volatile = 0x00000001,
544 Aligned = 0x00000002,
545 Nontemporal = 0x00000004,
548 enum class Scope : unsigned {
557 enum class GroupOperation : unsigned {
564 enum class KernelEnqueueFlags : unsigned {
571 enum class KernelProfilingInfoShift : unsigned {
576 enum class KernelProfilingInfoMask : unsigned {
578 CmdExecTime = 0x00000001,
581 enum class Capability : unsigned {
604 TessellationPointSize = 23,
605 GeometryPointSize = 24,
606 ImageGatherExtended = 25,
607 StorageImageMultisample = 27,
608 UniformBufferArrayDynamicIndexing = 28,
609 SampledImageArrayDynamicIndexing = 29,
610 StorageBufferArrayDynamicIndexing = 30,
611 StorageImageArrayDynamicIndexing = 31,
615 SampleRateShading = 35,
620 InputAttachment = 40,
621 SparseResidency = 41,
625 SampledCubeArray = 45,
629 StorageImageExtendedFormats = 49,
631 DerivativeControl = 51,
632 InterpolationFunction = 52,
633 TransformFeedback = 53,
634 GeometryStreams = 54,
635 StorageImageReadWithoutFormat = 55,
636 StorageImageWriteWithoutFormat = 56,
638 SubgroupDispatch = 58,
641 SubgroupBallotKHR = 4423,
642 DrawParameters = 4427,
643 SubgroupVoteKHR = 4431,
644 StorageBuffer16BitAccess = 4433,
645 StorageUniformBufferBlock16 = 4433,
646 StorageUniform16 = 4434,
647 UniformAndStorageBuffer16BitAccess = 4434,
648 StoragePushConstant16 = 4435,
649 StorageInputOutput16 = 4436,
652 VariablePointersStorageBuffer = 4441,
653 VariablePointers = 4442,
654 AtomicStorageOps = 4445,
655 SampleMaskPostDepthCoverage = 4447,
656 ImageGatherBiasLodAMD = 5009,
657 FragmentMaskAMD = 5010,
658 StencilExportEXT = 5013,
659 ImageReadWriteLodAMD = 5015,
660 SampleMaskOverrideCoverageNV = 5249,
661 GeometryShaderPassthroughNV = 5251,
662 ShaderViewportIndexLayerEXT = 5254,
663 ShaderViewportIndexLayerNV = 5254,
664 ShaderViewportMaskNV = 5255,
665 ShaderStereoViewNV = 5259,
666 PerViewAttributesNV = 5260,
667 SubgroupShuffleINTEL = 5568,
668 SubgroupBufferBlockIOINTEL = 5569,
669 SubgroupImageBlockIOINTEL = 5570,
673 enum class Op : unsigned {
676 OpSourceContinued = 2,
678 OpSourceExtension = 4,
684 OpExtInstImport = 11,
688 OpExecutionMode = 16,
698 OpTypeSampledImage = 27,
700 OpTypeRuntimeArray = 29,
706 OpTypeDeviceEvent = 35,
707 OpTypeReserveId = 36,
710 OpTypeForwardPointer = 39,
712 OpConstantFalse = 42,
714 OpConstantComposite = 44,
715 OpConstantSampler = 45,
717 OpSpecConstantTrue = 48,
718 OpSpecConstantFalse = 49,
720 OpSpecConstantComposite = 51,
721 OpSpecConstantOp = 52,
723 OpFunctionParameter = 55,
727 OpImageTexelPointer = 60,
731 OpCopyMemorySized = 64,
733 OpInBoundsAccessChain = 66,
734 OpPtrAccessChain = 67,
736 OpGenericPtrMemSemantics = 69,
737 OpInBoundsPtrAccessChain = 70,
739 OpMemberDecorate = 72,
740 OpDecorationGroup = 73,
741 OpGroupDecorate = 74,
742 OpGroupMemberDecorate = 75,
743 OpVectorExtractDynamic = 77,
744 OpVectorInsertDynamic = 78,
745 OpVectorShuffle = 79,
746 OpCompositeConstruct = 80,
747 OpCompositeExtract = 81,
748 OpCompositeInsert = 82,
752 OpImageSampleImplicitLod = 87,
753 OpImageSampleExplicitLod = 88,
754 OpImageSampleDrefImplicitLod = 89,
755 OpImageSampleDrefExplicitLod = 90,
756 OpImageSampleProjImplicitLod = 91,
757 OpImageSampleProjExplicitLod = 92,
758 OpImageSampleProjDrefImplicitLod = 93,
759 OpImageSampleProjDrefExplicitLod = 94,
762 OpImageDrefGather = 97,
766 OpImageQueryFormat = 101,
767 OpImageQueryOrder = 102,
768 OpImageQuerySizeLod = 103,
769 OpImageQuerySize = 104,
770 OpImageQueryLod = 105,
771 OpImageQueryLevels = 106,
772 OpImageQuerySamples = 107,
780 OpQuantizeToF16 = 116,
781 OpConvertPtrToU = 117,
782 OpSatConvertSToU = 118,
783 OpSatConvertUToS = 119,
784 OpConvertUToPtr = 120,
785 OpPtrCastToGeneric = 121,
786 OpGenericCastToPtr = 122,
787 OpGenericCastToPtrExplicit = 123,
805 OpVectorTimesScalar = 142,
806 OpMatrixTimesScalar = 143,
807 OpVectorTimesMatrix = 144,
808 OpMatrixTimesVector = 145,
809 OpMatrixTimesMatrix = 146,
810 OpOuterProduct = 147,
814 OpUMulExtended = 151,
815 OpSMulExtended = 152,
823 OpLessOrGreater = 161,
826 OpLogicalEqual = 164,
827 OpLogicalNotEqual = 165,
834 OpUGreaterThan = 172,
835 OpSGreaterThan = 173,
836 OpUGreaterThanEqual = 174,
837 OpSGreaterThanEqual = 175,
840 OpULessThanEqual = 178,
841 OpSLessThanEqual = 179,
844 OpFOrdNotEqual = 182,
845 OpFUnordNotEqual = 183,
846 OpFOrdLessThan = 184,
847 OpFUnordLessThan = 185,
848 OpFOrdGreaterThan = 186,
849 OpFUnordGreaterThan = 187,
850 OpFOrdLessThanEqual = 188,
851 OpFUnordLessThanEqual = 189,
852 OpFOrdGreaterThanEqual = 190,
853 OpFUnordGreaterThanEqual = 191,
854 OpShiftRightLogical = 194,
855 OpShiftRightArithmetic = 195,
856 OpShiftLeftLogical = 196,
861 OpBitFieldInsert = 201,
862 OpBitFieldSExtract = 202,
863 OpBitFieldUExtract = 203,
874 OpFwidthCoarse = 215,
876 OpEndPrimitive = 219,
877 OpEmitStreamVertex = 220,
878 OpEndStreamPrimitive = 221,
879 OpControlBarrier = 224,
880 OpMemoryBarrier = 225,
883 OpAtomicExchange = 229,
884 OpAtomicCompareExchange = 230,
885 OpAtomicCompareExchangeWeak = 231,
886 OpAtomicIIncrement = 232,
887 OpAtomicIDecrement = 233,
899 OpSelectionMerge = 247,
902 OpBranchConditional = 250,
908 OpLifetimeStart = 256,
909 OpLifetimeStop = 257,
910 OpGroupAsyncCopy = 259,
911 OpGroupWaitEvents = 260,
914 OpGroupBroadcast = 263,
925 OpReservedReadPipe = 276,
926 OpReservedWritePipe = 277,
927 OpReserveReadPipePackets = 278,
928 OpReserveWritePipePackets = 279,
929 OpCommitReadPipe = 280,
930 OpCommitWritePipe = 281,
931 OpIsValidReserveId = 282,
932 OpGetNumPipePackets = 283,
933 OpGetMaxPipePackets = 284,
934 OpGroupReserveReadPipePackets = 285,
935 OpGroupReserveWritePipePackets = 286,
936 OpGroupCommitReadPipe = 287,
937 OpGroupCommitWritePipe = 288,
938 OpEnqueueMarker = 291,
939 OpEnqueueKernel = 292,
940 OpGetKernelNDrangeSubGroupCount = 293,
941 OpGetKernelNDrangeMaxSubGroupSize = 294,
942 OpGetKernelWorkGroupSize = 295,
943 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
945 OpReleaseEvent = 298,
946 OpCreateUserEvent = 299,
947 OpIsValidEvent = 300,
948 OpSetUserEventStatus = 301,
949 OpCaptureEventProfilingInfo = 302,
950 OpGetDefaultQueue = 303,
951 OpBuildNDRange = 304,
952 OpImageSparseSampleImplicitLod = 305,
953 OpImageSparseSampleExplicitLod = 306,
954 OpImageSparseSampleDrefImplicitLod = 307,
955 OpImageSparseSampleDrefExplicitLod = 308,
956 OpImageSparseSampleProjImplicitLod = 309,
957 OpImageSparseSampleProjExplicitLod = 310,
958 OpImageSparseSampleProjDrefImplicitLod = 311,
959 OpImageSparseSampleProjDrefExplicitLod = 312,
960 OpImageSparseFetch = 313,
961 OpImageSparseGather = 314,
962 OpImageSparseDrefGather = 315,
963 OpImageSparseTexelsResident = 316,
965 OpAtomicFlagTestAndSet = 318,
966 OpAtomicFlagClear = 319,
967 OpImageSparseRead = 320,
969 OpTypePipeStorage = 322,
970 OpConstantPipeStorage = 323,
971 OpCreatePipeFromPipeStorage = 324,
972 OpGetKernelLocalSizeForSubgroupCount = 325,
973 OpGetKernelMaxNumSubgroups = 326,
974 OpTypeNamedBarrier = 327,
975 OpNamedBarrierInitialize = 328,
976 OpMemoryNamedBarrier = 329,
977 OpModuleProcessed = 330,
978 OpSubgroupBallotKHR = 4421,
979 OpSubgroupFirstInvocationKHR = 4422,
980 OpSubgroupAllKHR = 4428,
981 OpSubgroupAnyKHR = 4429,
982 OpSubgroupAllEqualKHR = 4430,
983 OpSubgroupReadInvocationKHR = 4432,
984 OpGroupIAddNonUniformAMD = 5000,
985 OpGroupFAddNonUniformAMD = 5001,
986 OpGroupFMinNonUniformAMD = 5002,
987 OpGroupUMinNonUniformAMD = 5003,
988 OpGroupSMinNonUniformAMD = 5004,
989 OpGroupFMaxNonUniformAMD = 5005,
990 OpGroupUMaxNonUniformAMD = 5006,
991 OpGroupSMaxNonUniformAMD = 5007,
992 OpFragmentMaskFetchAMD = 5011,
993 OpFragmentFetchAMD = 5012,
994 OpSubgroupShuffleINTEL = 5571,
995 OpSubgroupShuffleDownINTEL = 5572,
996 OpSubgroupShuffleUpINTEL = 5573,
997 OpSubgroupShuffleXorINTEL = 5574,
998 OpSubgroupBlockReadINTEL = 5575,
999 OpSubgroupBlockWriteINTEL = 5576,
1000 OpSubgroupImageBlockReadINTEL = 5577,
1001 OpSubgroupImageBlockWriteINTEL = 5578,
1005 // Overload operator| for mask bit combining
1007 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
1008 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
1009 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
1010 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
1011 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
1012 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
1013 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
1014 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
1016 } // end namespace spv
1018 #endif // #ifndef spirv_HPP