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