1 // Copyright (c) 2014-2018 The Khronos Group Inc.
2 //
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:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Materials.
12 //
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/
16 //
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
23 // IN THE MATERIALS.
24 
25 // This header is automatically generated by the same tool that creates
26 // the Binary Section of the SPIR-V specification.
27 
28 // Enumeration tokens for SPIR-V, in various styles:
29 //   C, C++, C++11, JSON, Lua, Python
30 //
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']
36 //
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.
41 
42 #ifndef spirv_HPP
43 #define spirv_HPP
44 
45 namespace spv {
46 
47 typedef unsigned int Id;
48 
49 #define SPV_VERSION 0x10200
50 #define SPV_REVISION 2
51 
52 static const unsigned int MagicNumber = 0x07230203;
53 static const unsigned int Version = 0x00010200;
54 static const unsigned int Revision = 2;
55 static const unsigned int OpCodeMask = 0xffff;
56 static const unsigned int WordCountShift = 16;
57 
58 enum SourceLanguage {
59     SourceLanguageUnknown = 0,
60     SourceLanguageESSL = 1,
61     SourceLanguageGLSL = 2,
62     SourceLanguageOpenCL_C = 3,
63     SourceLanguageOpenCL_CPP = 4,
64     SourceLanguageHLSL = 5,
65     SourceLanguageMax = 0x7fffffff,
66 };
67 
68 enum ExecutionModel {
69     ExecutionModelVertex = 0,
70     ExecutionModelTessellationControl = 1,
71     ExecutionModelTessellationEvaluation = 2,
72     ExecutionModelGeometry = 3,
73     ExecutionModelFragment = 4,
74     ExecutionModelGLCompute = 5,
75     ExecutionModelKernel = 6,
76     ExecutionModelMax = 0x7fffffff,
77 };
78 
79 enum AddressingModel {
80     AddressingModelLogical = 0,
81     AddressingModelPhysical32 = 1,
82     AddressingModelPhysical64 = 2,
83     AddressingModelMax = 0x7fffffff,
84 };
85 
86 enum MemoryModel {
87     MemoryModelSimple = 0,
88     MemoryModelGLSL450 = 1,
89     MemoryModelOpenCL = 2,
90     MemoryModelMax = 0x7fffffff,
91 };
92 
93 enum ExecutionMode {
94     ExecutionModeInvocations = 0,
95     ExecutionModeSpacingEqual = 1,
96     ExecutionModeSpacingFractionalEven = 2,
97     ExecutionModeSpacingFractionalOdd = 3,
98     ExecutionModeVertexOrderCw = 4,
99     ExecutionModeVertexOrderCcw = 5,
100     ExecutionModePixelCenterInteger = 6,
101     ExecutionModeOriginUpperLeft = 7,
102     ExecutionModeOriginLowerLeft = 8,
103     ExecutionModeEarlyFragmentTests = 9,
104     ExecutionModePointMode = 10,
105     ExecutionModeXfb = 11,
106     ExecutionModeDepthReplacing = 12,
107     ExecutionModeDepthGreater = 14,
108     ExecutionModeDepthLess = 15,
109     ExecutionModeDepthUnchanged = 16,
110     ExecutionModeLocalSize = 17,
111     ExecutionModeLocalSizeHint = 18,
112     ExecutionModeInputPoints = 19,
113     ExecutionModeInputLines = 20,
114     ExecutionModeInputLinesAdjacency = 21,
115     ExecutionModeTriangles = 22,
116     ExecutionModeInputTrianglesAdjacency = 23,
117     ExecutionModeQuads = 24,
118     ExecutionModeIsolines = 25,
119     ExecutionModeOutputVertices = 26,
120     ExecutionModeOutputPoints = 27,
121     ExecutionModeOutputLineStrip = 28,
122     ExecutionModeOutputTriangleStrip = 29,
123     ExecutionModeVecTypeHint = 30,
124     ExecutionModeContractionOff = 31,
125     ExecutionModeInitializer = 33,
126     ExecutionModeFinalizer = 34,
127     ExecutionModeSubgroupSize = 35,
128     ExecutionModeSubgroupsPerWorkgroup = 36,
129     ExecutionModeSubgroupsPerWorkgroupId = 37,
130     ExecutionModeLocalSizeId = 38,
131     ExecutionModeLocalSizeHintId = 39,
132     ExecutionModePostDepthCoverage = 4446,
133     ExecutionModeStencilRefReplacingEXT = 5027,
134     ExecutionModeMax = 0x7fffffff,
135 };
136 
137 enum StorageClass {
138     StorageClassUniformConstant = 0,
139     StorageClassInput = 1,
140     StorageClassUniform = 2,
141     StorageClassOutput = 3,
142     StorageClassWorkgroup = 4,
143     StorageClassCrossWorkgroup = 5,
144     StorageClassPrivate = 6,
145     StorageClassFunction = 7,
146     StorageClassGeneric = 8,
147     StorageClassPushConstant = 9,
148     StorageClassAtomicCounter = 10,
149     StorageClassImage = 11,
150     StorageClassStorageBuffer = 12,
151     StorageClassMax = 0x7fffffff,
152 };
153 
154 enum Dim {
155     Dim1D = 0,
156     Dim2D = 1,
157     Dim3D = 2,
158     DimCube = 3,
159     DimRect = 4,
160     DimBuffer = 5,
161     DimSubpassData = 6,
162     DimMax = 0x7fffffff,
163 };
164 
165 enum SamplerAddressingMode {
166     SamplerAddressingModeNone = 0,
167     SamplerAddressingModeClampToEdge = 1,
168     SamplerAddressingModeClamp = 2,
169     SamplerAddressingModeRepeat = 3,
170     SamplerAddressingModeRepeatMirrored = 4,
171     SamplerAddressingModeMax = 0x7fffffff,
172 };
173 
174 enum SamplerFilterMode {
175     SamplerFilterModeNearest = 0,
176     SamplerFilterModeLinear = 1,
177     SamplerFilterModeMax = 0x7fffffff,
178 };
179 
180 enum ImageFormat {
181     ImageFormatUnknown = 0,
182     ImageFormatRgba32f = 1,
183     ImageFormatRgba16f = 2,
184     ImageFormatR32f = 3,
185     ImageFormatRgba8 = 4,
186     ImageFormatRgba8Snorm = 5,
187     ImageFormatRg32f = 6,
188     ImageFormatRg16f = 7,
189     ImageFormatR11fG11fB10f = 8,
190     ImageFormatR16f = 9,
191     ImageFormatRgba16 = 10,
192     ImageFormatRgb10A2 = 11,
193     ImageFormatRg16 = 12,
194     ImageFormatRg8 = 13,
195     ImageFormatR16 = 14,
196     ImageFormatR8 = 15,
197     ImageFormatRgba16Snorm = 16,
198     ImageFormatRg16Snorm = 17,
199     ImageFormatRg8Snorm = 18,
200     ImageFormatR16Snorm = 19,
201     ImageFormatR8Snorm = 20,
202     ImageFormatRgba32i = 21,
203     ImageFormatRgba16i = 22,
204     ImageFormatRgba8i = 23,
205     ImageFormatR32i = 24,
206     ImageFormatRg32i = 25,
207     ImageFormatRg16i = 26,
208     ImageFormatRg8i = 27,
209     ImageFormatR16i = 28,
210     ImageFormatR8i = 29,
211     ImageFormatRgba32ui = 30,
212     ImageFormatRgba16ui = 31,
213     ImageFormatRgba8ui = 32,
214     ImageFormatR32ui = 33,
215     ImageFormatRgb10a2ui = 34,
216     ImageFormatRg32ui = 35,
217     ImageFormatRg16ui = 36,
218     ImageFormatRg8ui = 37,
219     ImageFormatR16ui = 38,
220     ImageFormatR8ui = 39,
221     ImageFormatMax = 0x7fffffff,
222 };
223 
224 enum ImageChannelOrder {
225     ImageChannelOrderR = 0,
226     ImageChannelOrderA = 1,
227     ImageChannelOrderRG = 2,
228     ImageChannelOrderRA = 3,
229     ImageChannelOrderRGB = 4,
230     ImageChannelOrderRGBA = 5,
231     ImageChannelOrderBGRA = 6,
232     ImageChannelOrderARGB = 7,
233     ImageChannelOrderIntensity = 8,
234     ImageChannelOrderLuminance = 9,
235     ImageChannelOrderRx = 10,
236     ImageChannelOrderRGx = 11,
237     ImageChannelOrderRGBx = 12,
238     ImageChannelOrderDepth = 13,
239     ImageChannelOrderDepthStencil = 14,
240     ImageChannelOrdersRGB = 15,
241     ImageChannelOrdersRGBx = 16,
242     ImageChannelOrdersRGBA = 17,
243     ImageChannelOrdersBGRA = 18,
244     ImageChannelOrderABGR = 19,
245     ImageChannelOrderMax = 0x7fffffff,
246 };
247 
248 enum ImageChannelDataType {
249     ImageChannelDataTypeSnormInt8 = 0,
250     ImageChannelDataTypeSnormInt16 = 1,
251     ImageChannelDataTypeUnormInt8 = 2,
252     ImageChannelDataTypeUnormInt16 = 3,
253     ImageChannelDataTypeUnormShort565 = 4,
254     ImageChannelDataTypeUnormShort555 = 5,
255     ImageChannelDataTypeUnormInt101010 = 6,
256     ImageChannelDataTypeSignedInt8 = 7,
257     ImageChannelDataTypeSignedInt16 = 8,
258     ImageChannelDataTypeSignedInt32 = 9,
259     ImageChannelDataTypeUnsignedInt8 = 10,
260     ImageChannelDataTypeUnsignedInt16 = 11,
261     ImageChannelDataTypeUnsignedInt32 = 12,
262     ImageChannelDataTypeHalfFloat = 13,
263     ImageChannelDataTypeFloat = 14,
264     ImageChannelDataTypeUnormInt24 = 15,
265     ImageChannelDataTypeUnormInt101010_2 = 16,
266     ImageChannelDataTypeMax = 0x7fffffff,
267 };
268 
269 enum ImageOperandsShift {
270     ImageOperandsBiasShift = 0,
271     ImageOperandsLodShift = 1,
272     ImageOperandsGradShift = 2,
273     ImageOperandsConstOffsetShift = 3,
274     ImageOperandsOffsetShift = 4,
275     ImageOperandsConstOffsetsShift = 5,
276     ImageOperandsSampleShift = 6,
277     ImageOperandsMinLodShift = 7,
278     ImageOperandsMax = 0x7fffffff,
279 };
280 
281 enum ImageOperandsMask {
282     ImageOperandsMaskNone = 0,
283     ImageOperandsBiasMask = 0x00000001,
284     ImageOperandsLodMask = 0x00000002,
285     ImageOperandsGradMask = 0x00000004,
286     ImageOperandsConstOffsetMask = 0x00000008,
287     ImageOperandsOffsetMask = 0x00000010,
288     ImageOperandsConstOffsetsMask = 0x00000020,
289     ImageOperandsSampleMask = 0x00000040,
290     ImageOperandsMinLodMask = 0x00000080,
291 };
292 
293 enum FPFastMathModeShift {
294     FPFastMathModeNotNaNShift = 0,
295     FPFastMathModeNotInfShift = 1,
296     FPFastMathModeNSZShift = 2,
297     FPFastMathModeAllowRecipShift = 3,
298     FPFastMathModeFastShift = 4,
299     FPFastMathModeMax = 0x7fffffff,
300 };
301 
302 enum FPFastMathModeMask {
303     FPFastMathModeMaskNone = 0,
304     FPFastMathModeNotNaNMask = 0x00000001,
305     FPFastMathModeNotInfMask = 0x00000002,
306     FPFastMathModeNSZMask = 0x00000004,
307     FPFastMathModeAllowRecipMask = 0x00000008,
308     FPFastMathModeFastMask = 0x00000010,
309 };
310 
311 enum FPRoundingMode {
312     FPRoundingModeRTE = 0,
313     FPRoundingModeRTZ = 1,
314     FPRoundingModeRTP = 2,
315     FPRoundingModeRTN = 3,
316     FPRoundingModeMax = 0x7fffffff,
317 };
318 
319 enum LinkageType {
320     LinkageTypeExport = 0,
321     LinkageTypeImport = 1,
322     LinkageTypeMax = 0x7fffffff,
323 };
324 
325 enum AccessQualifier {
326     AccessQualifierReadOnly = 0,
327     AccessQualifierWriteOnly = 1,
328     AccessQualifierReadWrite = 2,
329     AccessQualifierMax = 0x7fffffff,
330 };
331 
332 enum FunctionParameterAttribute {
333     FunctionParameterAttributeZext = 0,
334     FunctionParameterAttributeSext = 1,
335     FunctionParameterAttributeByVal = 2,
336     FunctionParameterAttributeSret = 3,
337     FunctionParameterAttributeNoAlias = 4,
338     FunctionParameterAttributeNoCapture = 5,
339     FunctionParameterAttributeNoWrite = 6,
340     FunctionParameterAttributeNoReadWrite = 7,
341     FunctionParameterAttributeMax = 0x7fffffff,
342 };
343 
344 enum Decoration {
345     DecorationRelaxedPrecision = 0,
346     DecorationSpecId = 1,
347     DecorationBlock = 2,
348     DecorationBufferBlock = 3,
349     DecorationRowMajor = 4,
350     DecorationColMajor = 5,
351     DecorationArrayStride = 6,
352     DecorationMatrixStride = 7,
353     DecorationGLSLShared = 8,
354     DecorationGLSLPacked = 9,
355     DecorationCPacked = 10,
356     DecorationBuiltIn = 11,
357     DecorationNoPerspective = 13,
358     DecorationFlat = 14,
359     DecorationPatch = 15,
360     DecorationCentroid = 16,
361     DecorationSample = 17,
362     DecorationInvariant = 18,
363     DecorationRestrict = 19,
364     DecorationAliased = 20,
365     DecorationVolatile = 21,
366     DecorationConstant = 22,
367     DecorationCoherent = 23,
368     DecorationNonWritable = 24,
369     DecorationNonReadable = 25,
370     DecorationUniform = 26,
371     DecorationSaturatedConversion = 28,
372     DecorationStream = 29,
373     DecorationLocation = 30,
374     DecorationComponent = 31,
375     DecorationIndex = 32,
376     DecorationBinding = 33,
377     DecorationDescriptorSet = 34,
378     DecorationOffset = 35,
379     DecorationXfbBuffer = 36,
380     DecorationXfbStride = 37,
381     DecorationFuncParamAttr = 38,
382     DecorationFPRoundingMode = 39,
383     DecorationFPFastMathMode = 40,
384     DecorationLinkageAttributes = 41,
385     DecorationNoContraction = 42,
386     DecorationInputAttachmentIndex = 43,
387     DecorationAlignment = 44,
388     DecorationMaxByteOffset = 45,
389     DecorationAlignmentId = 46,
390     DecorationMaxByteOffsetId = 47,
391     DecorationExplicitInterpAMD = 4999,
392     DecorationOverrideCoverageNV = 5248,
393     DecorationPassthroughNV = 5250,
394     DecorationViewportRelativeNV = 5252,
395     DecorationSecondaryViewportRelativeNV = 5256,
396     DecorationHlslCounterBufferGOOGLE = 5634,
397     DecorationHlslSemanticGOOGLE = 5635,
398     DecorationMax = 0x7fffffff,
399 };
400 
401 enum BuiltIn {
402     BuiltInPosition = 0,
403     BuiltInPointSize = 1,
404     BuiltInClipDistance = 3,
405     BuiltInCullDistance = 4,
406     BuiltInVertexId = 5,
407     BuiltInInstanceId = 6,
408     BuiltInPrimitiveId = 7,
409     BuiltInInvocationId = 8,
410     BuiltInLayer = 9,
411     BuiltInViewportIndex = 10,
412     BuiltInTessLevelOuter = 11,
413     BuiltInTessLevelInner = 12,
414     BuiltInTessCoord = 13,
415     BuiltInPatchVertices = 14,
416     BuiltInFragCoord = 15,
417     BuiltInPointCoord = 16,
418     BuiltInFrontFacing = 17,
419     BuiltInSampleId = 18,
420     BuiltInSamplePosition = 19,
421     BuiltInSampleMask = 20,
422     BuiltInFragDepth = 22,
423     BuiltInHelperInvocation = 23,
424     BuiltInNumWorkgroups = 24,
425     BuiltInWorkgroupSize = 25,
426     BuiltInWorkgroupId = 26,
427     BuiltInLocalInvocationId = 27,
428     BuiltInGlobalInvocationId = 28,
429     BuiltInLocalInvocationIndex = 29,
430     BuiltInWorkDim = 30,
431     BuiltInGlobalSize = 31,
432     BuiltInEnqueuedWorkgroupSize = 32,
433     BuiltInGlobalOffset = 33,
434     BuiltInGlobalLinearId = 34,
435     BuiltInSubgroupSize = 36,
436     BuiltInSubgroupMaxSize = 37,
437     BuiltInNumSubgroups = 38,
438     BuiltInNumEnqueuedSubgroups = 39,
439     BuiltInSubgroupId = 40,
440     BuiltInSubgroupLocalInvocationId = 41,
441     BuiltInVertexIndex = 42,
442     BuiltInInstanceIndex = 43,
443     BuiltInSubgroupEqMaskKHR = 4416,
444     BuiltInSubgroupGeMaskKHR = 4417,
445     BuiltInSubgroupGtMaskKHR = 4418,
446     BuiltInSubgroupLeMaskKHR = 4419,
447     BuiltInSubgroupLtMaskKHR = 4420,
448     BuiltInBaseVertex = 4424,
449     BuiltInBaseInstance = 4425,
450     BuiltInDrawIndex = 4426,
451     BuiltInDeviceIndex = 4438,
452     BuiltInViewIndex = 4440,
453     BuiltInBaryCoordNoPerspAMD = 4992,
454     BuiltInBaryCoordNoPerspCentroidAMD = 4993,
455     BuiltInBaryCoordNoPerspSampleAMD = 4994,
456     BuiltInBaryCoordSmoothAMD = 4995,
457     BuiltInBaryCoordSmoothCentroidAMD = 4996,
458     BuiltInBaryCoordSmoothSampleAMD = 4997,
459     BuiltInBaryCoordPullModelAMD = 4998,
460     BuiltInFragStencilRefEXT = 5014,
461     BuiltInViewportMaskNV = 5253,
462     BuiltInSecondaryPositionNV = 5257,
463     BuiltInSecondaryViewportMaskNV = 5258,
464     BuiltInPositionPerViewNV = 5261,
465     BuiltInViewportMaskPerViewNV = 5262,
466     BuiltInMax = 0x7fffffff,
467 };
468 
469 enum SelectionControlShift {
470     SelectionControlFlattenShift = 0,
471     SelectionControlDontFlattenShift = 1,
472     SelectionControlMax = 0x7fffffff,
473 };
474 
475 enum SelectionControlMask {
476     SelectionControlMaskNone = 0,
477     SelectionControlFlattenMask = 0x00000001,
478     SelectionControlDontFlattenMask = 0x00000002,
479 };
480 
481 enum LoopControlShift {
482     LoopControlUnrollShift = 0,
483     LoopControlDontUnrollShift = 1,
484     LoopControlDependencyInfiniteShift = 2,
485     LoopControlDependencyLengthShift = 3,
486     LoopControlMax = 0x7fffffff,
487 };
488 
489 enum LoopControlMask {
490     LoopControlMaskNone = 0,
491     LoopControlUnrollMask = 0x00000001,
492     LoopControlDontUnrollMask = 0x00000002,
493     LoopControlDependencyInfiniteMask = 0x00000004,
494     LoopControlDependencyLengthMask = 0x00000008,
495 };
496 
497 enum FunctionControlShift {
498     FunctionControlInlineShift = 0,
499     FunctionControlDontInlineShift = 1,
500     FunctionControlPureShift = 2,
501     FunctionControlConstShift = 3,
502     FunctionControlMax = 0x7fffffff,
503 };
504 
505 enum FunctionControlMask {
506     FunctionControlMaskNone = 0,
507     FunctionControlInlineMask = 0x00000001,
508     FunctionControlDontInlineMask = 0x00000002,
509     FunctionControlPureMask = 0x00000004,
510     FunctionControlConstMask = 0x00000008,
511 };
512 
513 enum MemorySemanticsShift {
514     MemorySemanticsAcquireShift = 1,
515     MemorySemanticsReleaseShift = 2,
516     MemorySemanticsAcquireReleaseShift = 3,
517     MemorySemanticsSequentiallyConsistentShift = 4,
518     MemorySemanticsUniformMemoryShift = 6,
519     MemorySemanticsSubgroupMemoryShift = 7,
520     MemorySemanticsWorkgroupMemoryShift = 8,
521     MemorySemanticsCrossWorkgroupMemoryShift = 9,
522     MemorySemanticsAtomicCounterMemoryShift = 10,
523     MemorySemanticsImageMemoryShift = 11,
524     MemorySemanticsMax = 0x7fffffff,
525 };
526 
527 enum MemorySemanticsMask {
528     MemorySemanticsMaskNone = 0,
529     MemorySemanticsAcquireMask = 0x00000002,
530     MemorySemanticsReleaseMask = 0x00000004,
531     MemorySemanticsAcquireReleaseMask = 0x00000008,
532     MemorySemanticsSequentiallyConsistentMask = 0x00000010,
533     MemorySemanticsUniformMemoryMask = 0x00000040,
534     MemorySemanticsSubgroupMemoryMask = 0x00000080,
535     MemorySemanticsWorkgroupMemoryMask = 0x00000100,
536     MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
537     MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
538     MemorySemanticsImageMemoryMask = 0x00000800,
539 };
540 
541 enum MemoryAccessShift {
542     MemoryAccessVolatileShift = 0,
543     MemoryAccessAlignedShift = 1,
544     MemoryAccessNontemporalShift = 2,
545     MemoryAccessMax = 0x7fffffff,
546 };
547 
548 enum MemoryAccessMask {
549     MemoryAccessMaskNone = 0,
550     MemoryAccessVolatileMask = 0x00000001,
551     MemoryAccessAlignedMask = 0x00000002,
552     MemoryAccessNontemporalMask = 0x00000004,
553 };
554 
555 enum Scope {
556     ScopeCrossDevice = 0,
557     ScopeDevice = 1,
558     ScopeWorkgroup = 2,
559     ScopeSubgroup = 3,
560     ScopeInvocation = 4,
561     ScopeMax = 0x7fffffff,
562 };
563 
564 enum GroupOperation {
565     GroupOperationReduce = 0,
566     GroupOperationInclusiveScan = 1,
567     GroupOperationExclusiveScan = 2,
568     GroupOperationMax = 0x7fffffff,
569 };
570 
571 enum KernelEnqueueFlags {
572     KernelEnqueueFlagsNoWait = 0,
573     KernelEnqueueFlagsWaitKernel = 1,
574     KernelEnqueueFlagsWaitWorkGroup = 2,
575     KernelEnqueueFlagsMax = 0x7fffffff,
576 };
577 
578 enum KernelProfilingInfoShift {
579     KernelProfilingInfoCmdExecTimeShift = 0,
580     KernelProfilingInfoMax = 0x7fffffff,
581 };
582 
583 enum KernelProfilingInfoMask {
584     KernelProfilingInfoMaskNone = 0,
585     KernelProfilingInfoCmdExecTimeMask = 0x00000001,
586 };
587 
588 enum Capability {
589     CapabilityMatrix = 0,
590     CapabilityShader = 1,
591     CapabilityGeometry = 2,
592     CapabilityTessellation = 3,
593     CapabilityAddresses = 4,
594     CapabilityLinkage = 5,
595     CapabilityKernel = 6,
596     CapabilityVector16 = 7,
597     CapabilityFloat16Buffer = 8,
598     CapabilityFloat16 = 9,
599     CapabilityFloat64 = 10,
600     CapabilityInt64 = 11,
601     CapabilityInt64Atomics = 12,
602     CapabilityImageBasic = 13,
603     CapabilityImageReadWrite = 14,
604     CapabilityImageMipmap = 15,
605     CapabilityPipes = 17,
606     CapabilityGroups = 18,
607     CapabilityDeviceEnqueue = 19,
608     CapabilityLiteralSampler = 20,
609     CapabilityAtomicStorage = 21,
610     CapabilityInt16 = 22,
611     CapabilityTessellationPointSize = 23,
612     CapabilityGeometryPointSize = 24,
613     CapabilityImageGatherExtended = 25,
614     CapabilityStorageImageMultisample = 27,
615     CapabilityUniformBufferArrayDynamicIndexing = 28,
616     CapabilitySampledImageArrayDynamicIndexing = 29,
617     CapabilityStorageBufferArrayDynamicIndexing = 30,
618     CapabilityStorageImageArrayDynamicIndexing = 31,
619     CapabilityClipDistance = 32,
620     CapabilityCullDistance = 33,
621     CapabilityImageCubeArray = 34,
622     CapabilitySampleRateShading = 35,
623     CapabilityImageRect = 36,
624     CapabilitySampledRect = 37,
625     CapabilityGenericPointer = 38,
626     CapabilityInt8 = 39,
627     CapabilityInputAttachment = 40,
628     CapabilitySparseResidency = 41,
629     CapabilityMinLod = 42,
630     CapabilitySampled1D = 43,
631     CapabilityImage1D = 44,
632     CapabilitySampledCubeArray = 45,
633     CapabilitySampledBuffer = 46,
634     CapabilityImageBuffer = 47,
635     CapabilityImageMSArray = 48,
636     CapabilityStorageImageExtendedFormats = 49,
637     CapabilityImageQuery = 50,
638     CapabilityDerivativeControl = 51,
639     CapabilityInterpolationFunction = 52,
640     CapabilityTransformFeedback = 53,
641     CapabilityGeometryStreams = 54,
642     CapabilityStorageImageReadWithoutFormat = 55,
643     CapabilityStorageImageWriteWithoutFormat = 56,
644     CapabilityMultiViewport = 57,
645     CapabilitySubgroupDispatch = 58,
646     CapabilityNamedBarrier = 59,
647     CapabilityPipeStorage = 60,
648     CapabilitySubgroupBallotKHR = 4423,
649     CapabilityDrawParameters = 4427,
650     CapabilitySubgroupVoteKHR = 4431,
651     CapabilityStorageBuffer16BitAccess = 4433,
652     CapabilityStorageUniformBufferBlock16 = 4433,
653     CapabilityStorageUniform16 = 4434,
654     CapabilityUniformAndStorageBuffer16BitAccess = 4434,
655     CapabilityStoragePushConstant16 = 4435,
656     CapabilityStorageInputOutput16 = 4436,
657     CapabilityDeviceGroup = 4437,
658     CapabilityMultiView = 4439,
659     CapabilityVariablePointersStorageBuffer = 4441,
660     CapabilityVariablePointers = 4442,
661     CapabilityAtomicStorageOps = 4445,
662     CapabilitySampleMaskPostDepthCoverage = 4447,
663     CapabilityImageGatherBiasLodAMD = 5009,
664     CapabilityFragmentMaskAMD = 5010,
665     CapabilityStencilExportEXT = 5013,
666     CapabilityImageReadWriteLodAMD = 5015,
667     CapabilitySampleMaskOverrideCoverageNV = 5249,
668     CapabilityGeometryShaderPassthroughNV = 5251,
669     CapabilityShaderViewportIndexLayerEXT = 5254,
670     CapabilityShaderViewportIndexLayerNV = 5254,
671     CapabilityShaderViewportMaskNV = 5255,
672     CapabilityShaderStereoViewNV = 5259,
673     CapabilityPerViewAttributesNV = 5260,
674     CapabilitySubgroupShuffleINTEL = 5568,
675     CapabilitySubgroupBufferBlockIOINTEL = 5569,
676     CapabilitySubgroupImageBlockIOINTEL = 5570,
677     CapabilityMax = 0x7fffffff,
678 };
679 
680 enum Op {
681     OpNop = 0,
682     OpUndef = 1,
683     OpSourceContinued = 2,
684     OpSource = 3,
685     OpSourceExtension = 4,
686     OpName = 5,
687     OpMemberName = 6,
688     OpString = 7,
689     OpLine = 8,
690     OpExtension = 10,
691     OpExtInstImport = 11,
692     OpExtInst = 12,
693     OpMemoryModel = 14,
694     OpEntryPoint = 15,
695     OpExecutionMode = 16,
696     OpCapability = 17,
697     OpTypeVoid = 19,
698     OpTypeBool = 20,
699     OpTypeInt = 21,
700     OpTypeFloat = 22,
701     OpTypeVector = 23,
702     OpTypeMatrix = 24,
703     OpTypeImage = 25,
704     OpTypeSampler = 26,
705     OpTypeSampledImage = 27,
706     OpTypeArray = 28,
707     OpTypeRuntimeArray = 29,
708     OpTypeStruct = 30,
709     OpTypeOpaque = 31,
710     OpTypePointer = 32,
711     OpTypeFunction = 33,
712     OpTypeEvent = 34,
713     OpTypeDeviceEvent = 35,
714     OpTypeReserveId = 36,
715     OpTypeQueue = 37,
716     OpTypePipe = 38,
717     OpTypeForwardPointer = 39,
718     OpConstantTrue = 41,
719     OpConstantFalse = 42,
720     OpConstant = 43,
721     OpConstantComposite = 44,
722     OpConstantSampler = 45,
723     OpConstantNull = 46,
724     OpSpecConstantTrue = 48,
725     OpSpecConstantFalse = 49,
726     OpSpecConstant = 50,
727     OpSpecConstantComposite = 51,
728     OpSpecConstantOp = 52,
729     OpFunction = 54,
730     OpFunctionParameter = 55,
731     OpFunctionEnd = 56,
732     OpFunctionCall = 57,
733     OpVariable = 59,
734     OpImageTexelPointer = 60,
735     OpLoad = 61,
736     OpStore = 62,
737     OpCopyMemory = 63,
738     OpCopyMemorySized = 64,
739     OpAccessChain = 65,
740     OpInBoundsAccessChain = 66,
741     OpPtrAccessChain = 67,
742     OpArrayLength = 68,
743     OpGenericPtrMemSemantics = 69,
744     OpInBoundsPtrAccessChain = 70,
745     OpDecorate = 71,
746     OpMemberDecorate = 72,
747     OpDecorationGroup = 73,
748     OpGroupDecorate = 74,
749     OpGroupMemberDecorate = 75,
750     OpVectorExtractDynamic = 77,
751     OpVectorInsertDynamic = 78,
752     OpVectorShuffle = 79,
753     OpCompositeConstruct = 80,
754     OpCompositeExtract = 81,
755     OpCompositeInsert = 82,
756     OpCopyObject = 83,
757     OpTranspose = 84,
758     OpSampledImage = 86,
759     OpImageSampleImplicitLod = 87,
760     OpImageSampleExplicitLod = 88,
761     OpImageSampleDrefImplicitLod = 89,
762     OpImageSampleDrefExplicitLod = 90,
763     OpImageSampleProjImplicitLod = 91,
764     OpImageSampleProjExplicitLod = 92,
765     OpImageSampleProjDrefImplicitLod = 93,
766     OpImageSampleProjDrefExplicitLod = 94,
767     OpImageFetch = 95,
768     OpImageGather = 96,
769     OpImageDrefGather = 97,
770     OpImageRead = 98,
771     OpImageWrite = 99,
772     OpImage = 100,
773     OpImageQueryFormat = 101,
774     OpImageQueryOrder = 102,
775     OpImageQuerySizeLod = 103,
776     OpImageQuerySize = 104,
777     OpImageQueryLod = 105,
778     OpImageQueryLevels = 106,
779     OpImageQuerySamples = 107,
780     OpConvertFToU = 109,
781     OpConvertFToS = 110,
782     OpConvertSToF = 111,
783     OpConvertUToF = 112,
784     OpUConvert = 113,
785     OpSConvert = 114,
786     OpFConvert = 115,
787     OpQuantizeToF16 = 116,
788     OpConvertPtrToU = 117,
789     OpSatConvertSToU = 118,
790     OpSatConvertUToS = 119,
791     OpConvertUToPtr = 120,
792     OpPtrCastToGeneric = 121,
793     OpGenericCastToPtr = 122,
794     OpGenericCastToPtrExplicit = 123,
795     OpBitcast = 124,
796     OpSNegate = 126,
797     OpFNegate = 127,
798     OpIAdd = 128,
799     OpFAdd = 129,
800     OpISub = 130,
801     OpFSub = 131,
802     OpIMul = 132,
803     OpFMul = 133,
804     OpUDiv = 134,
805     OpSDiv = 135,
806     OpFDiv = 136,
807     OpUMod = 137,
808     OpSRem = 138,
809     OpSMod = 139,
810     OpFRem = 140,
811     OpFMod = 141,
812     OpVectorTimesScalar = 142,
813     OpMatrixTimesScalar = 143,
814     OpVectorTimesMatrix = 144,
815     OpMatrixTimesVector = 145,
816     OpMatrixTimesMatrix = 146,
817     OpOuterProduct = 147,
818     OpDot = 148,
819     OpIAddCarry = 149,
820     OpISubBorrow = 150,
821     OpUMulExtended = 151,
822     OpSMulExtended = 152,
823     OpAny = 154,
824     OpAll = 155,
825     OpIsNan = 156,
826     OpIsInf = 157,
827     OpIsFinite = 158,
828     OpIsNormal = 159,
829     OpSignBitSet = 160,
830     OpLessOrGreater = 161,
831     OpOrdered = 162,
832     OpUnordered = 163,
833     OpLogicalEqual = 164,
834     OpLogicalNotEqual = 165,
835     OpLogicalOr = 166,
836     OpLogicalAnd = 167,
837     OpLogicalNot = 168,
838     OpSelect = 169,
839     OpIEqual = 170,
840     OpINotEqual = 171,
841     OpUGreaterThan = 172,
842     OpSGreaterThan = 173,
843     OpUGreaterThanEqual = 174,
844     OpSGreaterThanEqual = 175,
845     OpULessThan = 176,
846     OpSLessThan = 177,
847     OpULessThanEqual = 178,
848     OpSLessThanEqual = 179,
849     OpFOrdEqual = 180,
850     OpFUnordEqual = 181,
851     OpFOrdNotEqual = 182,
852     OpFUnordNotEqual = 183,
853     OpFOrdLessThan = 184,
854     OpFUnordLessThan = 185,
855     OpFOrdGreaterThan = 186,
856     OpFUnordGreaterThan = 187,
857     OpFOrdLessThanEqual = 188,
858     OpFUnordLessThanEqual = 189,
859     OpFOrdGreaterThanEqual = 190,
860     OpFUnordGreaterThanEqual = 191,
861     OpShiftRightLogical = 194,
862     OpShiftRightArithmetic = 195,
863     OpShiftLeftLogical = 196,
864     OpBitwiseOr = 197,
865     OpBitwiseXor = 198,
866     OpBitwiseAnd = 199,
867     OpNot = 200,
868     OpBitFieldInsert = 201,
869     OpBitFieldSExtract = 202,
870     OpBitFieldUExtract = 203,
871     OpBitReverse = 204,
872     OpBitCount = 205,
873     OpDPdx = 207,
874     OpDPdy = 208,
875     OpFwidth = 209,
876     OpDPdxFine = 210,
877     OpDPdyFine = 211,
878     OpFwidthFine = 212,
879     OpDPdxCoarse = 213,
880     OpDPdyCoarse = 214,
881     OpFwidthCoarse = 215,
882     OpEmitVertex = 218,
883     OpEndPrimitive = 219,
884     OpEmitStreamVertex = 220,
885     OpEndStreamPrimitive = 221,
886     OpControlBarrier = 224,
887     OpMemoryBarrier = 225,
888     OpAtomicLoad = 227,
889     OpAtomicStore = 228,
890     OpAtomicExchange = 229,
891     OpAtomicCompareExchange = 230,
892     OpAtomicCompareExchangeWeak = 231,
893     OpAtomicIIncrement = 232,
894     OpAtomicIDecrement = 233,
895     OpAtomicIAdd = 234,
896     OpAtomicISub = 235,
897     OpAtomicSMin = 236,
898     OpAtomicUMin = 237,
899     OpAtomicSMax = 238,
900     OpAtomicUMax = 239,
901     OpAtomicAnd = 240,
902     OpAtomicOr = 241,
903     OpAtomicXor = 242,
904     OpPhi = 245,
905     OpLoopMerge = 246,
906     OpSelectionMerge = 247,
907     OpLabel = 248,
908     OpBranch = 249,
909     OpBranchConditional = 250,
910     OpSwitch = 251,
911     OpKill = 252,
912     OpReturn = 253,
913     OpReturnValue = 254,
914     OpUnreachable = 255,
915     OpLifetimeStart = 256,
916     OpLifetimeStop = 257,
917     OpGroupAsyncCopy = 259,
918     OpGroupWaitEvents = 260,
919     OpGroupAll = 261,
920     OpGroupAny = 262,
921     OpGroupBroadcast = 263,
922     OpGroupIAdd = 264,
923     OpGroupFAdd = 265,
924     OpGroupFMin = 266,
925     OpGroupUMin = 267,
926     OpGroupSMin = 268,
927     OpGroupFMax = 269,
928     OpGroupUMax = 270,
929     OpGroupSMax = 271,
930     OpReadPipe = 274,
931     OpWritePipe = 275,
932     OpReservedReadPipe = 276,
933     OpReservedWritePipe = 277,
934     OpReserveReadPipePackets = 278,
935     OpReserveWritePipePackets = 279,
936     OpCommitReadPipe = 280,
937     OpCommitWritePipe = 281,
938     OpIsValidReserveId = 282,
939     OpGetNumPipePackets = 283,
940     OpGetMaxPipePackets = 284,
941     OpGroupReserveReadPipePackets = 285,
942     OpGroupReserveWritePipePackets = 286,
943     OpGroupCommitReadPipe = 287,
944     OpGroupCommitWritePipe = 288,
945     OpEnqueueMarker = 291,
946     OpEnqueueKernel = 292,
947     OpGetKernelNDrangeSubGroupCount = 293,
948     OpGetKernelNDrangeMaxSubGroupSize = 294,
949     OpGetKernelWorkGroupSize = 295,
950     OpGetKernelPreferredWorkGroupSizeMultiple = 296,
951     OpRetainEvent = 297,
952     OpReleaseEvent = 298,
953     OpCreateUserEvent = 299,
954     OpIsValidEvent = 300,
955     OpSetUserEventStatus = 301,
956     OpCaptureEventProfilingInfo = 302,
957     OpGetDefaultQueue = 303,
958     OpBuildNDRange = 304,
959     OpImageSparseSampleImplicitLod = 305,
960     OpImageSparseSampleExplicitLod = 306,
961     OpImageSparseSampleDrefImplicitLod = 307,
962     OpImageSparseSampleDrefExplicitLod = 308,
963     OpImageSparseSampleProjImplicitLod = 309,
964     OpImageSparseSampleProjExplicitLod = 310,
965     OpImageSparseSampleProjDrefImplicitLod = 311,
966     OpImageSparseSampleProjDrefExplicitLod = 312,
967     OpImageSparseFetch = 313,
968     OpImageSparseGather = 314,
969     OpImageSparseDrefGather = 315,
970     OpImageSparseTexelsResident = 316,
971     OpNoLine = 317,
972     OpAtomicFlagTestAndSet = 318,
973     OpAtomicFlagClear = 319,
974     OpImageSparseRead = 320,
975     OpSizeOf = 321,
976     OpTypePipeStorage = 322,
977     OpConstantPipeStorage = 323,
978     OpCreatePipeFromPipeStorage = 324,
979     OpGetKernelLocalSizeForSubgroupCount = 325,
980     OpGetKernelMaxNumSubgroups = 326,
981     OpTypeNamedBarrier = 327,
982     OpNamedBarrierInitialize = 328,
983     OpMemoryNamedBarrier = 329,
984     OpModuleProcessed = 330,
985     OpExecutionModeId = 331,
986     OpDecorateId = 332,
987     OpSubgroupBallotKHR = 4421,
988     OpSubgroupFirstInvocationKHR = 4422,
989     OpSubgroupAllKHR = 4428,
990     OpSubgroupAnyKHR = 4429,
991     OpSubgroupAllEqualKHR = 4430,
992     OpSubgroupReadInvocationKHR = 4432,
993     OpGroupIAddNonUniformAMD = 5000,
994     OpGroupFAddNonUniformAMD = 5001,
995     OpGroupFMinNonUniformAMD = 5002,
996     OpGroupUMinNonUniformAMD = 5003,
997     OpGroupSMinNonUniformAMD = 5004,
998     OpGroupFMaxNonUniformAMD = 5005,
999     OpGroupUMaxNonUniformAMD = 5006,
1000     OpGroupSMaxNonUniformAMD = 5007,
1001     OpFragmentMaskFetchAMD = 5011,
1002     OpFragmentFetchAMD = 5012,
1003     OpSubgroupShuffleINTEL = 5571,
1004     OpSubgroupShuffleDownINTEL = 5572,
1005     OpSubgroupShuffleUpINTEL = 5573,
1006     OpSubgroupShuffleXorINTEL = 5574,
1007     OpSubgroupBlockReadINTEL = 5575,
1008     OpSubgroupBlockWriteINTEL = 5576,
1009     OpSubgroupImageBlockReadINTEL = 5577,
1010     OpSubgroupImageBlockWriteINTEL = 5578,
1011     OpDecorateStringGOOGLE = 5632,
1012     OpMemberDecorateStringGOOGLE = 5633,
1013     OpMax = 0x7fffffff,
1014 };
1015 
1016 // Overload operator| for mask bit combining
1017 
operator |(ImageOperandsMask a,ImageOperandsMask b)1018 inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
operator |(FPFastMathModeMask a,FPFastMathModeMask b)1019 inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
operator |(SelectionControlMask a,SelectionControlMask b)1020 inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
operator |(LoopControlMask a,LoopControlMask b)1021 inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
operator |(FunctionControlMask a,FunctionControlMask b)1022 inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
operator |(MemorySemanticsMask a,MemorySemanticsMask b)1023 inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
operator |(MemoryAccessMask a,MemoryAccessMask b)1024 inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
operator |(KernelProfilingInfoMask a,KernelProfilingInfoMask b)1025 inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
1026 
1027 }  // end namespace spv
1028 
1029 #endif  // #ifndef spirv_HPP
1030 
1031