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 9
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010000;
54 static const unsigned int Revision = 9;
55 static const unsigned int OpCodeMask = 0xffff;
56 static const unsigned int WordCountShift = 16;
58 enum class SourceLanguage : unsigned {
67 enum class ExecutionModel : unsigned {
69 TessellationControl = 1,
70 TessellationEvaluation = 2,
78 enum class AddressingModel : unsigned {
85 enum class MemoryModel : unsigned {
92 enum class ExecutionMode : unsigned {
95 SpacingFractionalEven = 2,
96 SpacingFractionalOdd = 3,
99 PixelCenterInteger = 6,
102 EarlyFragmentTests = 9,
113 InputLinesAdjacency = 21,
115 InputTrianglesAdjacency = 23,
120 OutputLineStrip = 28,
121 OutputTriangleStrip = 29,
127 enum class StorageClass : unsigned {
143 enum class Dim : unsigned {
154 enum class SamplerAddressingMode : unsigned {
163 enum class SamplerFilterMode : unsigned {
169 enum class ImageFormat : unsigned {
213 enum class ImageChannelOrder : unsigned {
237 enum class ImageChannelDataType : unsigned {
254 UnormInt101010_2 = 16,
258 enum class ImageOperandsShift : unsigned {
270 enum class ImageOperandsMask : unsigned {
275 ConstOffset = 0x00000008,
277 ConstOffsets = 0x00000020,
282 enum class FPFastMathModeShift : unsigned {
291 enum class FPFastMathModeMask : unsigned {
296 AllowRecip = 0x00000008,
300 enum class FPRoundingMode : unsigned {
308 enum class LinkageType : unsigned {
314 enum class AccessQualifier : unsigned {
321 enum class FunctionParameterAttribute : unsigned {
333 enum class Decoration : unsigned {
334 RelaxedPrecision = 0,
360 SaturatedConversion = 28,
373 LinkageAttributes = 41,
375 InputAttachmentIndex = 43,
380 enum class BuiltIn : unsigned {
402 HelperInvocation = 23,
406 LocalInvocationId = 27,
407 GlobalInvocationId = 28,
408 LocalInvocationIndex = 29,
411 EnqueuedWorkgroupSize = 32,
415 SubgroupMaxSize = 37,
417 NumEnqueuedSubgroups = 39,
419 SubgroupLocalInvocationId = 41,
422 SubgroupEqMaskKHR = 4416,
423 SubgroupGeMaskKHR = 4417,
424 SubgroupGtMaskKHR = 4418,
425 SubgroupLeMaskKHR = 4419,
426 SubgroupLtMaskKHR = 4420,
433 enum class SelectionControlShift : unsigned {
439 enum class SelectionControlMask : unsigned {
441 Flatten = 0x00000001,
442 DontFlatten = 0x00000002,
445 enum class LoopControlShift : unsigned {
451 enum class LoopControlMask : unsigned {
454 DontUnroll = 0x00000002,
457 enum class FunctionControlShift : unsigned {
465 enum class FunctionControlMask : unsigned {
468 DontInline = 0x00000002,
473 enum class MemorySemanticsShift : unsigned {
477 SequentiallyConsistent = 4,
481 CrossWorkgroupMemory = 9,
482 AtomicCounterMemory = 10,
487 enum class MemorySemanticsMask : unsigned {
489 Acquire = 0x00000002,
490 Release = 0x00000004,
491 AcquireRelease = 0x00000008,
492 SequentiallyConsistent = 0x00000010,
493 UniformMemory = 0x00000040,
494 SubgroupMemory = 0x00000080,
495 WorkgroupMemory = 0x00000100,
496 CrossWorkgroupMemory = 0x00000200,
497 AtomicCounterMemory = 0x00000400,
498 ImageMemory = 0x00000800,
501 enum class MemoryAccessShift : unsigned {
508 enum class MemoryAccessMask : unsigned {
510 Volatile = 0x00000001,
511 Aligned = 0x00000002,
512 Nontemporal = 0x00000004,
515 enum class Scope : unsigned {
524 enum class GroupOperation : unsigned {
531 enum class KernelEnqueueFlags : unsigned {
538 enum class KernelProfilingInfoShift : unsigned {
543 enum class KernelProfilingInfoMask : unsigned {
545 CmdExecTime = 0x00000001,
548 enum class Capability : unsigned {
571 TessellationPointSize = 23,
572 GeometryPointSize = 24,
573 ImageGatherExtended = 25,
574 StorageImageMultisample = 27,
575 UniformBufferArrayDynamicIndexing = 28,
576 SampledImageArrayDynamicIndexing = 29,
577 StorageBufferArrayDynamicIndexing = 30,
578 StorageImageArrayDynamicIndexing = 31,
582 SampleRateShading = 35,
587 InputAttachment = 40,
588 SparseResidency = 41,
592 SampledCubeArray = 45,
596 StorageImageExtendedFormats = 49,
598 DerivativeControl = 51,
599 InterpolationFunction = 52,
600 TransformFeedback = 53,
601 GeometryStreams = 54,
602 StorageImageReadWithoutFormat = 55,
603 StorageImageWriteWithoutFormat = 56,
605 SubgroupBallotKHR = 4423,
606 DrawParameters = 4427,
607 SubgroupVoteKHR = 4431,
611 enum class Op : unsigned {
614 OpSourceContinued = 2,
616 OpSourceExtension = 4,
622 OpExtInstImport = 11,
626 OpExecutionMode = 16,
636 OpTypeSampledImage = 27,
638 OpTypeRuntimeArray = 29,
644 OpTypeDeviceEvent = 35,
645 OpTypeReserveId = 36,
648 OpTypeForwardPointer = 39,
650 OpConstantFalse = 42,
652 OpConstantComposite = 44,
653 OpConstantSampler = 45,
655 OpSpecConstantTrue = 48,
656 OpSpecConstantFalse = 49,
658 OpSpecConstantComposite = 51,
659 OpSpecConstantOp = 52,
661 OpFunctionParameter = 55,
665 OpImageTexelPointer = 60,
669 OpCopyMemorySized = 64,
671 OpInBoundsAccessChain = 66,
672 OpPtrAccessChain = 67,
674 OpGenericPtrMemSemantics = 69,
675 OpInBoundsPtrAccessChain = 70,
677 OpMemberDecorate = 72,
678 OpDecorationGroup = 73,
679 OpGroupDecorate = 74,
680 OpGroupMemberDecorate = 75,
681 OpVectorExtractDynamic = 77,
682 OpVectorInsertDynamic = 78,
683 OpVectorShuffle = 79,
684 OpCompositeConstruct = 80,
685 OpCompositeExtract = 81,
686 OpCompositeInsert = 82,
690 OpImageSampleImplicitLod = 87,
691 OpImageSampleExplicitLod = 88,
692 OpImageSampleDrefImplicitLod = 89,
693 OpImageSampleDrefExplicitLod = 90,
694 OpImageSampleProjImplicitLod = 91,
695 OpImageSampleProjExplicitLod = 92,
696 OpImageSampleProjDrefImplicitLod = 93,
697 OpImageSampleProjDrefExplicitLod = 94,
700 OpImageDrefGather = 97,
704 OpImageQueryFormat = 101,
705 OpImageQueryOrder = 102,
706 OpImageQuerySizeLod = 103,
707 OpImageQuerySize = 104,
708 OpImageQueryLod = 105,
709 OpImageQueryLevels = 106,
710 OpImageQuerySamples = 107,
718 OpQuantizeToF16 = 116,
719 OpConvertPtrToU = 117,
720 OpSatConvertSToU = 118,
721 OpSatConvertUToS = 119,
722 OpConvertUToPtr = 120,
723 OpPtrCastToGeneric = 121,
724 OpGenericCastToPtr = 122,
725 OpGenericCastToPtrExplicit = 123,
743 OpVectorTimesScalar = 142,
744 OpMatrixTimesScalar = 143,
745 OpVectorTimesMatrix = 144,
746 OpMatrixTimesVector = 145,
747 OpMatrixTimesMatrix = 146,
748 OpOuterProduct = 147,
752 OpUMulExtended = 151,
753 OpSMulExtended = 152,
761 OpLessOrGreater = 161,
764 OpLogicalEqual = 164,
765 OpLogicalNotEqual = 165,
772 OpUGreaterThan = 172,
773 OpSGreaterThan = 173,
774 OpUGreaterThanEqual = 174,
775 OpSGreaterThanEqual = 175,
778 OpULessThanEqual = 178,
779 OpSLessThanEqual = 179,
782 OpFOrdNotEqual = 182,
783 OpFUnordNotEqual = 183,
784 OpFOrdLessThan = 184,
785 OpFUnordLessThan = 185,
786 OpFOrdGreaterThan = 186,
787 OpFUnordGreaterThan = 187,
788 OpFOrdLessThanEqual = 188,
789 OpFUnordLessThanEqual = 189,
790 OpFOrdGreaterThanEqual = 190,
791 OpFUnordGreaterThanEqual = 191,
792 OpShiftRightLogical = 194,
793 OpShiftRightArithmetic = 195,
794 OpShiftLeftLogical = 196,
799 OpBitFieldInsert = 201,
800 OpBitFieldSExtract = 202,
801 OpBitFieldUExtract = 203,
812 OpFwidthCoarse = 215,
814 OpEndPrimitive = 219,
815 OpEmitStreamVertex = 220,
816 OpEndStreamPrimitive = 221,
817 OpControlBarrier = 224,
818 OpMemoryBarrier = 225,
821 OpAtomicExchange = 229,
822 OpAtomicCompareExchange = 230,
823 OpAtomicCompareExchangeWeak = 231,
824 OpAtomicIIncrement = 232,
825 OpAtomicIDecrement = 233,
837 OpSelectionMerge = 247,
840 OpBranchConditional = 250,
846 OpLifetimeStart = 256,
847 OpLifetimeStop = 257,
848 OpGroupAsyncCopy = 259,
849 OpGroupWaitEvents = 260,
852 OpGroupBroadcast = 263,
863 OpReservedReadPipe = 276,
864 OpReservedWritePipe = 277,
865 OpReserveReadPipePackets = 278,
866 OpReserveWritePipePackets = 279,
867 OpCommitReadPipe = 280,
868 OpCommitWritePipe = 281,
869 OpIsValidReserveId = 282,
870 OpGetNumPipePackets = 283,
871 OpGetMaxPipePackets = 284,
872 OpGroupReserveReadPipePackets = 285,
873 OpGroupReserveWritePipePackets = 286,
874 OpGroupCommitReadPipe = 287,
875 OpGroupCommitWritePipe = 288,
876 OpEnqueueMarker = 291,
877 OpEnqueueKernel = 292,
878 OpGetKernelNDrangeSubGroupCount = 293,
879 OpGetKernelNDrangeMaxSubGroupSize = 294,
880 OpGetKernelWorkGroupSize = 295,
881 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
883 OpReleaseEvent = 298,
884 OpCreateUserEvent = 299,
885 OpIsValidEvent = 300,
886 OpSetUserEventStatus = 301,
887 OpCaptureEventProfilingInfo = 302,
888 OpGetDefaultQueue = 303,
889 OpBuildNDRange = 304,
890 OpImageSparseSampleImplicitLod = 305,
891 OpImageSparseSampleExplicitLod = 306,
892 OpImageSparseSampleDrefImplicitLod = 307,
893 OpImageSparseSampleDrefExplicitLod = 308,
894 OpImageSparseSampleProjImplicitLod = 309,
895 OpImageSparseSampleProjExplicitLod = 310,
896 OpImageSparseSampleProjDrefImplicitLod = 311,
897 OpImageSparseSampleProjDrefExplicitLod = 312,
898 OpImageSparseFetch = 313,
899 OpImageSparseGather = 314,
900 OpImageSparseDrefGather = 315,
901 OpImageSparseTexelsResident = 316,
903 OpAtomicFlagTestAndSet = 318,
904 OpAtomicFlagClear = 319,
905 OpImageSparseRead = 320,
906 OpSubgroupBallotKHR = 4421,
907 OpSubgroupFirstInvocationKHR = 4422,
908 OpSubgroupAllKHR = 4428,
909 OpSubgroupAnyKHR = 4429,
910 OpSubgroupAllEqualKHR = 4430,
911 OpSubgroupReadInvocationKHR = 4432,
915 // Overload operator| for mask bit combining
917 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
918 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
919 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
920 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
921 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
922 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
923 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
924 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
926 } // end namespace spv
928 #endif // #ifndef spirv_HPP