blob: c6776638e18433397d348ea742baaeddd39ef4e6 [file] [log] [blame]
John Kessenich6c1c2762018-01-29 16:16:11 -07001// Copyright (c) 2014-2018 The Khronos Group Inc.
John Kessenich4016e382016-07-15 11:53:56 -06002//
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
45namespace spv {
46
47typedef unsigned int Id;
48
John Kessenich6c1c2762018-01-29 16:16:11 -070049#define SPV_VERSION 0x10200
50#define SPV_REVISION 3
John Kessenich4016e382016-07-15 11:53:56 -060051
52static const unsigned int MagicNumber = 0x07230203;
John Kessenich6c1c2762018-01-29 16:16:11 -070053static const unsigned int Version = 0x00010200;
54static const unsigned int Revision = 3;
John Kessenich4016e382016-07-15 11:53:56 -060055static const unsigned int OpCodeMask = 0xffff;
56static const unsigned int WordCountShift = 16;
57
58enum SourceLanguage {
59 SourceLanguageUnknown = 0,
60 SourceLanguageESSL = 1,
61 SourceLanguageGLSL = 2,
62 SourceLanguageOpenCL_C = 3,
63 SourceLanguageOpenCL_CPP = 4,
John Kessenich38a42532017-04-06 17:21:58 -060064 SourceLanguageHLSL = 5,
John Kessenich4016e382016-07-15 11:53:56 -060065 SourceLanguageMax = 0x7fffffff,
66};
67
68enum 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
79enum AddressingModel {
80 AddressingModelLogical = 0,
81 AddressingModelPhysical32 = 1,
82 AddressingModelPhysical64 = 2,
83 AddressingModelMax = 0x7fffffff,
84};
85
86enum MemoryModel {
87 MemoryModelSimple = 0,
88 MemoryModelGLSL450 = 1,
89 MemoryModelOpenCL = 2,
90 MemoryModelMax = 0x7fffffff,
91};
92
93enum 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,
John Kessenich6c1c2762018-01-29 16:16:11 -0700125 ExecutionModeInitializer = 33,
126 ExecutionModeFinalizer = 34,
127 ExecutionModeSubgroupSize = 35,
128 ExecutionModeSubgroupsPerWorkgroup = 36,
129 ExecutionModeSubgroupsPerWorkgroupId = 37,
130 ExecutionModeLocalSizeId = 38,
131 ExecutionModeLocalSizeHintId = 39,
chaocc1204522017-06-30 17:14:30 -0700132 ExecutionModePostDepthCoverage = 4446,
John Kesseniche9e0cb62017-12-14 02:57:28 -0700133 ExecutionModeStencilRefReplacingEXT = 5027,
John Kessenich4016e382016-07-15 11:53:56 -0600134 ExecutionModeMax = 0x7fffffff,
135};
136
137enum 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,
John Kessenich38a42532017-04-06 17:21:58 -0600150 StorageClassStorageBuffer = 12,
John Kessenich4016e382016-07-15 11:53:56 -0600151 StorageClassMax = 0x7fffffff,
152};
153
154enum 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
165enum SamplerAddressingMode {
166 SamplerAddressingModeNone = 0,
167 SamplerAddressingModeClampToEdge = 1,
168 SamplerAddressingModeClamp = 2,
169 SamplerAddressingModeRepeat = 3,
170 SamplerAddressingModeRepeatMirrored = 4,
171 SamplerAddressingModeMax = 0x7fffffff,
172};
173
174enum SamplerFilterMode {
175 SamplerFilterModeNearest = 0,
176 SamplerFilterModeLinear = 1,
177 SamplerFilterModeMax = 0x7fffffff,
178};
179
180enum 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
224enum 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
248enum 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
269enum 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
281enum 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
293enum FPFastMathModeShift {
294 FPFastMathModeNotNaNShift = 0,
295 FPFastMathModeNotInfShift = 1,
296 FPFastMathModeNSZShift = 2,
297 FPFastMathModeAllowRecipShift = 3,
298 FPFastMathModeFastShift = 4,
299 FPFastMathModeMax = 0x7fffffff,
300};
301
302enum FPFastMathModeMask {
303 FPFastMathModeMaskNone = 0,
304 FPFastMathModeNotNaNMask = 0x00000001,
305 FPFastMathModeNotInfMask = 0x00000002,
306 FPFastMathModeNSZMask = 0x00000004,
307 FPFastMathModeAllowRecipMask = 0x00000008,
308 FPFastMathModeFastMask = 0x00000010,
309};
310
311enum FPRoundingMode {
312 FPRoundingModeRTE = 0,
313 FPRoundingModeRTZ = 1,
314 FPRoundingModeRTP = 2,
315 FPRoundingModeRTN = 3,
316 FPRoundingModeMax = 0x7fffffff,
317};
318
319enum LinkageType {
320 LinkageTypeExport = 0,
321 LinkageTypeImport = 1,
322 LinkageTypeMax = 0x7fffffff,
323};
324
325enum AccessQualifier {
326 AccessQualifierReadOnly = 0,
327 AccessQualifierWriteOnly = 1,
328 AccessQualifierReadWrite = 2,
329 AccessQualifierMax = 0x7fffffff,
330};
331
332enum 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
344enum 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,
John Kessenich6c1c2762018-01-29 16:16:11 -0700388 DecorationMaxByteOffset = 45,
389 DecorationAlignmentId = 46,
390 DecorationMaxByteOffsetId = 47,
John Kessenichd2d3a142017-07-25 21:03:29 -0600391 DecorationExplicitInterpAMD = 4999,
John Kessenich42e33c92017-02-27 01:50:28 -0700392 DecorationOverrideCoverageNV = 5248,
393 DecorationPassthroughNV = 5250,
394 DecorationViewportRelativeNV = 5252,
395 DecorationSecondaryViewportRelativeNV = 5256,
John Kessenich4016e382016-07-15 11:53:56 -0600396 DecorationMax = 0x7fffffff,
397};
398
399enum BuiltIn {
400 BuiltInPosition = 0,
401 BuiltInPointSize = 1,
402 BuiltInClipDistance = 3,
403 BuiltInCullDistance = 4,
404 BuiltInVertexId = 5,
405 BuiltInInstanceId = 6,
406 BuiltInPrimitiveId = 7,
407 BuiltInInvocationId = 8,
408 BuiltInLayer = 9,
409 BuiltInViewportIndex = 10,
410 BuiltInTessLevelOuter = 11,
411 BuiltInTessLevelInner = 12,
412 BuiltInTessCoord = 13,
413 BuiltInPatchVertices = 14,
414 BuiltInFragCoord = 15,
415 BuiltInPointCoord = 16,
416 BuiltInFrontFacing = 17,
417 BuiltInSampleId = 18,
418 BuiltInSamplePosition = 19,
419 BuiltInSampleMask = 20,
420 BuiltInFragDepth = 22,
421 BuiltInHelperInvocation = 23,
422 BuiltInNumWorkgroups = 24,
423 BuiltInWorkgroupSize = 25,
424 BuiltInWorkgroupId = 26,
425 BuiltInLocalInvocationId = 27,
426 BuiltInGlobalInvocationId = 28,
427 BuiltInLocalInvocationIndex = 29,
428 BuiltInWorkDim = 30,
429 BuiltInGlobalSize = 31,
430 BuiltInEnqueuedWorkgroupSize = 32,
431 BuiltInGlobalOffset = 33,
432 BuiltInGlobalLinearId = 34,
433 BuiltInSubgroupSize = 36,
434 BuiltInSubgroupMaxSize = 37,
435 BuiltInNumSubgroups = 38,
436 BuiltInNumEnqueuedSubgroups = 39,
437 BuiltInSubgroupId = 40,
438 BuiltInSubgroupLocalInvocationId = 41,
439 BuiltInVertexIndex = 42,
440 BuiltInInstanceIndex = 43,
Rex Xuf3b27472016-07-22 18:15:31 +0800441 BuiltInSubgroupEqMaskKHR = 4416,
442 BuiltInSubgroupGeMaskKHR = 4417,
443 BuiltInSubgroupGtMaskKHR = 4418,
444 BuiltInSubgroupLeMaskKHR = 4419,
445 BuiltInSubgroupLtMaskKHR = 4420,
446 BuiltInBaseVertex = 4424,
447 BuiltInBaseInstance = 4425,
448 BuiltInDrawIndex = 4426,
John Kessenich42e33c92017-02-27 01:50:28 -0700449 BuiltInDeviceIndex = 4438,
450 BuiltInViewIndex = 4440,
John Kessenichd2d3a142017-07-25 21:03:29 -0600451 BuiltInBaryCoordNoPerspAMD = 4992,
452 BuiltInBaryCoordNoPerspCentroidAMD = 4993,
453 BuiltInBaryCoordNoPerspSampleAMD = 4994,
454 BuiltInBaryCoordSmoothAMD = 4995,
455 BuiltInBaryCoordSmoothCentroidAMD = 4996,
456 BuiltInBaryCoordSmoothSampleAMD = 4997,
457 BuiltInBaryCoordPullModelAMD = 4998,
Rex Xue8fdd792017-08-23 23:24:42 +0800458 BuiltInFragStencilRefEXT = 5014,
John Kessenich42e33c92017-02-27 01:50:28 -0700459 BuiltInViewportMaskNV = 5253,
460 BuiltInSecondaryPositionNV = 5257,
461 BuiltInSecondaryViewportMaskNV = 5258,
462 BuiltInPositionPerViewNV = 5261,
463 BuiltInViewportMaskPerViewNV = 5262,
John Kesseniche9e0cb62017-12-14 02:57:28 -0700464 BuiltInFullyCoveredEXT = 5264,
John Kessenich4016e382016-07-15 11:53:56 -0600465 BuiltInMax = 0x7fffffff,
466};
467
468enum SelectionControlShift {
469 SelectionControlFlattenShift = 0,
470 SelectionControlDontFlattenShift = 1,
471 SelectionControlMax = 0x7fffffff,
472};
473
474enum SelectionControlMask {
475 SelectionControlMaskNone = 0,
476 SelectionControlFlattenMask = 0x00000001,
477 SelectionControlDontFlattenMask = 0x00000002,
478};
479
480enum LoopControlShift {
481 LoopControlUnrollShift = 0,
482 LoopControlDontUnrollShift = 1,
John Kessenich6c1c2762018-01-29 16:16:11 -0700483 LoopControlDependencyInfiniteShift = 2,
484 LoopControlDependencyLengthShift = 3,
John Kessenich4016e382016-07-15 11:53:56 -0600485 LoopControlMax = 0x7fffffff,
486};
487
488enum LoopControlMask {
489 LoopControlMaskNone = 0,
490 LoopControlUnrollMask = 0x00000001,
491 LoopControlDontUnrollMask = 0x00000002,
John Kessenich6c1c2762018-01-29 16:16:11 -0700492 LoopControlDependencyInfiniteMask = 0x00000004,
493 LoopControlDependencyLengthMask = 0x00000008,
John Kessenich4016e382016-07-15 11:53:56 -0600494};
495
496enum FunctionControlShift {
497 FunctionControlInlineShift = 0,
498 FunctionControlDontInlineShift = 1,
499 FunctionControlPureShift = 2,
500 FunctionControlConstShift = 3,
501 FunctionControlMax = 0x7fffffff,
502};
503
504enum FunctionControlMask {
505 FunctionControlMaskNone = 0,
506 FunctionControlInlineMask = 0x00000001,
507 FunctionControlDontInlineMask = 0x00000002,
508 FunctionControlPureMask = 0x00000004,
509 FunctionControlConstMask = 0x00000008,
510};
511
512enum MemorySemanticsShift {
513 MemorySemanticsAcquireShift = 1,
514 MemorySemanticsReleaseShift = 2,
515 MemorySemanticsAcquireReleaseShift = 3,
516 MemorySemanticsSequentiallyConsistentShift = 4,
517 MemorySemanticsUniformMemoryShift = 6,
518 MemorySemanticsSubgroupMemoryShift = 7,
519 MemorySemanticsWorkgroupMemoryShift = 8,
520 MemorySemanticsCrossWorkgroupMemoryShift = 9,
521 MemorySemanticsAtomicCounterMemoryShift = 10,
522 MemorySemanticsImageMemoryShift = 11,
523 MemorySemanticsMax = 0x7fffffff,
524};
525
526enum MemorySemanticsMask {
527 MemorySemanticsMaskNone = 0,
528 MemorySemanticsAcquireMask = 0x00000002,
529 MemorySemanticsReleaseMask = 0x00000004,
530 MemorySemanticsAcquireReleaseMask = 0x00000008,
531 MemorySemanticsSequentiallyConsistentMask = 0x00000010,
532 MemorySemanticsUniformMemoryMask = 0x00000040,
533 MemorySemanticsSubgroupMemoryMask = 0x00000080,
534 MemorySemanticsWorkgroupMemoryMask = 0x00000100,
535 MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
536 MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
537 MemorySemanticsImageMemoryMask = 0x00000800,
538};
539
540enum MemoryAccessShift {
541 MemoryAccessVolatileShift = 0,
542 MemoryAccessAlignedShift = 1,
543 MemoryAccessNontemporalShift = 2,
544 MemoryAccessMax = 0x7fffffff,
545};
546
547enum MemoryAccessMask {
548 MemoryAccessMaskNone = 0,
549 MemoryAccessVolatileMask = 0x00000001,
550 MemoryAccessAlignedMask = 0x00000002,
551 MemoryAccessNontemporalMask = 0x00000004,
552};
553
554enum Scope {
555 ScopeCrossDevice = 0,
556 ScopeDevice = 1,
557 ScopeWorkgroup = 2,
558 ScopeSubgroup = 3,
559 ScopeInvocation = 4,
560 ScopeMax = 0x7fffffff,
561};
562
563enum GroupOperation {
564 GroupOperationReduce = 0,
565 GroupOperationInclusiveScan = 1,
566 GroupOperationExclusiveScan = 2,
567 GroupOperationMax = 0x7fffffff,
568};
569
570enum KernelEnqueueFlags {
571 KernelEnqueueFlagsNoWait = 0,
572 KernelEnqueueFlagsWaitKernel = 1,
573 KernelEnqueueFlagsWaitWorkGroup = 2,
574 KernelEnqueueFlagsMax = 0x7fffffff,
575};
576
577enum KernelProfilingInfoShift {
578 KernelProfilingInfoCmdExecTimeShift = 0,
579 KernelProfilingInfoMax = 0x7fffffff,
580};
581
582enum KernelProfilingInfoMask {
583 KernelProfilingInfoMaskNone = 0,
584 KernelProfilingInfoCmdExecTimeMask = 0x00000001,
585};
586
587enum Capability {
588 CapabilityMatrix = 0,
589 CapabilityShader = 1,
590 CapabilityGeometry = 2,
591 CapabilityTessellation = 3,
592 CapabilityAddresses = 4,
593 CapabilityLinkage = 5,
594 CapabilityKernel = 6,
595 CapabilityVector16 = 7,
596 CapabilityFloat16Buffer = 8,
597 CapabilityFloat16 = 9,
598 CapabilityFloat64 = 10,
599 CapabilityInt64 = 11,
600 CapabilityInt64Atomics = 12,
601 CapabilityImageBasic = 13,
602 CapabilityImageReadWrite = 14,
603 CapabilityImageMipmap = 15,
604 CapabilityPipes = 17,
605 CapabilityGroups = 18,
606 CapabilityDeviceEnqueue = 19,
607 CapabilityLiteralSampler = 20,
608 CapabilityAtomicStorage = 21,
609 CapabilityInt16 = 22,
610 CapabilityTessellationPointSize = 23,
611 CapabilityGeometryPointSize = 24,
612 CapabilityImageGatherExtended = 25,
613 CapabilityStorageImageMultisample = 27,
614 CapabilityUniformBufferArrayDynamicIndexing = 28,
615 CapabilitySampledImageArrayDynamicIndexing = 29,
616 CapabilityStorageBufferArrayDynamicIndexing = 30,
617 CapabilityStorageImageArrayDynamicIndexing = 31,
618 CapabilityClipDistance = 32,
619 CapabilityCullDistance = 33,
620 CapabilityImageCubeArray = 34,
621 CapabilitySampleRateShading = 35,
622 CapabilityImageRect = 36,
623 CapabilitySampledRect = 37,
624 CapabilityGenericPointer = 38,
625 CapabilityInt8 = 39,
626 CapabilityInputAttachment = 40,
627 CapabilitySparseResidency = 41,
628 CapabilityMinLod = 42,
629 CapabilitySampled1D = 43,
630 CapabilityImage1D = 44,
631 CapabilitySampledCubeArray = 45,
632 CapabilitySampledBuffer = 46,
633 CapabilityImageBuffer = 47,
634 CapabilityImageMSArray = 48,
635 CapabilityStorageImageExtendedFormats = 49,
636 CapabilityImageQuery = 50,
637 CapabilityDerivativeControl = 51,
638 CapabilityInterpolationFunction = 52,
639 CapabilityTransformFeedback = 53,
640 CapabilityGeometryStreams = 54,
641 CapabilityStorageImageReadWithoutFormat = 55,
642 CapabilityStorageImageWriteWithoutFormat = 56,
643 CapabilityMultiViewport = 57,
John Kessenich6c1c2762018-01-29 16:16:11 -0700644 CapabilitySubgroupDispatch = 58,
645 CapabilityNamedBarrier = 59,
646 CapabilityPipeStorage = 60,
Rex Xuf3b27472016-07-22 18:15:31 +0800647 CapabilitySubgroupBallotKHR = 4423,
648 CapabilityDrawParameters = 4427,
Ashwin Kolhec720f3e2017-01-18 14:16:49 -0800649 CapabilitySubgroupVoteKHR = 4431,
John Kessenich38a42532017-04-06 17:21:58 -0600650 CapabilityStorageBuffer16BitAccess = 4433,
John Kessenich42e33c92017-02-27 01:50:28 -0700651 CapabilityStorageUniformBufferBlock16 = 4433,
652 CapabilityStorageUniform16 = 4434,
John Kessenich38a42532017-04-06 17:21:58 -0600653 CapabilityUniformAndStorageBuffer16BitAccess = 4434,
John Kessenich42e33c92017-02-27 01:50:28 -0700654 CapabilityStoragePushConstant16 = 4435,
655 CapabilityStorageInputOutput16 = 4436,
John Kessenich6c8aaac2017-02-27 01:20:51 -0700656 CapabilityDeviceGroup = 4437,
657 CapabilityMultiView = 4439,
John Kessenich38a42532017-04-06 17:21:58 -0600658 CapabilityVariablePointersStorageBuffer = 4441,
659 CapabilityVariablePointers = 4442,
John Kessenichd2d3a142017-07-25 21:03:29 -0600660 CapabilityAtomicStorageOps = 4445,
chaocc1204522017-06-30 17:14:30 -0700661 CapabilitySampleMaskPostDepthCoverage = 4447,
John Kessenichd2d3a142017-07-25 21:03:29 -0600662 CapabilityImageGatherBiasLodAMD = 5009,
John Kesseniche9e0cb62017-12-14 02:57:28 -0700663 CapabilityFragmentMaskAMD = 5010,
Rex Xue8fdd792017-08-23 23:24:42 +0800664 CapabilityStencilExportEXT = 5013,
John Kesseniche9e0cb62017-12-14 02:57:28 -0700665 CapabilityImageReadWriteLodAMD = 5015,
John Kessenich42e33c92017-02-27 01:50:28 -0700666 CapabilitySampleMaskOverrideCoverageNV = 5249,
667 CapabilityGeometryShaderPassthroughNV = 5251,
Rex Xue8fdd792017-08-23 23:24:42 +0800668 CapabilityShaderViewportIndexLayerEXT = 5254,
John Kessenich42e33c92017-02-27 01:50:28 -0700669 CapabilityShaderViewportIndexLayerNV = 5254,
670 CapabilityShaderViewportMaskNV = 5255,
671 CapabilityShaderStereoViewNV = 5259,
672 CapabilityPerViewAttributesNV = 5260,
John Kesseniche9e0cb62017-12-14 02:57:28 -0700673 CapabilityFragmentFullyCoveredEXT = 5265,
674 CapabilitySubgroupShuffleINTEL = 5568,
675 CapabilitySubgroupBufferBlockIOINTEL = 5569,
676 CapabilitySubgroupImageBlockIOINTEL = 5570,
John Kessenich4016e382016-07-15 11:53:56 -0600677 CapabilityMax = 0x7fffffff,
678};
679
680enum 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,
John Kessenich6c1c2762018-01-29 16:16:11 -0700975 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,
Rex Xuf3b27472016-07-22 18:15:31 +0800987 OpSubgroupBallotKHR = 4421,
988 OpSubgroupFirstInvocationKHR = 4422,
John Kessenich6c8aaac2017-02-27 01:20:51 -0700989 OpSubgroupAllKHR = 4428,
990 OpSubgroupAnyKHR = 4429,
Ashwin Kolhec720f3e2017-01-18 14:16:49 -0800991 OpSubgroupAllEqualKHR = 4430,
John Kessenich6c8aaac2017-02-27 01:20:51 -0700992 OpSubgroupReadInvocationKHR = 4432,
John Kessenichd2d3a142017-07-25 21:03:29 -0600993 OpGroupIAddNonUniformAMD = 5000,
994 OpGroupFAddNonUniformAMD = 5001,
995 OpGroupFMinNonUniformAMD = 5002,
996 OpGroupUMinNonUniformAMD = 5003,
997 OpGroupSMinNonUniformAMD = 5004,
998 OpGroupFMaxNonUniformAMD = 5005,
999 OpGroupUMaxNonUniformAMD = 5006,
1000 OpGroupSMaxNonUniformAMD = 5007,
John Kesseniche9e0cb62017-12-14 02:57:28 -07001001 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,
John Kessenich4016e382016-07-15 11:53:56 -06001011 OpMax = 0x7fffffff,
1012};
1013
1014// Overload operator| for mask bit combining
1015
1016inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
1017inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
1018inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
1019inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
1020inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
1021inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
1022inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
1023inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
1024
1025} // end namespace spv
1026
1027#endif // #ifndef spirv_HPP
1028