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