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 0x10200
50 #define SPV_REVISION 1
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010200;
54 static const unsigned int Revision = 1;
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 SubgroupsPerWorkgroupId = 37,
131 LocalSizeHintId = 39,
135 enum class StorageClass : unsigned {
152 enum class Dim : unsigned {
163 enum class SamplerAddressingMode : unsigned {
172 enum class SamplerFilterMode : unsigned {
178 enum class ImageFormat : unsigned {
222 enum class ImageChannelOrder : unsigned {
246 enum class ImageChannelDataType : unsigned {
263 UnormInt101010_2 = 16,
267 enum class ImageOperandsShift : unsigned {
279 enum class ImageOperandsMask : unsigned {
284 ConstOffset = 0x00000008,
286 ConstOffsets = 0x00000020,
291 enum class FPFastMathModeShift : unsigned {
300 enum class FPFastMathModeMask : unsigned {
305 AllowRecip = 0x00000008,
309 enum class FPRoundingMode : unsigned {
317 enum class LinkageType : unsigned {
323 enum class AccessQualifier : unsigned {
330 enum class FunctionParameterAttribute : unsigned {
342 enum class Decoration : unsigned {
343 RelaxedPrecision = 0,
369 SaturatedConversion = 28,
382 LinkageAttributes = 41,
384 InputAttachmentIndex = 43,
388 MaxByteOffsetId = 47,
389 OverrideCoverageNV = 5248,
390 PassthroughNV = 5250,
391 ViewportRelativeNV = 5252,
392 SecondaryViewportRelativeNV = 5256,
396 enum class BuiltIn : unsigned {
418 HelperInvocation = 23,
422 LocalInvocationId = 27,
423 GlobalInvocationId = 28,
424 LocalInvocationIndex = 29,
427 EnqueuedWorkgroupSize = 32,
431 SubgroupMaxSize = 37,
433 NumEnqueuedSubgroups = 39,
435 SubgroupLocalInvocationId = 41,
438 SubgroupEqMaskKHR = 4416,
439 SubgroupGeMaskKHR = 4417,
440 SubgroupGtMaskKHR = 4418,
441 SubgroupLeMaskKHR = 4419,
442 SubgroupLtMaskKHR = 4420,
448 ViewportMaskNV = 5253,
449 SecondaryPositionNV = 5257,
450 SecondaryViewportMaskNV = 5258,
451 PositionPerViewNV = 5261,
452 ViewportMaskPerViewNV = 5262,
456 enum class SelectionControlShift : unsigned {
462 enum class SelectionControlMask : unsigned {
464 Flatten = 0x00000001,
465 DontFlatten = 0x00000002,
468 enum class LoopControlShift : unsigned {
471 DependencyInfinite = 2,
472 DependencyLength = 3,
476 enum class LoopControlMask : unsigned {
479 DontUnroll = 0x00000002,
480 DependencyInfinite = 0x00000004,
481 DependencyLength = 0x00000008,
484 enum class FunctionControlShift : unsigned {
492 enum class FunctionControlMask : unsigned {
495 DontInline = 0x00000002,
500 enum class MemorySemanticsShift : unsigned {
504 SequentiallyConsistent = 4,
508 CrossWorkgroupMemory = 9,
509 AtomicCounterMemory = 10,
514 enum class MemorySemanticsMask : unsigned {
516 Acquire = 0x00000002,
517 Release = 0x00000004,
518 AcquireRelease = 0x00000008,
519 SequentiallyConsistent = 0x00000010,
520 UniformMemory = 0x00000040,
521 SubgroupMemory = 0x00000080,
522 WorkgroupMemory = 0x00000100,
523 CrossWorkgroupMemory = 0x00000200,
524 AtomicCounterMemory = 0x00000400,
525 ImageMemory = 0x00000800,
528 enum class MemoryAccessShift : unsigned {
535 enum class MemoryAccessMask : unsigned {
537 Volatile = 0x00000001,
538 Aligned = 0x00000002,
539 Nontemporal = 0x00000004,
542 enum class Scope : unsigned {
551 enum class GroupOperation : unsigned {
558 enum class KernelEnqueueFlags : unsigned {
565 enum class KernelProfilingInfoShift : unsigned {
570 enum class KernelProfilingInfoMask : unsigned {
572 CmdExecTime = 0x00000001,
575 enum class Capability : unsigned {
598 TessellationPointSize = 23,
599 GeometryPointSize = 24,
600 ImageGatherExtended = 25,
601 StorageImageMultisample = 27,
602 UniformBufferArrayDynamicIndexing = 28,
603 SampledImageArrayDynamicIndexing = 29,
604 StorageBufferArrayDynamicIndexing = 30,
605 StorageImageArrayDynamicIndexing = 31,
609 SampleRateShading = 35,
614 InputAttachment = 40,
615 SparseResidency = 41,
619 SampledCubeArray = 45,
623 StorageImageExtendedFormats = 49,
625 DerivativeControl = 51,
626 InterpolationFunction = 52,
627 TransformFeedback = 53,
628 GeometryStreams = 54,
629 StorageImageReadWithoutFormat = 55,
630 StorageImageWriteWithoutFormat = 56,
632 SubgroupDispatch = 58,
635 SubgroupBallotKHR = 4423,
636 DrawParameters = 4427,
637 SubgroupVoteKHR = 4431,
638 StorageBuffer16BitAccess = 4433,
639 StorageUniformBufferBlock16 = 4433,
640 StorageUniform16 = 4434,
641 UniformAndStorageBuffer16BitAccess = 4434,
642 StoragePushConstant16 = 4435,
643 StorageInputOutput16 = 4436,
646 VariablePointersStorageBuffer = 4441,
647 VariablePointers = 4442,
648 SampleMaskOverrideCoverageNV = 5249,
649 GeometryShaderPassthroughNV = 5251,
650 ShaderViewportIndexLayerNV = 5254,
651 ShaderViewportMaskNV = 5255,
652 ShaderStereoViewNV = 5259,
653 PerViewAttributesNV = 5260,
657 enum class Op : unsigned {
660 OpSourceContinued = 2,
662 OpSourceExtension = 4,
668 OpExtInstImport = 11,
672 OpExecutionMode = 16,
682 OpTypeSampledImage = 27,
684 OpTypeRuntimeArray = 29,
690 OpTypeDeviceEvent = 35,
691 OpTypeReserveId = 36,
694 OpTypeForwardPointer = 39,
696 OpConstantFalse = 42,
698 OpConstantComposite = 44,
699 OpConstantSampler = 45,
701 OpSpecConstantTrue = 48,
702 OpSpecConstantFalse = 49,
704 OpSpecConstantComposite = 51,
705 OpSpecConstantOp = 52,
707 OpFunctionParameter = 55,
711 OpImageTexelPointer = 60,
715 OpCopyMemorySized = 64,
717 OpInBoundsAccessChain = 66,
718 OpPtrAccessChain = 67,
720 OpGenericPtrMemSemantics = 69,
721 OpInBoundsPtrAccessChain = 70,
723 OpMemberDecorate = 72,
724 OpDecorationGroup = 73,
725 OpGroupDecorate = 74,
726 OpGroupMemberDecorate = 75,
727 OpVectorExtractDynamic = 77,
728 OpVectorInsertDynamic = 78,
729 OpVectorShuffle = 79,
730 OpCompositeConstruct = 80,
731 OpCompositeExtract = 81,
732 OpCompositeInsert = 82,
736 OpImageSampleImplicitLod = 87,
737 OpImageSampleExplicitLod = 88,
738 OpImageSampleDrefImplicitLod = 89,
739 OpImageSampleDrefExplicitLod = 90,
740 OpImageSampleProjImplicitLod = 91,
741 OpImageSampleProjExplicitLod = 92,
742 OpImageSampleProjDrefImplicitLod = 93,
743 OpImageSampleProjDrefExplicitLod = 94,
746 OpImageDrefGather = 97,
750 OpImageQueryFormat = 101,
751 OpImageQueryOrder = 102,
752 OpImageQuerySizeLod = 103,
753 OpImageQuerySize = 104,
754 OpImageQueryLod = 105,
755 OpImageQueryLevels = 106,
756 OpImageQuerySamples = 107,
764 OpQuantizeToF16 = 116,
765 OpConvertPtrToU = 117,
766 OpSatConvertSToU = 118,
767 OpSatConvertUToS = 119,
768 OpConvertUToPtr = 120,
769 OpPtrCastToGeneric = 121,
770 OpGenericCastToPtr = 122,
771 OpGenericCastToPtrExplicit = 123,
789 OpVectorTimesScalar = 142,
790 OpMatrixTimesScalar = 143,
791 OpVectorTimesMatrix = 144,
792 OpMatrixTimesVector = 145,
793 OpMatrixTimesMatrix = 146,
794 OpOuterProduct = 147,
798 OpUMulExtended = 151,
799 OpSMulExtended = 152,
807 OpLessOrGreater = 161,
810 OpLogicalEqual = 164,
811 OpLogicalNotEqual = 165,
818 OpUGreaterThan = 172,
819 OpSGreaterThan = 173,
820 OpUGreaterThanEqual = 174,
821 OpSGreaterThanEqual = 175,
824 OpULessThanEqual = 178,
825 OpSLessThanEqual = 179,
828 OpFOrdNotEqual = 182,
829 OpFUnordNotEqual = 183,
830 OpFOrdLessThan = 184,
831 OpFUnordLessThan = 185,
832 OpFOrdGreaterThan = 186,
833 OpFUnordGreaterThan = 187,
834 OpFOrdLessThanEqual = 188,
835 OpFUnordLessThanEqual = 189,
836 OpFOrdGreaterThanEqual = 190,
837 OpFUnordGreaterThanEqual = 191,
838 OpShiftRightLogical = 194,
839 OpShiftRightArithmetic = 195,
840 OpShiftLeftLogical = 196,
845 OpBitFieldInsert = 201,
846 OpBitFieldSExtract = 202,
847 OpBitFieldUExtract = 203,
858 OpFwidthCoarse = 215,
860 OpEndPrimitive = 219,
861 OpEmitStreamVertex = 220,
862 OpEndStreamPrimitive = 221,
863 OpControlBarrier = 224,
864 OpMemoryBarrier = 225,
867 OpAtomicExchange = 229,
868 OpAtomicCompareExchange = 230,
869 OpAtomicCompareExchangeWeak = 231,
870 OpAtomicIIncrement = 232,
871 OpAtomicIDecrement = 233,
883 OpSelectionMerge = 247,
886 OpBranchConditional = 250,
892 OpLifetimeStart = 256,
893 OpLifetimeStop = 257,
894 OpGroupAsyncCopy = 259,
895 OpGroupWaitEvents = 260,
898 OpGroupBroadcast = 263,
909 OpReservedReadPipe = 276,
910 OpReservedWritePipe = 277,
911 OpReserveReadPipePackets = 278,
912 OpReserveWritePipePackets = 279,
913 OpCommitReadPipe = 280,
914 OpCommitWritePipe = 281,
915 OpIsValidReserveId = 282,
916 OpGetNumPipePackets = 283,
917 OpGetMaxPipePackets = 284,
918 OpGroupReserveReadPipePackets = 285,
919 OpGroupReserveWritePipePackets = 286,
920 OpGroupCommitReadPipe = 287,
921 OpGroupCommitWritePipe = 288,
922 OpEnqueueMarker = 291,
923 OpEnqueueKernel = 292,
924 OpGetKernelNDrangeSubGroupCount = 293,
925 OpGetKernelNDrangeMaxSubGroupSize = 294,
926 OpGetKernelWorkGroupSize = 295,
927 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
929 OpReleaseEvent = 298,
930 OpCreateUserEvent = 299,
931 OpIsValidEvent = 300,
932 OpSetUserEventStatus = 301,
933 OpCaptureEventProfilingInfo = 302,
934 OpGetDefaultQueue = 303,
935 OpBuildNDRange = 304,
936 OpImageSparseSampleImplicitLod = 305,
937 OpImageSparseSampleExplicitLod = 306,
938 OpImageSparseSampleDrefImplicitLod = 307,
939 OpImageSparseSampleDrefExplicitLod = 308,
940 OpImageSparseSampleProjImplicitLod = 309,
941 OpImageSparseSampleProjExplicitLod = 310,
942 OpImageSparseSampleProjDrefImplicitLod = 311,
943 OpImageSparseSampleProjDrefExplicitLod = 312,
944 OpImageSparseFetch = 313,
945 OpImageSparseGather = 314,
946 OpImageSparseDrefGather = 315,
947 OpImageSparseTexelsResident = 316,
949 OpAtomicFlagTestAndSet = 318,
950 OpAtomicFlagClear = 319,
951 OpImageSparseRead = 320,
953 OpTypePipeStorage = 322,
954 OpConstantPipeStorage = 323,
955 OpCreatePipeFromPipeStorage = 324,
956 OpGetKernelLocalSizeForSubgroupCount = 325,
957 OpGetKernelMaxNumSubgroups = 326,
958 OpTypeNamedBarrier = 327,
959 OpNamedBarrierInitialize = 328,
960 OpMemoryNamedBarrier = 329,
961 OpModuleProcessed = 330,
962 OpExecutionModeId = 331,
964 OpSubgroupBallotKHR = 4421,
965 OpSubgroupFirstInvocationKHR = 4422,
966 OpSubgroupAllKHR = 4428,
967 OpSubgroupAnyKHR = 4429,
968 OpSubgroupAllEqualKHR = 4430,
969 OpSubgroupReadInvocationKHR = 4432,
973 // Overload operator| for mask bit combining
975 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
976 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
977 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
978 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
979 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
980 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
981 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
982 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
984 } // end namespace spv
986 #endif // #ifndef spirv_HPP