1
// Copyright (c) 2014-2018 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,
391
HlslCounterBufferGOOGLE = 5634,
392
HlslSemanticGOOGLE = 5635,
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
BaryCoordNoPerspAMD = 4992,
449
BaryCoordNoPerspCentroidAMD = 4993,
450
BaryCoordNoPerspSampleAMD = 4994,
451
BaryCoordSmoothAMD = 4995,
452
BaryCoordSmoothCentroidAMD = 4996,
453
BaryCoordSmoothSampleAMD = 4997,
454
BaryCoordPullModelAMD = 4998,
455
FragStencilRefEXT = 5014,
456
ViewportMaskNV = 5253,
457
SecondaryPositionNV = 5257,
458
SecondaryViewportMaskNV = 5258,
459
PositionPerViewNV = 5261,
460
ViewportMaskPerViewNV = 5262,
464
enum class SelectionControlShift : unsigned {
470
enum class SelectionControlMask : unsigned {
472
Flatten = 0x00000001,
473
DontFlatten = 0x00000002,
476
enum class LoopControlShift : unsigned {
479
DependencyInfinite = 2,
480
DependencyLength = 3,
484
enum class LoopControlMask : unsigned {
487
DontUnroll = 0x00000002,
488
DependencyInfinite = 0x00000004,
489
DependencyLength = 0x00000008,
492
enum class FunctionControlShift : unsigned {
500
enum class FunctionControlMask : unsigned {
503
DontInline = 0x00000002,
508
enum class MemorySemanticsShift : unsigned {
512
SequentiallyConsistent = 4,
516
CrossWorkgroupMemory = 9,
517
AtomicCounterMemory = 10,
522
enum class MemorySemanticsMask : unsigned {
524
Acquire = 0x00000002,
525
Release = 0x00000004,
526
AcquireRelease = 0x00000008,
527
SequentiallyConsistent = 0x00000010,
528
UniformMemory = 0x00000040,
529
SubgroupMemory = 0x00000080,
530
WorkgroupMemory = 0x00000100,
531
CrossWorkgroupMemory = 0x00000200,
532
AtomicCounterMemory = 0x00000400,
533
ImageMemory = 0x00000800,
536
enum class MemoryAccessShift : unsigned {
543
enum class MemoryAccessMask : unsigned {
545
Volatile = 0x00000001,
546
Aligned = 0x00000002,
547
Nontemporal = 0x00000004,
550
enum class Scope : unsigned {
559
enum class GroupOperation : unsigned {
566
enum class KernelEnqueueFlags : unsigned {
573
enum class KernelProfilingInfoShift : unsigned {
578
enum class KernelProfilingInfoMask : unsigned {
580
CmdExecTime = 0x00000001,
583
enum class Capability : unsigned {
606
TessellationPointSize = 23,
607
GeometryPointSize = 24,
608
ImageGatherExtended = 25,
609
StorageImageMultisample = 27,
610
UniformBufferArrayDynamicIndexing = 28,
611
SampledImageArrayDynamicIndexing = 29,
612
StorageBufferArrayDynamicIndexing = 30,
613
StorageImageArrayDynamicIndexing = 31,
617
SampleRateShading = 35,
622
InputAttachment = 40,
623
SparseResidency = 41,
627
SampledCubeArray = 45,
631
StorageImageExtendedFormats = 49,
633
DerivativeControl = 51,
634
InterpolationFunction = 52,
635
TransformFeedback = 53,
636
GeometryStreams = 54,
637
StorageImageReadWithoutFormat = 55,
638
StorageImageWriteWithoutFormat = 56,
640
SubgroupDispatch = 58,
643
SubgroupBallotKHR = 4423,
644
DrawParameters = 4427,
645
SubgroupVoteKHR = 4431,
646
StorageBuffer16BitAccess = 4433,
647
StorageUniformBufferBlock16 = 4433,
648
StorageUniform16 = 4434,
649
UniformAndStorageBuffer16BitAccess = 4434,
650
StoragePushConstant16 = 4435,
651
StorageInputOutput16 = 4436,
654
VariablePointersStorageBuffer = 4441,
655
VariablePointers = 4442,
656
AtomicStorageOps = 4445,
657
SampleMaskPostDepthCoverage = 4447,
658
ImageGatherBiasLodAMD = 5009,
659
FragmentMaskAMD = 5010,
660
StencilExportEXT = 5013,
661
ImageReadWriteLodAMD = 5015,
662
SampleMaskOverrideCoverageNV = 5249,
663
GeometryShaderPassthroughNV = 5251,
664
ShaderViewportIndexLayerEXT = 5254,
665
ShaderViewportIndexLayerNV = 5254,
666
ShaderViewportMaskNV = 5255,
667
ShaderStereoViewNV = 5259,
668
PerViewAttributesNV = 5260,
669
SubgroupShuffleINTEL = 5568,
670
SubgroupBufferBlockIOINTEL = 5569,
671
SubgroupImageBlockIOINTEL = 5570,
675
enum class Op : unsigned {
678
OpSourceContinued = 2,
680
OpSourceExtension = 4,
686
OpExtInstImport = 11,
690
OpExecutionMode = 16,
700
OpTypeSampledImage = 27,
702
OpTypeRuntimeArray = 29,
708
OpTypeDeviceEvent = 35,
709
OpTypeReserveId = 36,
712
OpTypeForwardPointer = 39,
714
OpConstantFalse = 42,
716
OpConstantComposite = 44,
717
OpConstantSampler = 45,
719
OpSpecConstantTrue = 48,
720
OpSpecConstantFalse = 49,
722
OpSpecConstantComposite = 51,
723
OpSpecConstantOp = 52,
725
OpFunctionParameter = 55,
729
OpImageTexelPointer = 60,
733
OpCopyMemorySized = 64,
735
OpInBoundsAccessChain = 66,
736
OpPtrAccessChain = 67,
738
OpGenericPtrMemSemantics = 69,
739
OpInBoundsPtrAccessChain = 70,
741
OpMemberDecorate = 72,
742
OpDecorationGroup = 73,
743
OpGroupDecorate = 74,
744
OpGroupMemberDecorate = 75,
745
OpVectorExtractDynamic = 77,
746
OpVectorInsertDynamic = 78,
747
OpVectorShuffle = 79,
748
OpCompositeConstruct = 80,
749
OpCompositeExtract = 81,
750
OpCompositeInsert = 82,
754
OpImageSampleImplicitLod = 87,
755
OpImageSampleExplicitLod = 88,
756
OpImageSampleDrefImplicitLod = 89,
757
OpImageSampleDrefExplicitLod = 90,
758
OpImageSampleProjImplicitLod = 91,
759
OpImageSampleProjExplicitLod = 92,
760
OpImageSampleProjDrefImplicitLod = 93,
761
OpImageSampleProjDrefExplicitLod = 94,
764
OpImageDrefGather = 97,
768
OpImageQueryFormat = 101,
769
OpImageQueryOrder = 102,
770
OpImageQuerySizeLod = 103,
771
OpImageQuerySize = 104,
772
OpImageQueryLod = 105,
773
OpImageQueryLevels = 106,
774
OpImageQuerySamples = 107,
782
OpQuantizeToF16 = 116,
783
OpConvertPtrToU = 117,
784
OpSatConvertSToU = 118,
785
OpSatConvertUToS = 119,
786
OpConvertUToPtr = 120,
787
OpPtrCastToGeneric = 121,
788
OpGenericCastToPtr = 122,
789
OpGenericCastToPtrExplicit = 123,
807
OpVectorTimesScalar = 142,
808
OpMatrixTimesScalar = 143,
809
OpVectorTimesMatrix = 144,
810
OpMatrixTimesVector = 145,
811
OpMatrixTimesMatrix = 146,
812
OpOuterProduct = 147,
816
OpUMulExtended = 151,
817
OpSMulExtended = 152,
825
OpLessOrGreater = 161,
828
OpLogicalEqual = 164,
829
OpLogicalNotEqual = 165,
836
OpUGreaterThan = 172,
837
OpSGreaterThan = 173,
838
OpUGreaterThanEqual = 174,
839
OpSGreaterThanEqual = 175,
842
OpULessThanEqual = 178,
843
OpSLessThanEqual = 179,
846
OpFOrdNotEqual = 182,
847
OpFUnordNotEqual = 183,
848
OpFOrdLessThan = 184,
849
OpFUnordLessThan = 185,
850
OpFOrdGreaterThan = 186,
851
OpFUnordGreaterThan = 187,
852
OpFOrdLessThanEqual = 188,
853
OpFUnordLessThanEqual = 189,
854
OpFOrdGreaterThanEqual = 190,
855
OpFUnordGreaterThanEqual = 191,
856
OpShiftRightLogical = 194,
857
OpShiftRightArithmetic = 195,
858
OpShiftLeftLogical = 196,
863
OpBitFieldInsert = 201,
864
OpBitFieldSExtract = 202,
865
OpBitFieldUExtract = 203,
876
OpFwidthCoarse = 215,
878
OpEndPrimitive = 219,
879
OpEmitStreamVertex = 220,
880
OpEndStreamPrimitive = 221,
881
OpControlBarrier = 224,
882
OpMemoryBarrier = 225,
885
OpAtomicExchange = 229,
886
OpAtomicCompareExchange = 230,
887
OpAtomicCompareExchangeWeak = 231,
888
OpAtomicIIncrement = 232,
889
OpAtomicIDecrement = 233,
901
OpSelectionMerge = 247,
904
OpBranchConditional = 250,
910
OpLifetimeStart = 256,
911
OpLifetimeStop = 257,
912
OpGroupAsyncCopy = 259,
913
OpGroupWaitEvents = 260,
916
OpGroupBroadcast = 263,
927
OpReservedReadPipe = 276,
928
OpReservedWritePipe = 277,
929
OpReserveReadPipePackets = 278,
930
OpReserveWritePipePackets = 279,
931
OpCommitReadPipe = 280,
932
OpCommitWritePipe = 281,
933
OpIsValidReserveId = 282,
934
OpGetNumPipePackets = 283,
935
OpGetMaxPipePackets = 284,
936
OpGroupReserveReadPipePackets = 285,
937
OpGroupReserveWritePipePackets = 286,
938
OpGroupCommitReadPipe = 287,
939
OpGroupCommitWritePipe = 288,
940
OpEnqueueMarker = 291,
941
OpEnqueueKernel = 292,
942
OpGetKernelNDrangeSubGroupCount = 293,
943
OpGetKernelNDrangeMaxSubGroupSize = 294,
944
OpGetKernelWorkGroupSize = 295,
945
OpGetKernelPreferredWorkGroupSizeMultiple = 296,
947
OpReleaseEvent = 298,
948
OpCreateUserEvent = 299,
949
OpIsValidEvent = 300,
950
OpSetUserEventStatus = 301,
951
OpCaptureEventProfilingInfo = 302,
952
OpGetDefaultQueue = 303,
953
OpBuildNDRange = 304,
954
OpImageSparseSampleImplicitLod = 305,
955
OpImageSparseSampleExplicitLod = 306,
956
OpImageSparseSampleDrefImplicitLod = 307,
957
OpImageSparseSampleDrefExplicitLod = 308,
958
OpImageSparseSampleProjImplicitLod = 309,
959
OpImageSparseSampleProjExplicitLod = 310,
960
OpImageSparseSampleProjDrefImplicitLod = 311,
961
OpImageSparseSampleProjDrefExplicitLod = 312,
962
OpImageSparseFetch = 313,
963
OpImageSparseGather = 314,
964
OpImageSparseDrefGather = 315,
965
OpImageSparseTexelsResident = 316,
967
OpAtomicFlagTestAndSet = 318,
968
OpAtomicFlagClear = 319,
969
OpImageSparseRead = 320,
971
OpTypePipeStorage = 322,
972
OpConstantPipeStorage = 323,
973
OpCreatePipeFromPipeStorage = 324,
974
OpGetKernelLocalSizeForSubgroupCount = 325,
975
OpGetKernelMaxNumSubgroups = 326,
976
OpTypeNamedBarrier = 327,
977
OpNamedBarrierInitialize = 328,
978
OpMemoryNamedBarrier = 329,
979
OpModuleProcessed = 330,
981
OpSubgroupBallotKHR = 4421,
982
OpSubgroupFirstInvocationKHR = 4422,
983
OpSubgroupAllKHR = 4428,
984
OpSubgroupAnyKHR = 4429,
985
OpSubgroupAllEqualKHR = 4430,
986
OpSubgroupReadInvocationKHR = 4432,
987
OpGroupIAddNonUniformAMD = 5000,
988
OpGroupFAddNonUniformAMD = 5001,
989
OpGroupFMinNonUniformAMD = 5002,
990
OpGroupUMinNonUniformAMD = 5003,
991
OpGroupSMinNonUniformAMD = 5004,
992
OpGroupFMaxNonUniformAMD = 5005,
993
OpGroupUMaxNonUniformAMD = 5006,
994
OpGroupSMaxNonUniformAMD = 5007,
995
OpFragmentMaskFetchAMD = 5011,
996
OpFragmentFetchAMD = 5012,
997
OpSubgroupShuffleINTEL = 5571,
998
OpSubgroupShuffleDownINTEL = 5572,
999
OpSubgroupShuffleUpINTEL = 5573,
1000
OpSubgroupShuffleXorINTEL = 5574,
1001
OpSubgroupBlockReadINTEL = 5575,
1002
OpSubgroupBlockWriteINTEL = 5576,
1003
OpSubgroupImageBlockReadINTEL = 5577,
1004
OpSubgroupImageBlockWriteINTEL = 5578,
1005
OpDecorateStringGOOGLE = 5632,
1006
OpMemberDecorateStringGOOGLE = 5633,
1010
// Overload operator| for mask bit combining
1012
inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
1013
inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
1014
inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
1015
inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
1016
inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
1017
inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
1018
inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
1019
inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
1021
} // end namespace spv
1023
#endif // #ifndef spirv_HPP