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,
132 PostDepthCoverage = 4446,
136 enum class StorageClass : unsigned {
153 enum class Dim : unsigned {
164 enum class SamplerAddressingMode : unsigned {
173 enum class SamplerFilterMode : unsigned {
179 enum class ImageFormat : unsigned {
223 enum class ImageChannelOrder : unsigned {
247 enum class ImageChannelDataType : unsigned {
264 UnormInt101010_2 = 16,
268 enum class ImageOperandsShift : unsigned {
280 enum class ImageOperandsMask : unsigned {
285 ConstOffset = 0x00000008,
287 ConstOffsets = 0x00000020,
292 enum class FPFastMathModeShift : unsigned {
301 enum class FPFastMathModeMask : unsigned {
306 AllowRecip = 0x00000008,
310 enum class FPRoundingMode : unsigned {
318 enum class LinkageType : unsigned {
324 enum class AccessQualifier : unsigned {
331 enum class FunctionParameterAttribute : unsigned {
343 enum class Decoration : unsigned {
344 RelaxedPrecision = 0,
370 SaturatedConversion = 28,
383 LinkageAttributes = 41,
385 InputAttachmentIndex = 43,
389 MaxByteOffsetId = 47,
390 ExplicitInterpAMD = 4999,
391 OverrideCoverageNV = 5248,
392 PassthroughNV = 5250,
393 ViewportRelativeNV = 5252,
394 SecondaryViewportRelativeNV = 5256,
398 enum class BuiltIn : unsigned {
420 HelperInvocation = 23,
424 LocalInvocationId = 27,
425 GlobalInvocationId = 28,
426 LocalInvocationIndex = 29,
429 EnqueuedWorkgroupSize = 32,
433 SubgroupMaxSize = 37,
435 NumEnqueuedSubgroups = 39,
437 SubgroupLocalInvocationId = 41,
440 SubgroupEqMaskKHR = 4416,
441 SubgroupGeMaskKHR = 4417,
442 SubgroupGtMaskKHR = 4418,
443 SubgroupLeMaskKHR = 4419,
444 SubgroupLtMaskKHR = 4420,
450 BaryCoordNoPerspAMD = 4992,
451 BaryCoordNoPerspCentroidAMD = 4993,
452 BaryCoordNoPerspSampleAMD = 4994,
453 BaryCoordSmoothAMD = 4995,
454 BaryCoordSmoothCentroidAMD = 4996,
455 BaryCoordSmoothSampleAMD = 4997,
456 BaryCoordPullModelAMD = 4998,
457 ViewportMaskNV = 5253,
458 SecondaryPositionNV = 5257,
459 SecondaryViewportMaskNV = 5258,
460 PositionPerViewNV = 5261,
461 ViewportMaskPerViewNV = 5262,
465 enum class SelectionControlShift : unsigned {
471 enum class SelectionControlMask : unsigned {
473 Flatten = 0x00000001,
474 DontFlatten = 0x00000002,
477 enum class LoopControlShift : unsigned {
480 DependencyInfinite = 2,
481 DependencyLength = 3,
485 enum class LoopControlMask : unsigned {
488 DontUnroll = 0x00000002,
489 DependencyInfinite = 0x00000004,
490 DependencyLength = 0x00000008,
493 enum class FunctionControlShift : unsigned {
501 enum class FunctionControlMask : unsigned {
504 DontInline = 0x00000002,
509 enum class MemorySemanticsShift : unsigned {
513 SequentiallyConsistent = 4,
517 CrossWorkgroupMemory = 9,
518 AtomicCounterMemory = 10,
523 enum class MemorySemanticsMask : unsigned {
525 Acquire = 0x00000002,
526 Release = 0x00000004,
527 AcquireRelease = 0x00000008,
528 SequentiallyConsistent = 0x00000010,
529 UniformMemory = 0x00000040,
530 SubgroupMemory = 0x00000080,
531 WorkgroupMemory = 0x00000100,
532 CrossWorkgroupMemory = 0x00000200,
533 AtomicCounterMemory = 0x00000400,
534 ImageMemory = 0x00000800,
537 enum class MemoryAccessShift : unsigned {
544 enum class MemoryAccessMask : unsigned {
546 Volatile = 0x00000001,
547 Aligned = 0x00000002,
548 Nontemporal = 0x00000004,
551 enum class Scope : unsigned {
560 enum class GroupOperation : unsigned {
567 enum class KernelEnqueueFlags : unsigned {
574 enum class KernelProfilingInfoShift : unsigned {
579 enum class KernelProfilingInfoMask : unsigned {
581 CmdExecTime = 0x00000001,
584 enum class Capability : unsigned {
607 TessellationPointSize = 23,
608 GeometryPointSize = 24,
609 ImageGatherExtended = 25,
610 StorageImageMultisample = 27,
611 UniformBufferArrayDynamicIndexing = 28,
612 SampledImageArrayDynamicIndexing = 29,
613 StorageBufferArrayDynamicIndexing = 30,
614 StorageImageArrayDynamicIndexing = 31,
618 SampleRateShading = 35,
623 InputAttachment = 40,
624 SparseResidency = 41,
628 SampledCubeArray = 45,
632 StorageImageExtendedFormats = 49,
634 DerivativeControl = 51,
635 InterpolationFunction = 52,
636 TransformFeedback = 53,
637 GeometryStreams = 54,
638 StorageImageReadWithoutFormat = 55,
639 StorageImageWriteWithoutFormat = 56,
641 SubgroupDispatch = 58,
644 SubgroupBallotKHR = 4423,
645 DrawParameters = 4427,
646 SubgroupVoteKHR = 4431,
647 StorageBuffer16BitAccess = 4433,
648 StorageUniformBufferBlock16 = 4433,
649 StorageUniform16 = 4434,
650 UniformAndStorageBuffer16BitAccess = 4434,
651 StoragePushConstant16 = 4435,
652 StorageInputOutput16 = 4436,
655 VariablePointersStorageBuffer = 4441,
656 VariablePointers = 4442,
657 AtomicStorageOps = 4445,
658 SampleMaskPostDepthCoverage = 4447,
659 ImageGatherBiasLodAMD = 5009,
660 SampleMaskOverrideCoverageNV = 5249,
661 GeometryShaderPassthroughNV = 5251,
662 ShaderViewportIndexLayerNV = 5254,
663 ShaderViewportMaskNV = 5255,
664 ShaderStereoViewNV = 5259,
665 PerViewAttributesNV = 5260,
669 enum class Op : unsigned {
672 OpSourceContinued = 2,
674 OpSourceExtension = 4,
680 OpExtInstImport = 11,
684 OpExecutionMode = 16,
694 OpTypeSampledImage = 27,
696 OpTypeRuntimeArray = 29,
702 OpTypeDeviceEvent = 35,
703 OpTypeReserveId = 36,
706 OpTypeForwardPointer = 39,
708 OpConstantFalse = 42,
710 OpConstantComposite = 44,
711 OpConstantSampler = 45,
713 OpSpecConstantTrue = 48,
714 OpSpecConstantFalse = 49,
716 OpSpecConstantComposite = 51,
717 OpSpecConstantOp = 52,
719 OpFunctionParameter = 55,
723 OpImageTexelPointer = 60,
727 OpCopyMemorySized = 64,
729 OpInBoundsAccessChain = 66,
730 OpPtrAccessChain = 67,
732 OpGenericPtrMemSemantics = 69,
733 OpInBoundsPtrAccessChain = 70,
735 OpMemberDecorate = 72,
736 OpDecorationGroup = 73,
737 OpGroupDecorate = 74,
738 OpGroupMemberDecorate = 75,
739 OpVectorExtractDynamic = 77,
740 OpVectorInsertDynamic = 78,
741 OpVectorShuffle = 79,
742 OpCompositeConstruct = 80,
743 OpCompositeExtract = 81,
744 OpCompositeInsert = 82,
748 OpImageSampleImplicitLod = 87,
749 OpImageSampleExplicitLod = 88,
750 OpImageSampleDrefImplicitLod = 89,
751 OpImageSampleDrefExplicitLod = 90,
752 OpImageSampleProjImplicitLod = 91,
753 OpImageSampleProjExplicitLod = 92,
754 OpImageSampleProjDrefImplicitLod = 93,
755 OpImageSampleProjDrefExplicitLod = 94,
758 OpImageDrefGather = 97,
762 OpImageQueryFormat = 101,
763 OpImageQueryOrder = 102,
764 OpImageQuerySizeLod = 103,
765 OpImageQuerySize = 104,
766 OpImageQueryLod = 105,
767 OpImageQueryLevels = 106,
768 OpImageQuerySamples = 107,
776 OpQuantizeToF16 = 116,
777 OpConvertPtrToU = 117,
778 OpSatConvertSToU = 118,
779 OpSatConvertUToS = 119,
780 OpConvertUToPtr = 120,
781 OpPtrCastToGeneric = 121,
782 OpGenericCastToPtr = 122,
783 OpGenericCastToPtrExplicit = 123,
801 OpVectorTimesScalar = 142,
802 OpMatrixTimesScalar = 143,
803 OpVectorTimesMatrix = 144,
804 OpMatrixTimesVector = 145,
805 OpMatrixTimesMatrix = 146,
806 OpOuterProduct = 147,
810 OpUMulExtended = 151,
811 OpSMulExtended = 152,
819 OpLessOrGreater = 161,
822 OpLogicalEqual = 164,
823 OpLogicalNotEqual = 165,
830 OpUGreaterThan = 172,
831 OpSGreaterThan = 173,
832 OpUGreaterThanEqual = 174,
833 OpSGreaterThanEqual = 175,
836 OpULessThanEqual = 178,
837 OpSLessThanEqual = 179,
840 OpFOrdNotEqual = 182,
841 OpFUnordNotEqual = 183,
842 OpFOrdLessThan = 184,
843 OpFUnordLessThan = 185,
844 OpFOrdGreaterThan = 186,
845 OpFUnordGreaterThan = 187,
846 OpFOrdLessThanEqual = 188,
847 OpFUnordLessThanEqual = 189,
848 OpFOrdGreaterThanEqual = 190,
849 OpFUnordGreaterThanEqual = 191,
850 OpShiftRightLogical = 194,
851 OpShiftRightArithmetic = 195,
852 OpShiftLeftLogical = 196,
857 OpBitFieldInsert = 201,
858 OpBitFieldSExtract = 202,
859 OpBitFieldUExtract = 203,
870 OpFwidthCoarse = 215,
872 OpEndPrimitive = 219,
873 OpEmitStreamVertex = 220,
874 OpEndStreamPrimitive = 221,
875 OpControlBarrier = 224,
876 OpMemoryBarrier = 225,
879 OpAtomicExchange = 229,
880 OpAtomicCompareExchange = 230,
881 OpAtomicCompareExchangeWeak = 231,
882 OpAtomicIIncrement = 232,
883 OpAtomicIDecrement = 233,
895 OpSelectionMerge = 247,
898 OpBranchConditional = 250,
904 OpLifetimeStart = 256,
905 OpLifetimeStop = 257,
906 OpGroupAsyncCopy = 259,
907 OpGroupWaitEvents = 260,
910 OpGroupBroadcast = 263,
921 OpReservedReadPipe = 276,
922 OpReservedWritePipe = 277,
923 OpReserveReadPipePackets = 278,
924 OpReserveWritePipePackets = 279,
925 OpCommitReadPipe = 280,
926 OpCommitWritePipe = 281,
927 OpIsValidReserveId = 282,
928 OpGetNumPipePackets = 283,
929 OpGetMaxPipePackets = 284,
930 OpGroupReserveReadPipePackets = 285,
931 OpGroupReserveWritePipePackets = 286,
932 OpGroupCommitReadPipe = 287,
933 OpGroupCommitWritePipe = 288,
934 OpEnqueueMarker = 291,
935 OpEnqueueKernel = 292,
936 OpGetKernelNDrangeSubGroupCount = 293,
937 OpGetKernelNDrangeMaxSubGroupSize = 294,
938 OpGetKernelWorkGroupSize = 295,
939 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
941 OpReleaseEvent = 298,
942 OpCreateUserEvent = 299,
943 OpIsValidEvent = 300,
944 OpSetUserEventStatus = 301,
945 OpCaptureEventProfilingInfo = 302,
946 OpGetDefaultQueue = 303,
947 OpBuildNDRange = 304,
948 OpImageSparseSampleImplicitLod = 305,
949 OpImageSparseSampleExplicitLod = 306,
950 OpImageSparseSampleDrefImplicitLod = 307,
951 OpImageSparseSampleDrefExplicitLod = 308,
952 OpImageSparseSampleProjImplicitLod = 309,
953 OpImageSparseSampleProjExplicitLod = 310,
954 OpImageSparseSampleProjDrefImplicitLod = 311,
955 OpImageSparseSampleProjDrefExplicitLod = 312,
956 OpImageSparseFetch = 313,
957 OpImageSparseGather = 314,
958 OpImageSparseDrefGather = 315,
959 OpImageSparseTexelsResident = 316,
961 OpAtomicFlagTestAndSet = 318,
962 OpAtomicFlagClear = 319,
963 OpImageSparseRead = 320,
965 OpTypePipeStorage = 322,
966 OpConstantPipeStorage = 323,
967 OpCreatePipeFromPipeStorage = 324,
968 OpGetKernelLocalSizeForSubgroupCount = 325,
969 OpGetKernelMaxNumSubgroups = 326,
970 OpTypeNamedBarrier = 327,
971 OpNamedBarrierInitialize = 328,
972 OpMemoryNamedBarrier = 329,
973 OpModuleProcessed = 330,
974 OpExecutionModeId = 331,
976 OpSubgroupBallotKHR = 4421,
977 OpSubgroupFirstInvocationKHR = 4422,
978 OpSubgroupAllKHR = 4428,
979 OpSubgroupAnyKHR = 4429,
980 OpSubgroupAllEqualKHR = 4430,
981 OpSubgroupReadInvocationKHR = 4432,
982 OpGroupIAddNonUniformAMD = 5000,
983 OpGroupFAddNonUniformAMD = 5001,
984 OpGroupFMinNonUniformAMD = 5002,
985 OpGroupUMinNonUniformAMD = 5003,
986 OpGroupSMinNonUniformAMD = 5004,
987 OpGroupFMaxNonUniformAMD = 5005,
988 OpGroupUMaxNonUniformAMD = 5006,
989 OpGroupSMaxNonUniformAMD = 5007,
993 // Overload operator| for mask bit combining
995 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
996 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
997 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
998 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
999 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
1000 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
1001 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
1002 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
1004 } // end namespace spv
1006 #endif // #ifndef spirv_HPP