1 // Copyright (c) 2014-2016 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 8
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010000;
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 {
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,
610 enum class Op : unsigned {
613 OpSourceContinued = 2,
615 OpSourceExtension = 4,
621 OpExtInstImport = 11,
625 OpExecutionMode = 16,
635 OpTypeSampledImage = 27,
637 OpTypeRuntimeArray = 29,
643 OpTypeDeviceEvent = 35,
644 OpTypeReserveId = 36,
647 OpTypeForwardPointer = 39,
649 OpConstantFalse = 42,
651 OpConstantComposite = 44,
652 OpConstantSampler = 45,
654 OpSpecConstantTrue = 48,
655 OpSpecConstantFalse = 49,
657 OpSpecConstantComposite = 51,
658 OpSpecConstantOp = 52,
660 OpFunctionParameter = 55,
664 OpImageTexelPointer = 60,
668 OpCopyMemorySized = 64,
670 OpInBoundsAccessChain = 66,
671 OpPtrAccessChain = 67,
673 OpGenericPtrMemSemantics = 69,
674 OpInBoundsPtrAccessChain = 70,
676 OpMemberDecorate = 72,
677 OpDecorationGroup = 73,
678 OpGroupDecorate = 74,
679 OpGroupMemberDecorate = 75,
680 OpVectorExtractDynamic = 77,
681 OpVectorInsertDynamic = 78,
682 OpVectorShuffle = 79,
683 OpCompositeConstruct = 80,
684 OpCompositeExtract = 81,
685 OpCompositeInsert = 82,
689 OpImageSampleImplicitLod = 87,
690 OpImageSampleExplicitLod = 88,
691 OpImageSampleDrefImplicitLod = 89,
692 OpImageSampleDrefExplicitLod = 90,
693 OpImageSampleProjImplicitLod = 91,
694 OpImageSampleProjExplicitLod = 92,
695 OpImageSampleProjDrefImplicitLod = 93,
696 OpImageSampleProjDrefExplicitLod = 94,
699 OpImageDrefGather = 97,
703 OpImageQueryFormat = 101,
704 OpImageQueryOrder = 102,
705 OpImageQuerySizeLod = 103,
706 OpImageQuerySize = 104,
707 OpImageQueryLod = 105,
708 OpImageQueryLevels = 106,
709 OpImageQuerySamples = 107,
717 OpQuantizeToF16 = 116,
718 OpConvertPtrToU = 117,
719 OpSatConvertSToU = 118,
720 OpSatConvertUToS = 119,
721 OpConvertUToPtr = 120,
722 OpPtrCastToGeneric = 121,
723 OpGenericCastToPtr = 122,
724 OpGenericCastToPtrExplicit = 123,
742 OpVectorTimesScalar = 142,
743 OpMatrixTimesScalar = 143,
744 OpVectorTimesMatrix = 144,
745 OpMatrixTimesVector = 145,
746 OpMatrixTimesMatrix = 146,
747 OpOuterProduct = 147,
751 OpUMulExtended = 151,
752 OpSMulExtended = 152,
760 OpLessOrGreater = 161,
763 OpLogicalEqual = 164,
764 OpLogicalNotEqual = 165,
771 OpUGreaterThan = 172,
772 OpSGreaterThan = 173,
773 OpUGreaterThanEqual = 174,
774 OpSGreaterThanEqual = 175,
777 OpULessThanEqual = 178,
778 OpSLessThanEqual = 179,
781 OpFOrdNotEqual = 182,
782 OpFUnordNotEqual = 183,
783 OpFOrdLessThan = 184,
784 OpFUnordLessThan = 185,
785 OpFOrdGreaterThan = 186,
786 OpFUnordGreaterThan = 187,
787 OpFOrdLessThanEqual = 188,
788 OpFUnordLessThanEqual = 189,
789 OpFOrdGreaterThanEqual = 190,
790 OpFUnordGreaterThanEqual = 191,
791 OpShiftRightLogical = 194,
792 OpShiftRightArithmetic = 195,
793 OpShiftLeftLogical = 196,
798 OpBitFieldInsert = 201,
799 OpBitFieldSExtract = 202,
800 OpBitFieldUExtract = 203,
811 OpFwidthCoarse = 215,
813 OpEndPrimitive = 219,
814 OpEmitStreamVertex = 220,
815 OpEndStreamPrimitive = 221,
816 OpControlBarrier = 224,
817 OpMemoryBarrier = 225,
820 OpAtomicExchange = 229,
821 OpAtomicCompareExchange = 230,
822 OpAtomicCompareExchangeWeak = 231,
823 OpAtomicIIncrement = 232,
824 OpAtomicIDecrement = 233,
836 OpSelectionMerge = 247,
839 OpBranchConditional = 250,
845 OpLifetimeStart = 256,
846 OpLifetimeStop = 257,
847 OpGroupAsyncCopy = 259,
848 OpGroupWaitEvents = 260,
851 OpGroupBroadcast = 263,
862 OpReservedReadPipe = 276,
863 OpReservedWritePipe = 277,
864 OpReserveReadPipePackets = 278,
865 OpReserveWritePipePackets = 279,
866 OpCommitReadPipe = 280,
867 OpCommitWritePipe = 281,
868 OpIsValidReserveId = 282,
869 OpGetNumPipePackets = 283,
870 OpGetMaxPipePackets = 284,
871 OpGroupReserveReadPipePackets = 285,
872 OpGroupReserveWritePipePackets = 286,
873 OpGroupCommitReadPipe = 287,
874 OpGroupCommitWritePipe = 288,
875 OpEnqueueMarker = 291,
876 OpEnqueueKernel = 292,
877 OpGetKernelNDrangeSubGroupCount = 293,
878 OpGetKernelNDrangeMaxSubGroupSize = 294,
879 OpGetKernelWorkGroupSize = 295,
880 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
882 OpReleaseEvent = 298,
883 OpCreateUserEvent = 299,
884 OpIsValidEvent = 300,
885 OpSetUserEventStatus = 301,
886 OpCaptureEventProfilingInfo = 302,
887 OpGetDefaultQueue = 303,
888 OpBuildNDRange = 304,
889 OpImageSparseSampleImplicitLod = 305,
890 OpImageSparseSampleExplicitLod = 306,
891 OpImageSparseSampleDrefImplicitLod = 307,
892 OpImageSparseSampleDrefExplicitLod = 308,
893 OpImageSparseSampleProjImplicitLod = 309,
894 OpImageSparseSampleProjExplicitLod = 310,
895 OpImageSparseSampleProjDrefImplicitLod = 311,
896 OpImageSparseSampleProjDrefExplicitLod = 312,
897 OpImageSparseFetch = 313,
898 OpImageSparseGather = 314,
899 OpImageSparseDrefGather = 315,
900 OpImageSparseTexelsResident = 316,
902 OpAtomicFlagTestAndSet = 318,
903 OpAtomicFlagClear = 319,
904 OpImageSparseRead = 320,
905 OpSubgroupBallotKHR = 4421,
906 OpSubgroupFirstInvocationKHR = 4422,
910 // Overload operator| for mask bit combining
912 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
913 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
914 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
915 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
916 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
917 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
918 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
919 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
921 } // end namespace spv
923 #endif // #ifndef spirv_HPP