blob: 8c2ab4c40e57314e4c30b259a0a693e1a6c03649 [file] [log] [blame]
John Kessenich140f3df2015-06-26 16:58:36 -06001//
John Kessenich5e4b1242015-08-06 22:53:06 -06002//Copyright (C) 2014-2015 LunarG, Inc.
John Kessenich140f3df2015-06-26 16:58:36 -06003//
4//All rights reserved.
5//
6//Redistribution and use in source and binary forms, with or without
7//modification, are permitted provided that the following conditions
8//are met:
9//
10// Redistributions of source code must retain the above copyright
11// notice, this list of conditions and the following disclaimer.
12//
13// Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following
15// disclaimer in the documentation and/or other materials provided
16// with the distribution.
17//
18// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
19// contributors may be used to endorse or promote products derived
20// from this software without specific prior written permission.
21//
22//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33//POSSIBILITY OF SUCH DAMAGE.
34
35//
John Kessenich66ec80e2016-08-05 14:04:23 -060036// 1) Programmatically fill in instruction/operand information.
John Kessenich140f3df2015-06-26 16:58:36 -060037// This can be used for disassembly, printing documentation, etc.
38//
39// 2) Print documentation from this parameterization.
40//
41
42#include "doc.h"
43
John Kessenich66ec80e2016-08-05 14:04:23 -060044#include <cstdio>
45#include <cstring>
John Kessenich140f3df2015-06-26 16:58:36 -060046#include <algorithm>
47
Rex Xu9d93a232016-05-05 12:30:44 +080048namespace spv {
49 extern "C" {
50 // Include C-based headers that don't have a namespace
Rex Xu51596642016-09-21 18:56:12 +080051#ifdef AMD_EXTENSIONS
Rex Xu9d93a232016-05-05 12:30:44 +080052 #include "GLSL.ext.AMD.h"
Rex Xu51596642016-09-21 18:56:12 +080053#endif
chaoc0ad6a4e2016-12-19 16:29:34 -080054#ifdef NV_EXTENSIONS
55 #include "GLSL.ext.NV.h"
56#endif
Rex Xu9d93a232016-05-05 12:30:44 +080057 }
58}
Rex Xu9d93a232016-05-05 12:30:44 +080059
John Kessenich140f3df2015-06-26 16:58:36 -060060namespace spv {
61
62//
63// Whole set of functions that translate enumerants to their text strings for
64// the specification (or their sanitized versions for auto-generating the
John Kessenich5e4b1242015-08-06 22:53:06 -060065// spirv headers.
John Kessenich140f3df2015-06-26 16:58:36 -060066//
67// Also, the ceilings are declared next to these, to help keep them in sync.
68// Ceilings should be
69// - one more than the maximum value an enumerant takes on, for non-mask enumerants
70// (for non-sparse enums, this is the number of enumurants)
71// - the number of bits consumed by the set of masks
72// (for non-sparse mask enums, this is the number of enumurants)
73//
74
John Kessenich66e2faf2016-03-12 18:34:36 -070075const int SourceLanguageCeiling = 6; // HLSL todo: need official enumerant
John Kessenich140f3df2015-06-26 16:58:36 -060076
77const char* SourceString(int source)
78{
79 switch (source) {
80 case 0: return "Unknown";
81 case 1: return "ESSL";
82 case 2: return "GLSL";
John Kessenich55e7d112015-11-15 21:33:39 -070083 case 3: return "OpenCL_C";
84 case 4: return "OpenCL_CPP";
John Kessenich66e2faf2016-03-12 18:34:36 -070085 case 5: return "HLSL";
John Kessenich140f3df2015-06-26 16:58:36 -060086
87 case SourceLanguageCeiling:
88 default: return "Bad";
89 }
90}
91
92const int ExecutionModelCeiling = 7;
93
94const char* ExecutionModelString(int model)
95{
96 switch (model) {
97 case 0: return "Vertex";
98 case 1: return "TessellationControl";
99 case 2: return "TessellationEvaluation";
100 case 3: return "Geometry";
101 case 4: return "Fragment";
102 case 5: return "GLCompute";
103 case 6: return "Kernel";
104
105 case ExecutionModelCeiling:
106 default: return "Bad";
107 }
108}
109
110const int AddressingModelCeiling = 3;
111
112const char* AddressingString(int addr)
113{
114 switch (addr) {
115 case 0: return "Logical";
116 case 1: return "Physical32";
117 case 2: return "Physical64";
118
119 case AddressingModelCeiling:
120 default: return "Bad";
121 }
122}
123
John Kessenich5e4b1242015-08-06 22:53:06 -0600124const int MemoryModelCeiling = 3;
John Kessenich140f3df2015-06-26 16:58:36 -0600125
126const char* MemoryString(int mem)
127{
128 switch (mem) {
129 case 0: return "Simple";
130 case 1: return "GLSL450";
John Kessenich5e4b1242015-08-06 22:53:06 -0600131 case 2: return "OpenCL";
John Kessenich140f3df2015-06-26 16:58:36 -0600132
133 case MemoryModelCeiling:
134 default: return "Bad";
135 }
136}
137
John Kessenich55e7d112015-11-15 21:33:39 -0700138const int ExecutionModeCeiling = 33;
John Kessenich140f3df2015-06-26 16:58:36 -0600139
140const char* ExecutionModeString(int mode)
141{
142 switch (mode) {
143 case 0: return "Invocations";
144 case 1: return "SpacingEqual";
145 case 2: return "SpacingFractionalEven";
146 case 3: return "SpacingFractionalOdd";
147 case 4: return "VertexOrderCw";
148 case 5: return "VertexOrderCcw";
149 case 6: return "PixelCenterInteger";
150 case 7: return "OriginUpperLeft";
John Kessenich5e4b1242015-08-06 22:53:06 -0600151 case 8: return "OriginLowerLeft";
152 case 9: return "EarlyFragmentTests";
153 case 10: return "PointMode";
154 case 11: return "Xfb";
155 case 12: return "DepthReplacing";
John Kessenich55e7d112015-11-15 21:33:39 -0700156 case 13: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600157 case 14: return "DepthGreater";
158 case 15: return "DepthLess";
159 case 16: return "DepthUnchanged";
160 case 17: return "LocalSize";
161 case 18: return "LocalSizeHint";
162 case 19: return "InputPoints";
163 case 20: return "InputLines";
164 case 21: return "InputLinesAdjacency";
John Kessenich55e7d112015-11-15 21:33:39 -0700165 case 22: return "Triangles";
John Kessenich5e4b1242015-08-06 22:53:06 -0600166 case 23: return "InputTrianglesAdjacency";
John Kessenich55e7d112015-11-15 21:33:39 -0700167 case 24: return "Quads";
168 case 25: return "Isolines";
John Kessenich5e4b1242015-08-06 22:53:06 -0600169 case 26: return "OutputVertices";
170 case 27: return "OutputPoints";
171 case 28: return "OutputLineStrip";
172 case 29: return "OutputTriangleStrip";
173 case 30: return "VecTypeHint";
174 case 31: return "ContractionOff";
John Kessenich55e7d112015-11-15 21:33:39 -0700175 case 32: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600176
177 case ExecutionModeCeiling:
178 default: return "Bad";
179 }
180}
181
John Kessenich5e4b1242015-08-06 22:53:06 -0600182const int StorageClassCeiling = 12;
John Kessenich140f3df2015-06-26 16:58:36 -0600183
184const char* StorageClassString(int StorageClass)
185{
186 switch (StorageClass) {
187 case 0: return "UniformConstant";
188 case 1: return "Input";
189 case 2: return "Uniform";
190 case 3: return "Output";
John Kessenich55e7d112015-11-15 21:33:39 -0700191 case 4: return "Workgroup";
192 case 5: return "CrossWorkgroup";
193 case 6: return "Private";
John Kessenich140f3df2015-06-26 16:58:36 -0600194 case 7: return "Function";
195 case 8: return "Generic";
John Kessenich55e7d112015-11-15 21:33:39 -0700196 case 9: return "PushConstant";
John Kessenich140f3df2015-06-26 16:58:36 -0600197 case 10: return "AtomicCounter";
John Kessenich5e4b1242015-08-06 22:53:06 -0600198 case 11: return "Image";
John Kessenich140f3df2015-06-26 16:58:36 -0600199
200 case StorageClassCeiling:
201 default: return "Bad";
202 }
203}
204
John Kessenich55e7d112015-11-15 21:33:39 -0700205const int DecorationCeiling = 45;
John Kessenich140f3df2015-06-26 16:58:36 -0600206
207const char* DecorationString(int decoration)
208{
209 switch (decoration) {
John Kessenich5e4b1242015-08-06 22:53:06 -0600210 case 0: return "RelaxedPrecision";
211 case 1: return "SpecId";
212 case 2: return "Block";
213 case 3: return "BufferBlock";
214 case 4: return "RowMajor";
215 case 5: return "ColMajor";
216 case 6: return "ArrayStride";
217 case 7: return "MatrixStride";
218 case 8: return "GLSLShared";
219 case 9: return "GLSLPacked";
220 case 10: return "CPacked";
221 case 11: return "BuiltIn";
John Kessenich55e7d112015-11-15 21:33:39 -0700222 case 12: return "Bad";
223 case 13: return "NoPerspective";
John Kessenich5e4b1242015-08-06 22:53:06 -0600224 case 14: return "Flat";
225 case 15: return "Patch";
226 case 16: return "Centroid";
227 case 17: return "Sample";
228 case 18: return "Invariant";
229 case 19: return "Restrict";
230 case 20: return "Aliased";
231 case 21: return "Volatile";
232 case 22: return "Constant";
233 case 23: return "Coherent";
John Kessenich55e7d112015-11-15 21:33:39 -0700234 case 24: return "NonWritable";
235 case 25: return "NonReadable";
John Kessenich5e4b1242015-08-06 22:53:06 -0600236 case 26: return "Uniform";
John Kessenich55e7d112015-11-15 21:33:39 -0700237 case 27: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600238 case 28: return "SaturatedConversion";
239 case 29: return "Stream";
240 case 30: return "Location";
241 case 31: return "Component";
242 case 32: return "Index";
243 case 33: return "Binding";
244 case 34: return "DescriptorSet";
245 case 35: return "Offset";
John Kessenich5e4b1242015-08-06 22:53:06 -0600246 case 36: return "XfbBuffer";
247 case 37: return "XfbStride";
248 case 38: return "FuncParamAttr";
249 case 39: return "FP Rounding Mode";
250 case 40: return "FP Fast Math Mode";
251 case 41: return "Linkage Attributes";
John Kessenich55e7d112015-11-15 21:33:39 -0700252 case 42: return "NoContraction";
253 case 43: return "InputAttachmentIndex";
254 case 44: return "Alignment";
John Kessenich140f3df2015-06-26 16:58:36 -0600255
256 case DecorationCeiling:
257 default: return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +0800258
259#ifdef AMD_EXTENSIONS
260 case 4999: return "ExplicitInterpAMD";
261#endif
chaoc0ad6a4e2016-12-19 16:29:34 -0800262#ifdef NV_EXTENSIONS
263 case 5248: return "OverrideCoverageNV";
264#endif
John Kessenich140f3df2015-06-26 16:58:36 -0600265 }
266}
267
John Kessenich55e7d112015-11-15 21:33:39 -0700268const int BuiltInCeiling = 44;
John Kessenich140f3df2015-06-26 16:58:36 -0600269
270const char* BuiltInString(int builtIn)
271{
272 switch (builtIn) {
273 case 0: return "Position";
274 case 1: return "PointSize";
John Kessenich5e4b1242015-08-06 22:53:06 -0600275 case 2: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600276 case 3: return "ClipDistance";
277 case 4: return "CullDistance";
278 case 5: return "VertexId";
279 case 6: return "InstanceId";
280 case 7: return "PrimitiveId";
281 case 8: return "InvocationId";
282 case 9: return "Layer";
283 case 10: return "ViewportIndex";
284 case 11: return "TessLevelOuter";
285 case 12: return "TessLevelInner";
286 case 13: return "TessCoord";
287 case 14: return "PatchVertices";
288 case 15: return "FragCoord";
289 case 16: return "PointCoord";
290 case 17: return "FrontFacing";
291 case 18: return "SampleId";
292 case 19: return "SamplePosition";
293 case 20: return "SampleMask";
John Kessenich55e7d112015-11-15 21:33:39 -0700294 case 21: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600295 case 22: return "FragDepth";
296 case 23: return "HelperInvocation";
297 case 24: return "NumWorkgroups";
298 case 25: return "WorkgroupSize";
299 case 26: return "WorkgroupId";
300 case 27: return "LocalInvocationId";
301 case 28: return "GlobalInvocationId";
302 case 29: return "LocalInvocationIndex";
303 case 30: return "WorkDim";
304 case 31: return "GlobalSize";
305 case 32: return "EnqueuedWorkgroupSize";
306 case 33: return "GlobalOffset";
307 case 34: return "GlobalLinearId";
John Kessenich55e7d112015-11-15 21:33:39 -0700308 case 35: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600309 case 36: return "SubgroupSize";
310 case 37: return "SubgroupMaxSize";
311 case 38: return "NumSubgroups";
312 case 39: return "NumEnqueuedSubgroups";
313 case 40: return "SubgroupId";
314 case 41: return "SubgroupLocalInvocationId";
John Kessenich55e7d112015-11-15 21:33:39 -0700315 case 42: return "VertexIndex"; // TBD: put next to VertexId?
316 case 43: return "InstanceIndex"; // TBD: put next to InstanceId?
John Kessenich140f3df2015-06-26 16:58:36 -0600317
318 case BuiltInCeiling:
319 default: return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +0800320
Rex Xu51596642016-09-21 18:56:12 +0800321 case 4416: return "SubgroupEqMaskKHR";
322 case 4417: return "SubgroupGeMaskKHR";
323 case 4418: return "SubgroupGtMaskKHR";
324 case 4419: return "SubgroupLeMaskKHR";
325 case 4420: return "SubgroupLtMaskKHR";
326
Rex Xuf3b27472016-07-22 18:15:31 +0800327 case 4424: return "BaseVertex";
328 case 4425: return "BaseInstance";
329 case 4426: return "DrawIndex";
330
Rex Xu9d93a232016-05-05 12:30:44 +0800331#ifdef AMD_EXTENSIONS
332 case 4992: return "BaryCoordNoPerspAMD";
333 case 4993: return "BaryCoordNoPerspCentroidAMD";
334 case 4994: return "BaryCoordNoPerspSampleAMD";
335 case 4995: return "BaryCoordSmoothAMD";
336 case 4996: return "BaryCoordSmoothCentroidAMD";
337 case 4997: return "BaryCoordSmoothSampleAMD";
338 case 4998: return "BaryCoordPullModelAMD";
339#endif
John Kessenich140f3df2015-06-26 16:58:36 -0600340 }
341}
342
John Kessenich55e7d112015-11-15 21:33:39 -0700343const int DimensionCeiling = 7;
John Kessenich140f3df2015-06-26 16:58:36 -0600344
345const char* DimensionString(int dim)
346{
347 switch (dim) {
348 case 0: return "1D";
349 case 1: return "2D";
350 case 2: return "3D";
351 case 3: return "Cube";
352 case 4: return "Rect";
353 case 5: return "Buffer";
John Kessenich55e7d112015-11-15 21:33:39 -0700354 case 6: return "SubpassData";
John Kessenich140f3df2015-06-26 16:58:36 -0600355
356 case DimensionCeiling:
357 default: return "Bad";
358 }
359}
360
361const int SamplerAddressingModeCeiling = 5;
362
363const char* SamplerAddressingModeString(int mode)
364{
365 switch (mode) {
366 case 0: return "None";
367 case 1: return "ClampToEdge";
368 case 2: return "Clamp";
369 case 3: return "Repeat";
370 case 4: return "RepeatMirrored";
371
372 case SamplerAddressingModeCeiling:
373 default: return "Bad";
374 }
375}
376
377const int SamplerFilterModeCeiling = 2;
378
379const char* SamplerFilterModeString(int mode)
380{
381 switch (mode) {
382 case 0: return "Nearest";
383 case 1: return "Linear";
384
385 case SamplerFilterModeCeiling:
386 default: return "Bad";
387 }
388}
389
John Kessenich5e4b1242015-08-06 22:53:06 -0600390const int ImageFormatCeiling = 40;
391
392const char* ImageFormatString(int format)
393{
394 switch (format) {
395 case 0: return "Unknown";
396
397 // ES/Desktop float
398 case 1: return "Rgba32f";
399 case 2: return "Rgba16f";
400 case 3: return "R32f";
401 case 4: return "Rgba8";
402 case 5: return "Rgba8Snorm";
403
404 // Desktop float
405 case 6: return "Rg32f";
406 case 7: return "Rg16f";
407 case 8: return "R11fG11fB10f";
408 case 9: return "R16f";
409 case 10: return "Rgba16";
410 case 11: return "Rgb10A2";
411 case 12: return "Rg16";
412 case 13: return "Rg8";
413 case 14: return "R16";
414 case 15: return "R8";
415 case 16: return "Rgba16Snorm";
416 case 17: return "Rg16Snorm";
417 case 18: return "Rg8Snorm";
418 case 19: return "R16Snorm";
419 case 20: return "R8Snorm";
420
421 // ES/Desktop int
422 case 21: return "Rgba32i";
423 case 22: return "Rgba16i";
424 case 23: return "Rgba8i";
425 case 24: return "R32i";
426
427 // Desktop int
428 case 25: return "Rg32i";
429 case 26: return "Rg16i";
430 case 27: return "Rg8i";
431 case 28: return "R16i";
432 case 29: return "R8i";
433
434 // ES/Desktop uint
435 case 30: return "Rgba32ui";
436 case 31: return "Rgba16ui";
437 case 32: return "Rgba8ui";
438 case 33: return "R32ui";
439
440 // Desktop uint
441 case 34: return "Rgb10a2ui";
442 case 35: return "Rg32ui";
443 case 36: return "Rg16ui";
444 case 37: return "Rg8ui";
445 case 38: return "R16ui";
446 case 39: return "R8ui";
447
448 case ImageFormatCeiling:
449 default:
450 return "Bad";
451 }
452}
453
454const int ImageChannelOrderCeiling = 19;
455
456const char* ImageChannelOrderString(int format)
457{
458 switch (format) {
459 case 0: return "R";
460 case 1: return "A";
461 case 2: return "RG";
462 case 3: return "RA";
463 case 4: return "RGB";
464 case 5: return "RGBA";
465 case 6: return "BGRA";
466 case 7: return "ARGB";
467 case 8: return "Intensity";
468 case 9: return "Luminance";
469 case 10: return "Rx";
470 case 11: return "RGx";
471 case 12: return "RGBx";
472 case 13: return "Depth";
473 case 14: return "DepthStencil";
474 case 15: return "sRGB";
475 case 16: return "sRGBx";
476 case 17: return "sRGBA";
477 case 18: return "sBGRA";
478
479 case ImageChannelOrderCeiling:
480 default:
481 return "Bad";
482 }
483}
484
John Kessenich55e7d112015-11-15 21:33:39 -0700485const int ImageChannelDataTypeCeiling = 17;
John Kessenich5e4b1242015-08-06 22:53:06 -0600486
487const char* ImageChannelDataTypeString(int type)
488{
489 switch (type)
490 {
491 case 0: return "SnormInt8";
492 case 1: return "SnormInt16";
493 case 2: return "UnormInt8";
494 case 3: return "UnormInt16";
495 case 4: return "UnormShort565";
496 case 5: return "UnormShort555";
497 case 6: return "UnormInt101010";
498 case 7: return "SignedInt8";
499 case 8: return "SignedInt16";
500 case 9: return "SignedInt32";
501 case 10: return "UnsignedInt8";
502 case 11: return "UnsignedInt16";
503 case 12: return "UnsignedInt32";
504 case 13: return "HalfFloat";
505 case 14: return "Float";
506 case 15: return "UnormInt24";
John Kessenich55e7d112015-11-15 21:33:39 -0700507 case 16: return "UnormInt101010_2";
John Kessenich5e4b1242015-08-06 22:53:06 -0600508
509 case ImageChannelDataTypeCeiling:
510 default:
511 return "Bad";
512 }
513}
514
John Kessenich55e7d112015-11-15 21:33:39 -0700515const int ImageOperandsCeiling = 8;
John Kessenich5e4b1242015-08-06 22:53:06 -0600516
517const char* ImageOperandsString(int format)
518{
519 switch (format) {
520 case 0: return "Bias";
521 case 1: return "Lod";
522 case 2: return "Grad";
523 case 3: return "ConstOffset";
524 case 4: return "Offset";
525 case 5: return "ConstOffsets";
526 case 6: return "Sample";
John Kessenich55e7d112015-11-15 21:33:39 -0700527 case 7: return "MinLod";
John Kessenich5e4b1242015-08-06 22:53:06 -0600528
529 case ImageOperandsCeiling:
530 default:
531 return "Bad";
532 }
533}
534
John Kessenich140f3df2015-06-26 16:58:36 -0600535const int FPFastMathCeiling = 5;
536
537const char* FPFastMathString(int mode)
538{
539 switch (mode) {
540 case 0: return "NotNaN";
541 case 1: return "NotInf";
542 case 2: return "NSZ";
543 case 3: return "AllowRecip";
544 case 4: return "Fast";
545
546 case FPFastMathCeiling:
547 default: return "Bad";
548 }
549}
550
551const int FPRoundingModeCeiling = 4;
552
553const char* FPRoundingModeString(int mode)
554{
555 switch (mode) {
556 case 0: return "RTE";
557 case 1: return "RTZ";
558 case 2: return "RTP";
559 case 3: return "RTN";
560
561 case FPRoundingModeCeiling:
562 default: return "Bad";
563 }
564}
565
566const int LinkageTypeCeiling = 2;
567
568const char* LinkageTypeString(int type)
569{
570 switch (type) {
571 case 0: return "Export";
572 case 1: return "Import";
573
574 case LinkageTypeCeiling:
575 default: return "Bad";
576 }
577}
578
John Kessenich5e4b1242015-08-06 22:53:06 -0600579const int FuncParamAttrCeiling = 8;
John Kessenich140f3df2015-06-26 16:58:36 -0600580
581const char* FuncParamAttrString(int attr)
582{
583 switch (attr) {
584 case 0: return "Zext";
585 case 1: return "Sext";
586 case 2: return "ByVal";
587 case 3: return "Sret";
588 case 4: return "NoAlias";
589 case 5: return "NoCapture";
John Kessenich5e4b1242015-08-06 22:53:06 -0600590 case 6: return "NoWrite";
591 case 7: return "NoReadWrite";
John Kessenich140f3df2015-06-26 16:58:36 -0600592
593 case FuncParamAttrCeiling:
594 default: return "Bad";
595 }
596}
597
598const int AccessQualifierCeiling = 3;
599
600const char* AccessQualifierString(int attr)
601{
602 switch (attr) {
603 case 0: return "ReadOnly";
604 case 1: return "WriteOnly";
605 case 2: return "ReadWrite";
606
607 case AccessQualifierCeiling:
608 default: return "Bad";
609 }
610}
611
612const int SelectControlCeiling = 2;
613
614const char* SelectControlString(int cont)
615{
616 switch (cont) {
617 case 0: return "Flatten";
618 case 1: return "DontFlatten";
619
620 case SelectControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600621 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600622 }
623}
624
625const int LoopControlCeiling = 2;
626
627const char* LoopControlString(int cont)
628{
629 switch (cont) {
John Kessenich5e4b1242015-08-06 22:53:06 -0600630 case 0: return "Unroll";
631 case 1: return "DontUnroll";
John Kessenich140f3df2015-06-26 16:58:36 -0600632
633 case LoopControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600634 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600635 }
636}
637
638const int FunctionControlCeiling = 4;
639
640const char* FunctionControlString(int cont)
641{
642 switch (cont) {
643 case 0: return "Inline";
644 case 1: return "DontInline";
645 case 2: return "Pure";
646 case 3: return "Const";
647
648 case FunctionControlCeiling:
649 default: return "Bad";
650 }
651}
652
John Kessenich55e7d112015-11-15 21:33:39 -0700653const int MemorySemanticsCeiling = 12;
John Kessenich140f3df2015-06-26 16:58:36 -0600654
655const char* MemorySemanticsString(int mem)
656{
John Kessenich55e7d112015-11-15 21:33:39 -0700657 // Note: No bits set (None) means "Relaxed"
John Kessenich140f3df2015-06-26 16:58:36 -0600658 switch (mem) {
John Kessenich55e7d112015-11-15 21:33:39 -0700659 case 0: return "Bad"; // Note: this is a placeholder for 'Consume'
660 case 1: return "Acquire";
661 case 2: return "Release";
662 case 3: return "AcquireRelease";
663 case 4: return "SequentiallyConsistent";
664 case 5: return "Bad"; // Note: reserved for future expansion
665 case 6: return "UniformMemory";
666 case 7: return "SubgroupMemory";
667 case 8: return "WorkgroupMemory";
668 case 9: return "CrossWorkgroupMemory";
669 case 10: return "AtomicCounterMemory";
670 case 11: return "ImageMemory";
John Kessenich140f3df2015-06-26 16:58:36 -0600671
672 case MemorySemanticsCeiling:
673 default: return "Bad";
674 }
675}
676
John Kessenich55e7d112015-11-15 21:33:39 -0700677const int MemoryAccessCeiling = 3;
John Kessenich140f3df2015-06-26 16:58:36 -0600678
679const char* MemoryAccessString(int mem)
680{
681 switch (mem) {
682 case 0: return "Volatile";
683 case 1: return "Aligned";
John Kessenich55e7d112015-11-15 21:33:39 -0700684 case 2: return "Nontemporal";
John Kessenich140f3df2015-06-26 16:58:36 -0600685
686 case MemoryAccessCeiling:
687 default: return "Bad";
688 }
689}
690
John Kessenich5e4b1242015-08-06 22:53:06 -0600691const int ScopeCeiling = 5;
John Kessenich140f3df2015-06-26 16:58:36 -0600692
John Kessenich5e4b1242015-08-06 22:53:06 -0600693const char* ScopeString(int mem)
John Kessenich140f3df2015-06-26 16:58:36 -0600694{
695 switch (mem) {
696 case 0: return "CrossDevice";
697 case 1: return "Device";
698 case 2: return "Workgroup";
699 case 3: return "Subgroup";
John Kessenich5e4b1242015-08-06 22:53:06 -0600700 case 4: return "Invocation";
John Kessenich140f3df2015-06-26 16:58:36 -0600701
John Kessenich5e4b1242015-08-06 22:53:06 -0600702 case ScopeCeiling:
John Kessenich140f3df2015-06-26 16:58:36 -0600703 default: return "Bad";
704 }
705}
706
707const int GroupOperationCeiling = 3;
708
709const char* GroupOperationString(int gop)
710{
711
712 switch (gop)
713 {
714 case 0: return "Reduce";
715 case 1: return "InclusiveScan";
716 case 2: return "ExclusiveScan";
717
718 case GroupOperationCeiling:
719 default: return "Bad";
720 }
721}
722
723const int KernelEnqueueFlagsCeiling = 3;
724
725const char* KernelEnqueueFlagsString(int flag)
726{
727 switch (flag)
728 {
729 case 0: return "NoWait";
730 case 1: return "WaitKernel";
731 case 2: return "WaitWorkGroup";
732
733 case KernelEnqueueFlagsCeiling:
734 default: return "Bad";
735 }
736}
737
738const int KernelProfilingInfoCeiling = 1;
739
740const char* KernelProfilingInfoString(int info)
741{
742 switch (info)
743 {
744 case 0: return "CmdExecTime";
745
746 case KernelProfilingInfoCeiling:
747 default: return "Bad";
748 }
749}
750
John Kessenich6c292d32016-02-15 20:58:50 -0700751const int CapabilityCeiling = 58;
John Kessenich5e4b1242015-08-06 22:53:06 -0600752
753const char* CapabilityString(int info)
754{
755 switch (info)
756 {
757 case 0: return "Matrix";
758 case 1: return "Shader";
759 case 2: return "Geometry";
760 case 3: return "Tessellation";
761 case 4: return "Addresses";
762 case 5: return "Linkage";
763 case 6: return "Kernel";
764 case 7: return "Vector16";
765 case 8: return "Float16Buffer";
766 case 9: return "Float16";
767 case 10: return "Float64";
768 case 11: return "Int64";
769 case 12: return "Int64Atomics";
770 case 13: return "ImageBasic";
771 case 14: return "ImageReadWrite";
772 case 15: return "ImageMipmap";
John Kessenich55e7d112015-11-15 21:33:39 -0700773 case 16: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600774 case 17: return "Pipes";
775 case 18: return "Groups";
776 case 19: return "DeviceEnqueue";
777 case 20: return "LiteralSampler";
778 case 21: return "AtomicStorage";
779 case 22: return "Int16";
780 case 23: return "TessellationPointSize";
781 case 24: return "GeometryPointSize";
782 case 25: return "ImageGatherExtended";
John Kessenich55e7d112015-11-15 21:33:39 -0700783 case 26: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600784 case 27: return "StorageImageMultisample";
785 case 28: return "UniformBufferArrayDynamicIndexing";
786 case 29: return "SampledImageArrayDynamicIndexing";
787 case 30: return "StorageBufferArrayDynamicIndexing";
788 case 31: return "StorageImageArrayDynamicIndexing";
789 case 32: return "ClipDistance";
790 case 33: return "CullDistance";
791 case 34: return "ImageCubeArray";
792 case 35: return "SampleRateShading";
John Kessenich55e7d112015-11-15 21:33:39 -0700793 case 36: return "ImageRect";
794 case 37: return "SampledRect";
795 case 38: return "GenericPointer";
796 case 39: return "Int8";
797 case 40: return "InputAttachment";
798 case 41: return "SparseResidency";
799 case 42: return "MinLod";
800 case 43: return "Sampled1D";
801 case 44: return "Image1D";
802 case 45: return "SampledCubeArray";
803 case 46: return "SampledBuffer";
804 case 47: return "ImageBuffer";
805 case 48: return "ImageMSArray";
806 case 49: return "StorageImageExtendedFormats";
807 case 50: return "ImageQuery";
808 case 51: return "DerivativeControl";
809 case 52: return "InterpolationFunction";
810 case 53: return "TransformFeedback";
811 case 54: return "GeometryStreams";
812 case 55: return "StorageImageReadWithoutFormat";
813 case 56: return "StorageImageWriteWithoutFormat";
John Kessenich6c292d32016-02-15 20:58:50 -0700814 case 57: return "MultiViewport";
John Kessenich5e4b1242015-08-06 22:53:06 -0600815
816 case CapabilityCeiling:
817 default: return "Bad";
Rex Xu51596642016-09-21 18:56:12 +0800818
819 case 4423: return "SubgroupBallotKHR";
Rex Xuf3b27472016-07-22 18:15:31 +0800820 case 4427: return "DrawParameters";
John Kessenich5e4b1242015-08-06 22:53:06 -0600821 }
822}
823
John Kessenich140f3df2015-06-26 16:58:36 -0600824const char* OpcodeString(int op)
825{
826 switch (op) {
827 case 0: return "OpNop";
John Kessenich5e4b1242015-08-06 22:53:06 -0600828 case 1: return "OpUndef";
John Kessenich55e7d112015-11-15 21:33:39 -0700829 case 2: return "OpSourceContinued";
John Kessenich5e4b1242015-08-06 22:53:06 -0600830 case 3: return "OpSource";
831 case 4: return "OpSourceExtension";
832 case 5: return "OpName";
833 case 6: return "OpMemberName";
834 case 7: return "OpString";
835 case 8: return "OpLine";
836 case 9: return "Bad";
837 case 10: return "OpExtension";
838 case 11: return "OpExtInstImport";
839 case 12: return "OpExtInst";
840 case 13: return "Bad";
841 case 14: return "OpMemoryModel";
842 case 15: return "OpEntryPoint";
843 case 16: return "OpExecutionMode";
844 case 17: return "OpCapability";
845 case 18: return "Bad";
846 case 19: return "OpTypeVoid";
847 case 20: return "OpTypeBool";
848 case 21: return "OpTypeInt";
849 case 22: return "OpTypeFloat";
850 case 23: return "OpTypeVector";
851 case 24: return "OpTypeMatrix";
852 case 25: return "OpTypeImage";
853 case 26: return "OpTypeSampler";
854 case 27: return "OpTypeSampledImage";
855 case 28: return "OpTypeArray";
856 case 29: return "OpTypeRuntimeArray";
857 case 30: return "OpTypeStruct";
858 case 31: return "OpTypeOpaque";
859 case 32: return "OpTypePointer";
860 case 33: return "OpTypeFunction";
861 case 34: return "OpTypeEvent";
862 case 35: return "OpTypeDeviceEvent";
863 case 36: return "OpTypeReserveId";
864 case 37: return "OpTypeQueue";
865 case 38: return "OpTypePipe";
John Kessenich55e7d112015-11-15 21:33:39 -0700866 case 39: return "OpTypeForwardPointer";
John Kessenich5e4b1242015-08-06 22:53:06 -0600867 case 40: return "Bad";
868 case 41: return "OpConstantTrue";
869 case 42: return "OpConstantFalse";
870 case 43: return "OpConstant";
871 case 44: return "OpConstantComposite";
872 case 45: return "OpConstantSampler";
873 case 46: return "OpConstantNull";
874 case 47: return "Bad";
875 case 48: return "OpSpecConstantTrue";
876 case 49: return "OpSpecConstantFalse";
877 case 50: return "OpSpecConstant";
878 case 51: return "OpSpecConstantComposite";
879 case 52: return "OpSpecConstantOp";
880 case 53: return "Bad";
881 case 54: return "OpFunction";
882 case 55: return "OpFunctionParameter";
883 case 56: return "OpFunctionEnd";
884 case 57: return "OpFunctionCall";
885 case 58: return "Bad";
886 case 59: return "OpVariable";
887 case 60: return "OpImageTexelPointer";
888 case 61: return "OpLoad";
889 case 62: return "OpStore";
890 case 63: return "OpCopyMemory";
891 case 64: return "OpCopyMemorySized";
892 case 65: return "OpAccessChain";
893 case 66: return "OpInBoundsAccessChain";
894 case 67: return "OpPtrAccessChain";
895 case 68: return "OpArrayLength";
896 case 69: return "OpGenericPtrMemSemantics";
John Kessenich55e7d112015-11-15 21:33:39 -0700897 case 70: return "OpInBoundsPtrAccessChain";
John Kessenich5e4b1242015-08-06 22:53:06 -0600898 case 71: return "OpDecorate";
899 case 72: return "OpMemberDecorate";
900 case 73: return "OpDecorationGroup";
901 case 74: return "OpGroupDecorate";
902 case 75: return "OpGroupMemberDecorate";
903 case 76: return "Bad";
904 case 77: return "OpVectorExtractDynamic";
905 case 78: return "OpVectorInsertDynamic";
906 case 79: return "OpVectorShuffle";
907 case 80: return "OpCompositeConstruct";
908 case 81: return "OpCompositeExtract";
909 case 82: return "OpCompositeInsert";
910 case 83: return "OpCopyObject";
911 case 84: return "OpTranspose";
912 case 85: return "Bad";
913 case 86: return "OpSampledImage";
914 case 87: return "OpImageSampleImplicitLod";
915 case 88: return "OpImageSampleExplicitLod";
916 case 89: return "OpImageSampleDrefImplicitLod";
917 case 90: return "OpImageSampleDrefExplicitLod";
918 case 91: return "OpImageSampleProjImplicitLod";
919 case 92: return "OpImageSampleProjExplicitLod";
920 case 93: return "OpImageSampleProjDrefImplicitLod";
921 case 94: return "OpImageSampleProjDrefExplicitLod";
922 case 95: return "OpImageFetch";
923 case 96: return "OpImageGather";
924 case 97: return "OpImageDrefGather";
925 case 98: return "OpImageRead";
926 case 99: return "OpImageWrite";
John Kessenich55e7d112015-11-15 21:33:39 -0700927 case 100: return "OpImage";
John Kessenich5e4b1242015-08-06 22:53:06 -0600928 case 101: return "OpImageQueryFormat";
929 case 102: return "OpImageQueryOrder";
930 case 103: return "OpImageQuerySizeLod";
931 case 104: return "OpImageQuerySize";
932 case 105: return "OpImageQueryLod";
933 case 106: return "OpImageQueryLevels";
934 case 107: return "OpImageQuerySamples";
935 case 108: return "Bad";
936 case 109: return "OpConvertFToU";
937 case 110: return "OpConvertFToS";
938 case 111: return "OpConvertSToF";
939 case 112: return "OpConvertUToF";
940 case 113: return "OpUConvert";
941 case 114: return "OpSConvert";
942 case 115: return "OpFConvert";
943 case 116: return "OpQuantizeToF16";
944 case 117: return "OpConvertPtrToU";
945 case 118: return "OpSatConvertSToU";
946 case 119: return "OpSatConvertUToS";
947 case 120: return "OpConvertUToPtr";
948 case 121: return "OpPtrCastToGeneric";
949 case 122: return "OpGenericCastToPtr";
950 case 123: return "OpGenericCastToPtrExplicit";
951 case 124: return "OpBitcast";
952 case 125: return "Bad";
953 case 126: return "OpSNegate";
954 case 127: return "OpFNegate";
955 case 128: return "OpIAdd";
956 case 129: return "OpFAdd";
957 case 130: return "OpISub";
958 case 131: return "OpFSub";
959 case 132: return "OpIMul";
960 case 133: return "OpFMul";
961 case 134: return "OpUDiv";
962 case 135: return "OpSDiv";
963 case 136: return "OpFDiv";
964 case 137: return "OpUMod";
965 case 138: return "OpSRem";
966 case 139: return "OpSMod";
967 case 140: return "OpFRem";
968 case 141: return "OpFMod";
969 case 142: return "OpVectorTimesScalar";
970 case 143: return "OpMatrixTimesScalar";
971 case 144: return "OpVectorTimesMatrix";
972 case 145: return "OpMatrixTimesVector";
973 case 146: return "OpMatrixTimesMatrix";
974 case 147: return "OpOuterProduct";
975 case 148: return "OpDot";
976 case 149: return "OpIAddCarry";
977 case 150: return "OpISubBorrow";
John Kessenich55e7d112015-11-15 21:33:39 -0700978 case 151: return "OpUMulExtended";
979 case 152: return "OpSMulExtended";
John Kessenich5e4b1242015-08-06 22:53:06 -0600980 case 153: return "Bad";
981 case 154: return "OpAny";
982 case 155: return "OpAll";
983 case 156: return "OpIsNan";
984 case 157: return "OpIsInf";
985 case 158: return "OpIsFinite";
986 case 159: return "OpIsNormal";
987 case 160: return "OpSignBitSet";
988 case 161: return "OpLessOrGreater";
989 case 162: return "OpOrdered";
990 case 163: return "OpUnordered";
991 case 164: return "OpLogicalEqual";
992 case 165: return "OpLogicalNotEqual";
993 case 166: return "OpLogicalOr";
994 case 167: return "OpLogicalAnd";
995 case 168: return "OpLogicalNot";
996 case 169: return "OpSelect";
997 case 170: return "OpIEqual";
998 case 171: return "OpINotEqual";
999 case 172: return "OpUGreaterThan";
1000 case 173: return "OpSGreaterThan";
1001 case 174: return "OpUGreaterThanEqual";
1002 case 175: return "OpSGreaterThanEqual";
1003 case 176: return "OpULessThan";
1004 case 177: return "OpSLessThan";
1005 case 178: return "OpULessThanEqual";
1006 case 179: return "OpSLessThanEqual";
1007 case 180: return "OpFOrdEqual";
1008 case 181: return "OpFUnordEqual";
1009 case 182: return "OpFOrdNotEqual";
1010 case 183: return "OpFUnordNotEqual";
1011 case 184: return "OpFOrdLessThan";
1012 case 185: return "OpFUnordLessThan";
1013 case 186: return "OpFOrdGreaterThan";
1014 case 187: return "OpFUnordGreaterThan";
1015 case 188: return "OpFOrdLessThanEqual";
1016 case 189: return "OpFUnordLessThanEqual";
1017 case 190: return "OpFOrdGreaterThanEqual";
1018 case 191: return "OpFUnordGreaterThanEqual";
1019 case 192: return "Bad";
1020 case 193: return "Bad";
1021 case 194: return "OpShiftRightLogical";
1022 case 195: return "OpShiftRightArithmetic";
1023 case 196: return "OpShiftLeftLogical";
1024 case 197: return "OpBitwiseOr";
1025 case 198: return "OpBitwiseXor";
1026 case 199: return "OpBitwiseAnd";
1027 case 200: return "OpNot";
1028 case 201: return "OpBitFieldInsert";
1029 case 202: return "OpBitFieldSExtract";
1030 case 203: return "OpBitFieldUExtract";
1031 case 204: return "OpBitReverse";
1032 case 205: return "OpBitCount";
1033 case 206: return "Bad";
1034 case 207: return "OpDPdx";
1035 case 208: return "OpDPdy";
1036 case 209: return "OpFwidth";
1037 case 210: return "OpDPdxFine";
1038 case 211: return "OpDPdyFine";
1039 case 212: return "OpFwidthFine";
1040 case 213: return "OpDPdxCoarse";
1041 case 214: return "OpDPdyCoarse";
1042 case 215: return "OpFwidthCoarse";
1043 case 216: return "Bad";
1044 case 217: return "Bad";
1045 case 218: return "OpEmitVertex";
1046 case 219: return "OpEndPrimitive";
1047 case 220: return "OpEmitStreamVertex";
1048 case 221: return "OpEndStreamPrimitive";
1049 case 222: return "Bad";
1050 case 223: return "Bad";
1051 case 224: return "OpControlBarrier";
1052 case 225: return "OpMemoryBarrier";
1053 case 226: return "Bad";
1054 case 227: return "OpAtomicLoad";
1055 case 228: return "OpAtomicStore";
1056 case 229: return "OpAtomicExchange";
1057 case 230: return "OpAtomicCompareExchange";
1058 case 231: return "OpAtomicCompareExchangeWeak";
1059 case 232: return "OpAtomicIIncrement";
1060 case 233: return "OpAtomicIDecrement";
1061 case 234: return "OpAtomicIAdd";
1062 case 235: return "OpAtomicISub";
1063 case 236: return "OpAtomicSMin";
1064 case 237: return "OpAtomicUMin";
1065 case 238: return "OpAtomicSMax";
1066 case 239: return "OpAtomicUMax";
1067 case 240: return "OpAtomicAnd";
1068 case 241: return "OpAtomicOr";
1069 case 242: return "OpAtomicXor";
1070 case 243: return "Bad";
1071 case 244: return "Bad";
1072 case 245: return "OpPhi";
1073 case 246: return "OpLoopMerge";
1074 case 247: return "OpSelectionMerge";
1075 case 248: return "OpLabel";
1076 case 249: return "OpBranch";
1077 case 250: return "OpBranchConditional";
1078 case 251: return "OpSwitch";
1079 case 252: return "OpKill";
1080 case 253: return "OpReturn";
1081 case 254: return "OpReturnValue";
1082 case 255: return "OpUnreachable";
1083 case 256: return "OpLifetimeStart";
1084 case 257: return "OpLifetimeStop";
1085 case 258: return "Bad";
John Kessenich55e7d112015-11-15 21:33:39 -07001086 case 259: return "OpGroupAsyncCopy";
1087 case 260: return "OpGroupWaitEvents";
John Kessenich5e4b1242015-08-06 22:53:06 -06001088 case 261: return "OpGroupAll";
1089 case 262: return "OpGroupAny";
1090 case 263: return "OpGroupBroadcast";
1091 case 264: return "OpGroupIAdd";
1092 case 265: return "OpGroupFAdd";
1093 case 266: return "OpGroupFMin";
1094 case 267: return "OpGroupUMin";
1095 case 268: return "OpGroupSMin";
1096 case 269: return "OpGroupFMax";
1097 case 270: return "OpGroupUMax";
1098 case 271: return "OpGroupSMax";
1099 case 272: return "Bad";
1100 case 273: return "Bad";
1101 case 274: return "OpReadPipe";
1102 case 275: return "OpWritePipe";
1103 case 276: return "OpReservedReadPipe";
1104 case 277: return "OpReservedWritePipe";
1105 case 278: return "OpReserveReadPipePackets";
1106 case 279: return "OpReserveWritePipePackets";
1107 case 280: return "OpCommitReadPipe";
1108 case 281: return "OpCommitWritePipe";
1109 case 282: return "OpIsValidReserveId";
1110 case 283: return "OpGetNumPipePackets";
1111 case 284: return "OpGetMaxPipePackets";
1112 case 285: return "OpGroupReserveReadPipePackets";
1113 case 286: return "OpGroupReserveWritePipePackets";
1114 case 287: return "OpGroupCommitReadPipe";
1115 case 288: return "OpGroupCommitWritePipe";
1116 case 289: return "Bad";
1117 case 290: return "Bad";
1118 case 291: return "OpEnqueueMarker";
1119 case 292: return "OpEnqueueKernel";
1120 case 293: return "OpGetKernelNDrangeSubGroupCount";
1121 case 294: return "OpGetKernelNDrangeMaxSubGroupSize";
1122 case 295: return "OpGetKernelWorkGroupSize";
1123 case 296: return "OpGetKernelPreferredWorkGroupSizeMultiple";
1124 case 297: return "OpRetainEvent";
1125 case 298: return "OpReleaseEvent";
1126 case 299: return "OpCreateUserEvent";
1127 case 300: return "OpIsValidEvent";
1128 case 301: return "OpSetUserEventStatus";
1129 case 302: return "OpCaptureEventProfilingInfo";
1130 case 303: return "OpGetDefaultQueue";
1131 case 304: return "OpBuildNDRange";
John Kessenich55e7d112015-11-15 21:33:39 -07001132 case 305: return "OpImageSparseSampleImplicitLod";
1133 case 306: return "OpImageSparseSampleExplicitLod";
1134 case 307: return "OpImageSparseSampleDrefImplicitLod";
1135 case 308: return "OpImageSparseSampleDrefExplicitLod";
1136 case 309: return "OpImageSparseSampleProjImplicitLod";
1137 case 310: return "OpImageSparseSampleProjExplicitLod";
1138 case 311: return "OpImageSparseSampleProjDrefImplicitLod";
1139 case 312: return "OpImageSparseSampleProjDrefExplicitLod";
1140 case 313: return "OpImageSparseFetch";
1141 case 314: return "OpImageSparseGather";
1142 case 315: return "OpImageSparseDrefGather";
1143 case 316: return "OpImageSparseTexelsResident";
1144 case 317: return "OpNoLine";
1145 case 318: return "OpAtomicFlagTestAndSet";
1146 case 319: return "OpAtomicFlagClear";
John Kessenich6c292d32016-02-15 20:58:50 -07001147 case 320: return "OpImageSparseRead";
John Kessenich140f3df2015-06-26 16:58:36 -06001148
1149 case OpcodeCeiling:
1150 default:
1151 return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +08001152
Rex Xu51596642016-09-21 18:56:12 +08001153 case 4421: return "OpSubgroupBallotKHR";
1154 case 4422: return "OpSubgroupFirstInvocationKHR";
chaocf200da82016-12-20 12:44:35 -08001155 case 4432: return "OpSubgroupReadInvocationKHR";
Rex Xu51596642016-09-21 18:56:12 +08001156
Rex Xu9d93a232016-05-05 12:30:44 +08001157#ifdef AMD_EXTENSIONS
1158 case 5000: return "OpGroupIAddNonUniformAMD";
1159 case 5001: return "OpGroupFAddNonUniformAMD";
1160 case 5002: return "OpGroupFMinNonUniformAMD";
1161 case 5003: return "OpGroupUMinNonUniformAMD";
1162 case 5004: return "OpGroupSMinNonUniformAMD";
1163 case 5005: return "OpGroupFMaxNonUniformAMD";
1164 case 5006: return "OpGroupUMaxNonUniformAMD";
1165 case 5007: return "OpGroupSMaxNonUniformAMD";
1166#endif
John Kessenich140f3df2015-06-26 16:58:36 -06001167 }
1168}
1169
1170// The set of objects that hold all the instruction/operand
1171// parameterization information.
Rex Xu9d93a232016-05-05 12:30:44 +08001172InstructionParameters InstructionDesc[OpCodeMask + 1];
John Kessenich140f3df2015-06-26 16:58:36 -06001173OperandParameters ExecutionModeOperands[ExecutionModeCeiling];
1174OperandParameters DecorationOperands[DecorationCeiling];
1175
1176EnumDefinition OperandClassParams[OperandCount];
1177EnumParameters ExecutionModelParams[ExecutionModelCeiling];
1178EnumParameters AddressingParams[AddressingModelCeiling];
1179EnumParameters MemoryParams[MemoryModelCeiling];
1180EnumParameters ExecutionModeParams[ExecutionModeCeiling];
1181EnumParameters StorageParams[StorageClassCeiling];
1182EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling];
1183EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001184EnumParameters ImageFormatParams[ImageFormatCeiling];
1185EnumParameters ImageChannelOrderParams[ImageChannelOrderCeiling];
1186EnumParameters ImageChannelDataTypeParams[ImageChannelDataTypeCeiling];
1187EnumParameters ImageOperandsParams[ImageOperandsCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001188EnumParameters FPFastMathParams[FPFastMathCeiling];
1189EnumParameters FPRoundingModeParams[FPRoundingModeCeiling];
1190EnumParameters LinkageTypeParams[LinkageTypeCeiling];
1191EnumParameters DecorationParams[DecorationCeiling];
1192EnumParameters BuiltInParams[BuiltInCeiling];
1193EnumParameters DimensionalityParams[DimensionCeiling];
1194EnumParameters FuncParamAttrParams[FuncParamAttrCeiling];
1195EnumParameters AccessQualifierParams[AccessQualifierCeiling];
1196EnumParameters GroupOperationParams[GroupOperationCeiling];
1197EnumParameters LoopControlParams[FunctionControlCeiling];
1198EnumParameters SelectionControlParams[SelectControlCeiling];
1199EnumParameters FunctionControlParams[FunctionControlCeiling];
1200EnumParameters MemorySemanticsParams[MemorySemanticsCeiling];
1201EnumParameters MemoryAccessParams[MemoryAccessCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001202EnumParameters ScopeParams[ScopeCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001203EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling];
1204EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001205EnumParameters CapabilityParams[CapabilityCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001206
1207// Set up all the parameterizing descriptions of the opcodes, operands, etc.
1208void Parameterize()
1209{
John Kessenich140f3df2015-06-26 16:58:36 -06001210 // only do this once.
John Kessenich5e4b1242015-08-06 22:53:06 -06001211 static bool initialized = false;
John Kessenich140f3df2015-06-26 16:58:36 -06001212 if (initialized)
1213 return;
John Kessenich140f3df2015-06-26 16:58:36 -06001214 initialized = true;
1215
1216 // Exceptions to having a result <id> and a resulting type <id>.
1217 // (Everything is initialized to have both).
1218
1219 InstructionDesc[OpNop].setResultAndType(false, false);
1220 InstructionDesc[OpSource].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001221 InstructionDesc[OpSourceContinued].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001222 InstructionDesc[OpSourceExtension].setResultAndType(false, false);
1223 InstructionDesc[OpExtension].setResultAndType(false, false);
1224 InstructionDesc[OpExtInstImport].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001225 InstructionDesc[OpCapability].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001226 InstructionDesc[OpMemoryModel].setResultAndType(false, false);
1227 InstructionDesc[OpEntryPoint].setResultAndType(false, false);
1228 InstructionDesc[OpExecutionMode].setResultAndType(false, false);
1229 InstructionDesc[OpTypeVoid].setResultAndType(true, false);
1230 InstructionDesc[OpTypeBool].setResultAndType(true, false);
1231 InstructionDesc[OpTypeInt].setResultAndType(true, false);
1232 InstructionDesc[OpTypeFloat].setResultAndType(true, false);
1233 InstructionDesc[OpTypeVector].setResultAndType(true, false);
1234 InstructionDesc[OpTypeMatrix].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001235 InstructionDesc[OpTypeImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001236 InstructionDesc[OpTypeSampler].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001237 InstructionDesc[OpTypeSampledImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001238 InstructionDesc[OpTypeArray].setResultAndType(true, false);
1239 InstructionDesc[OpTypeRuntimeArray].setResultAndType(true, false);
1240 InstructionDesc[OpTypeStruct].setResultAndType(true, false);
1241 InstructionDesc[OpTypeOpaque].setResultAndType(true, false);
1242 InstructionDesc[OpTypePointer].setResultAndType(true, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001243 InstructionDesc[OpTypeForwardPointer].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001244 InstructionDesc[OpTypeFunction].setResultAndType(true, false);
1245 InstructionDesc[OpTypeEvent].setResultAndType(true, false);
1246 InstructionDesc[OpTypeDeviceEvent].setResultAndType(true, false);
1247 InstructionDesc[OpTypeReserveId].setResultAndType(true, false);
1248 InstructionDesc[OpTypeQueue].setResultAndType(true, false);
1249 InstructionDesc[OpTypePipe].setResultAndType(true, false);
1250 InstructionDesc[OpFunctionEnd].setResultAndType(false, false);
1251 InstructionDesc[OpStore].setResultAndType(false, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001252 InstructionDesc[OpImageWrite].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001253 InstructionDesc[OpDecorationGroup].setResultAndType(true, false);
1254 InstructionDesc[OpDecorate].setResultAndType(false, false);
1255 InstructionDesc[OpMemberDecorate].setResultAndType(false, false);
1256 InstructionDesc[OpGroupDecorate].setResultAndType(false, false);
1257 InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false);
1258 InstructionDesc[OpName].setResultAndType(false, false);
1259 InstructionDesc[OpMemberName].setResultAndType(false, false);
1260 InstructionDesc[OpString].setResultAndType(true, false);
1261 InstructionDesc[OpLine].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001262 InstructionDesc[OpNoLine].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001263 InstructionDesc[OpCopyMemory].setResultAndType(false, false);
1264 InstructionDesc[OpCopyMemorySized].setResultAndType(false, false);
1265 InstructionDesc[OpEmitVertex].setResultAndType(false, false);
1266 InstructionDesc[OpEndPrimitive].setResultAndType(false, false);
1267 InstructionDesc[OpEmitStreamVertex].setResultAndType(false, false);
1268 InstructionDesc[OpEndStreamPrimitive].setResultAndType(false, false);
1269 InstructionDesc[OpControlBarrier].setResultAndType(false, false);
1270 InstructionDesc[OpMemoryBarrier].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001271 InstructionDesc[OpAtomicStore].setResultAndType(false, false);
1272 InstructionDesc[OpLoopMerge].setResultAndType(false, false);
1273 InstructionDesc[OpSelectionMerge].setResultAndType(false, false);
1274 InstructionDesc[OpLabel].setResultAndType(true, false);
1275 InstructionDesc[OpBranch].setResultAndType(false, false);
1276 InstructionDesc[OpBranchConditional].setResultAndType(false, false);
1277 InstructionDesc[OpSwitch].setResultAndType(false, false);
1278 InstructionDesc[OpKill].setResultAndType(false, false);
1279 InstructionDesc[OpReturn].setResultAndType(false, false);
1280 InstructionDesc[OpReturnValue].setResultAndType(false, false);
1281 InstructionDesc[OpUnreachable].setResultAndType(false, false);
1282 InstructionDesc[OpLifetimeStart].setResultAndType(false, false);
1283 InstructionDesc[OpLifetimeStop].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001284 InstructionDesc[OpCommitReadPipe].setResultAndType(false, false);
1285 InstructionDesc[OpCommitWritePipe].setResultAndType(false, false);
1286 InstructionDesc[OpGroupCommitWritePipe].setResultAndType(false, false);
1287 InstructionDesc[OpGroupCommitReadPipe].setResultAndType(false, false);
1288 InstructionDesc[OpCaptureEventProfilingInfo].setResultAndType(false, false);
1289 InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false);
1290 InstructionDesc[OpRetainEvent].setResultAndType(false, false);
1291 InstructionDesc[OpReleaseEvent].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001292 InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false);
1293 InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001294
1295 // Specific additional context-dependent operands
1296
John Kessenich55e7d112015-11-15 21:33:39 -07001297 ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "'Number of <<Invocation,invocations>>'");
John Kessenich140f3df2015-06-26 16:58:36 -06001298
1299 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'x size'");
1300 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'y size'");
1301 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'z size'");
1302
1303 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'x size'");
1304 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'y size'");
1305 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'z size'");
1306
John Kessenich5e4b1242015-08-06 22:53:06 -06001307 ExecutionModeOperands[ExecutionModeOutputVertices].push(OperandLiteralNumber, "'Vertex count'");
1308 ExecutionModeOperands[ExecutionModeVecTypeHint].push(OperandLiteralNumber, "'Vector type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001309
John Kessenich55e7d112015-11-15 21:33:39 -07001310 DecorationOperands[DecorationStream].push(OperandLiteralNumber, "'Stream Number'");
1311 DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "'Location'");
1312 DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "'Component'");
1313 DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "'Index'");
1314 DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "'Binding Point'");
1315 DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "'Descriptor Set'");
1316 DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "'Byte Offset'");
1317 DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "'XFB Buffer Number'");
1318 DecorationOperands[DecorationXfbStride].push(OperandLiteralNumber, "'XFB Stride'");
1319 DecorationOperands[DecorationArrayStride].push(OperandLiteralNumber, "'Array Stride'");
1320 DecorationOperands[DecorationMatrixStride].push(OperandLiteralNumber, "'Matrix Stride'");
John Kessenich140f3df2015-06-26 16:58:36 -06001321 DecorationOperands[DecorationBuiltIn].push(OperandLiteralNumber, "See <<BuiltIn,*BuiltIn*>>");
John Kessenich55e7d112015-11-15 21:33:39 -07001322 DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "'Floating-Point Rounding Mode'");
1323 DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "'Fast-Math Mode'");
1324 DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "'Name'");
1325 DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "'Linkage Type'");
1326 DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "'Function Parameter Attribute'");
1327 DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "'Specialization Constant ID'");
1328 DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'");
1329 DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06001330
1331 OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0);
1332 OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams);
1333 OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams);
1334 OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams);
1335 OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams);
1336 OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands);
1337 OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams);
1338 OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams);
1339 OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams);
1340 OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001341 OperandClassParams[OperandSamplerImageFormat].set(ImageFormatCeiling, ImageFormatString, ImageFormatParams);
1342 OperandClassParams[OperandImageChannelOrder].set(ImageChannelOrderCeiling, ImageChannelOrderString, ImageChannelOrderParams);
1343 OperandClassParams[OperandImageChannelDataType].set(ImageChannelDataTypeCeiling, ImageChannelDataTypeString, ImageChannelDataTypeParams);
1344 OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true);
John Kessenich140f3df2015-06-26 16:58:36 -06001345 OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true);
1346 OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams);
1347 OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams);
1348 OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams);
1349 OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams);
1350 OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams);
1351 OperandClassParams[OperandDecoration].setOperands(DecorationOperands);
1352 OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams);
1353 OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true);
1354 OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true);
1355 OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true);
1356 OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true);
1357 OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001358 OperandClassParams[OperandScope].set(ScopeCeiling, ScopeString, ScopeParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001359 OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams);
1360 OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams);
1361 OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001362 OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001363 OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0);
1364
John Kessenich55e7d112015-11-15 21:33:39 -07001365 CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix);
1366 CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader);
1367 CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader);
1368 CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel);
1369 CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001370 CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64);
1371 CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel);
1372 CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic);
1373 CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic);
1374 CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel);
1375 CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel);
1376 CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel);
1377 CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader);
1378 CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader);
1379 CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation);
1380 CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry);
1381 CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader);
1382 CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader);
1383 CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader);
1384 CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1385 CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1386 CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1387 CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1388 CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader);
1389 CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader);
1390 CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses);
1391 CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel);
1392 CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader);
1393 CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader);
1394 CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader);
1395 CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader);
1396 CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader);
1397 CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader);
1398 CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader);
1399 CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader);
1400 CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D);
1401 CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect);
1402 CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer);
1403 CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray);
1404 CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader);
1405 CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader);
1406 CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader);
1407 CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader);
1408 CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry);
1409 CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader);
1410 CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001411 CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001412
John Kessenich5e4b1242015-08-06 22:53:06 -06001413 AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses);
1414 AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001415
John Kessenich5e4b1242015-08-06 22:53:06 -06001416 MemoryParams[MemoryModelSimple].caps.push_back(CapabilityShader);
1417 MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader);
1418 MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001419
John Kessenich55e7d112015-11-15 21:33:39 -07001420 MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001421 MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001422
John Kessenich5e4b1242015-08-06 22:53:06 -06001423 ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader);
1424 ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation);
1425 ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation);
1426 ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapabilityGeometry);
1427 ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapabilityShader);
1428 ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapabilityShader);
1429 ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001430
1431 // Storage capabilites
John Kessenich5e4b1242015-08-06 22:53:06 -06001432 StorageParams[StorageClassInput].caps.push_back(CapabilityShader);
1433 StorageParams[StorageClassUniform].caps.push_back(CapabilityShader);
1434 StorageParams[StorageClassOutput].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001435 StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001436 StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel);
1437 StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001438 StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001439
1440 // Sampler Filter & Addressing mode capabilities
John Kessenich5e4b1242015-08-06 22:53:06 -06001441 SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel);
1442 SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapabilityKernel);
1443 SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapabilityKernel);
1444 SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapabilityKernel);
1445 SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001446
John Kessenich5e4b1242015-08-06 22:53:06 -06001447 SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapabilityKernel);
1448 SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel);
1449
1450 // image format capabilities
John Kessenich55e7d112015-11-15 21:33:39 -07001451
1452 // ES/Desktop float
1453 ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader);
1454 ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader);
1455 ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader);
1456 ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader);
1457 ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader);
1458
1459 // Desktop float
1460 ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats);
1461 ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1462 ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats);
1463 ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1464 ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats);
1465 ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats);
1466 ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats);
1467 ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats);
1468 ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats);
1469 ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats);
1470 ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1471 ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1472 ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1473 ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1474 ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1475
1476 // ES/Desktop int
1477 ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader);
1478 ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader);
1479 ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader);
1480 ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader);
1481
1482 // Desktop int
1483 ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats);
1484 ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1485 ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1486 ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1487 ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1488
1489 // ES/Desktop uint
1490 ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader);
1491 ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader);
1492 ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader);
1493 ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader);
1494
1495 // Desktop uint
1496 ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1497 ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1498 ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1499 ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1500 ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1501 ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
John Kessenich5e4b1242015-08-06 22:53:06 -06001502
1503 // image channel order capabilities
1504 for (int i = 0; i < ImageChannelOrderCeiling; ++i) {
1505 ImageChannelOrderParams[i].caps.push_back(CapabilityKernel);
1506 }
1507
1508 // image channel type capabilities
1509 for (int i = 0; i < ImageChannelDataTypeCeiling; ++i) {
1510 ImageChannelDataTypeParams[i].caps.push_back(CapabilityKernel);
1511 }
1512
1513 // image lookup operands
1514 ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader);
1515 ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended);
John Kessenich55e7d112015-11-15 21:33:39 -07001516 ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod);
John Kessenich140f3df2015-06-26 16:58:36 -06001517
1518 // fast math flags capabilities
1519 for (int i = 0; i < FPFastMathCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001520 FPFastMathParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001521 }
1522
1523 // fp rounding mode capabilities
1524 for (int i = 0; i < FPRoundingModeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001525 FPRoundingModeParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001526 }
1527
1528 // linkage types
1529 for (int i = 0; i < LinkageTypeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001530 LinkageTypeParams[i].caps.push_back(CapabilityLinkage);
John Kessenich140f3df2015-06-26 16:58:36 -06001531 }
1532
1533 // function argument types
1534 for (int i = 0; i < FuncParamAttrCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001535 FuncParamAttrParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001536 }
1537
1538 // function argument types
1539 for (int i = 0; i < AccessQualifierCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001540 AccessQualifierParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001541 }
1542
John Kessenich5e4b1242015-08-06 22:53:06 -06001543 ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapabilityGeometry);
1544 ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapabilityTessellation);
1545 ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapabilityTessellation);
1546 ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapabilityTessellation);
1547 ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapabilityTessellation);
1548 ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapabilityTessellation);
1549 ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapabilityShader);
1550 ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapabilityShader);
1551 ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader);
1552 ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader);
1553 ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation);
John Kessenich55e7d112015-11-15 21:33:39 -07001554 ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001555 ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001556 ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader);
1557 ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader);
1558 ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader);
1559 ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapabilityKernel);
1560 ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry);
1561 ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry);
1562 ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001563 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry);
1564 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001565 ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001566 ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation);
1567 ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001568 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry);
1569 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation);
1570 ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry);
1571 ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapabilityGeometry);
1572 ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapabilityGeometry);
1573 ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapabilityKernel);
1574 ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001575
John Kessenich5e4b1242015-08-06 22:53:06 -06001576 DecorationParams[DecorationRelaxedPrecision].caps.push_back(CapabilityShader);
1577 DecorationParams[DecorationBlock].caps.push_back(CapabilityShader);
1578 DecorationParams[DecorationBufferBlock].caps.push_back(CapabilityShader);
1579 DecorationParams[DecorationRowMajor].caps.push_back(CapabilityMatrix);
1580 DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix);
1581 DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader);
1582 DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001583 DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001584 DecorationParams[DecorationFlat].caps.push_back(CapabilityShader);
1585 DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation);
1586 DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001587 DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001588 DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader);
1589 DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel);
1590 DecorationParams[DecorationUniform].caps.push_back(CapabilityShader);
1591 DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel);
1592 DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001593 DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001594 DecorationParams[DecorationLocation].caps.push_back(CapabilityShader);
1595 DecorationParams[DecorationComponent].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001596 DecorationParams[DecorationOffset].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001597 DecorationParams[DecorationIndex].caps.push_back(CapabilityShader);
1598 DecorationParams[DecorationBinding].caps.push_back(CapabilityShader);
1599 DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001600 DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback);
1601 DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001602 DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001603 DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix);
John Kessenich5e4b1242015-08-06 22:53:06 -06001604 DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel);
1605 DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel);
1606 DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel);
1607 DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage);
1608 DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001609 DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader);
1610 DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment);
1611 DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001612
John Kessenich5e4b1242015-08-06 22:53:06 -06001613 BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader);
1614 BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001615 BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance);
1616 BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance);
John Kessenich55e7d112015-11-15 21:33:39 -07001617
John Kessenich5e4b1242015-08-06 22:53:06 -06001618 BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001619 BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . .";
1620
John Kessenich5e4b1242015-08-06 22:53:06 -06001621 BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001622 BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . .";
1623
1624 BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader);
1625 BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . .";
1626
1627 BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader);
1628 BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . .";
1629
John Kessenich5e4b1242015-08-06 22:53:06 -06001630 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry);
1631 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation);
1632 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry);
1633 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation);
1634 BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry);
John Kessenich6c292d32016-02-15 20:58:50 -07001635 BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport);
John Kessenich5e4b1242015-08-06 22:53:06 -06001636 BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation);
1637 BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation);
1638 BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation);
1639 BuiltInParams[BuiltInPatchVertices].caps.push_back(CapabilityTessellation);
1640 BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader);
1641 BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader);
1642 BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001643 BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading);
1644 BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading);
1645 BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001646 BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader);
1647 BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001648 BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel);
1649 BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel);
1650 BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel);
1651 BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel);
1652 BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001653
John Kessenich5e4b1242015-08-06 22:53:06 -06001654 BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel);
1655 BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel);
1656 BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapabilityKernel);
1657 BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapabilityKernel);
1658 BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel);
1659 BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001660
John Kessenich55e7d112015-11-15 21:33:39 -07001661 DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D);
John Kessenich5e4b1242015-08-06 22:53:06 -06001662 DimensionalityParams[DimCube].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001663 DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect);
1664 DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer);
1665 DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment);
John Kessenich140f3df2015-06-26 16:58:36 -06001666
1667 // Group Operations
1668 for (int i = 0; i < GroupOperationCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001669 GroupOperationParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001670 }
1671
1672 // Enqueue flags
1673 for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001674 KernelEnqueueFlagsParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001675 }
1676
1677 // Profiling info
John Kessenich5e4b1242015-08-06 22:53:06 -06001678 KernelProfilingInfoParams[0].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001679
1680 // set name of operator, an initial set of <id> style operands, and the description
1681
1682 InstructionDesc[OpSource].operands.push(OperandSource, "");
1683 InstructionDesc[OpSource].operands.push(OperandLiteralNumber, "'Version'");
John Kessenich55e7d112015-11-15 21:33:39 -07001684 InstructionDesc[OpSource].operands.push(OperandId, "'File'", true);
1685 InstructionDesc[OpSource].operands.push(OperandLiteralString, "'Source'", true);
1686
1687 InstructionDesc[OpSourceContinued].operands.push(OperandLiteralString, "'Continued Source'");
John Kessenich140f3df2015-06-26 16:58:36 -06001688
1689 InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString, "'Extension'");
1690
1691 InstructionDesc[OpName].operands.push(OperandId, "'Target'");
1692 InstructionDesc[OpName].operands.push(OperandLiteralString, "'Name'");
1693
1694 InstructionDesc[OpMemberName].operands.push(OperandId, "'Type'");
1695 InstructionDesc[OpMemberName].operands.push(OperandLiteralNumber, "'Member'");
1696 InstructionDesc[OpMemberName].operands.push(OperandLiteralString, "'Name'");
1697
1698 InstructionDesc[OpString].operands.push(OperandLiteralString, "'String'");
1699
John Kessenich140f3df2015-06-26 16:58:36 -06001700 InstructionDesc[OpLine].operands.push(OperandId, "'File'");
1701 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Line'");
1702 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Column'");
1703
1704 InstructionDesc[OpExtension].operands.push(OperandLiteralString, "'Name'");
1705
1706 InstructionDesc[OpExtInstImport].operands.push(OperandLiteralString, "'Name'");
1707
John Kessenich5e4b1242015-08-06 22:53:06 -06001708 InstructionDesc[OpCapability].operands.push(OperandCapability, "'Capability'");
1709
John Kessenich140f3df2015-06-26 16:58:36 -06001710 InstructionDesc[OpMemoryModel].operands.push(OperandAddressing, "");
1711 InstructionDesc[OpMemoryModel].operands.push(OperandMemory, "");
1712
1713 InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel, "");
1714 InstructionDesc[OpEntryPoint].operands.push(OperandId, "'Entry Point'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001715 InstructionDesc[OpEntryPoint].operands.push(OperandLiteralString, "'Name'");
John Kessenich55e7d112015-11-15 21:33:39 -07001716 InstructionDesc[OpEntryPoint].operands.push(OperandVariableIds, "'Interface'");
John Kessenich140f3df2015-06-26 16:58:36 -06001717
1718 InstructionDesc[OpExecutionMode].operands.push(OperandId, "'Entry Point'");
1719 InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode, "'Mode'");
John Kessenich55e7d112015-11-15 21:33:39 -07001720 InstructionDesc[OpExecutionMode].operands.push(OperandOptionalLiteral, "See <<Execution_Mode,Execution Mode>>");
John Kessenich140f3df2015-06-26 16:58:36 -06001721
1722 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Width'");
1723 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Signedness'");
1724
1725 InstructionDesc[OpTypeFloat].operands.push(OperandLiteralNumber, "'Width'");
1726
John Kessenich5e4b1242015-08-06 22:53:06 -06001727 InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component Type'");
1728 InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001729
John Kessenich5e4b1242015-08-06 22:53:06 -06001730 InstructionDesc[OpTypeMatrix].capabilities.push_back(CapabilityMatrix);
1731 InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column Type'");
1732 InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001733
John Kessenich5e4b1242015-08-06 22:53:06 -06001734 InstructionDesc[OpTypeImage].operands.push(OperandId, "'Sampled Type'");
1735 InstructionDesc[OpTypeImage].operands.push(OperandDimensionality, "");
1736 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Depth'");
1737 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Arrayed'");
1738 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'MS'");
1739 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Sampled'");
1740 InstructionDesc[OpTypeImage].operands.push(OperandSamplerImageFormat, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001741 InstructionDesc[OpTypeImage].operands.push(OperandAccessQualifier, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001742
John Kessenich5e4b1242015-08-06 22:53:06 -06001743 InstructionDesc[OpTypeSampledImage].operands.push(OperandId, "'Image Type'");
1744
1745 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001746 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'");
1747
John Kessenich5e4b1242015-08-06 22:53:06 -06001748 InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapabilityShader);
1749 InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001750
1751 InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n...");
1752
John Kessenich5e4b1242015-08-06 22:53:06 -06001753 InstructionDesc[OpTypeOpaque].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001754 InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type.");
1755
1756 InstructionDesc[OpTypePointer].operands.push(OperandStorage, "");
1757 InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'");
1758
John Kessenich55e7d112015-11-15 21:33:39 -07001759 InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses);
1760 InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'");
1761 InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, "");
1762
John Kessenich5e4b1242015-08-06 22:53:06 -06001763 InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001764
John Kessenich55e7d112015-11-15 21:33:39 -07001765 InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001766
John Kessenich5e4b1242015-08-06 22:53:06 -06001767 InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001768
John Kessenich55e7d112015-11-15 21:33:39 -07001769 InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001770
John Kessenich140f3df2015-06-26 16:58:36 -06001771 InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001772 InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001773
1774 InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'");
1775 InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n...");
1776
1777 InstructionDesc[OpConstant].operands.push(OperandVariableLiterals, "'Value'");
1778
1779 InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
1780
John Kessenich5e4b1242015-08-06 22:53:06 -06001781 InstructionDesc[OpConstantSampler].capabilities.push_back(CapabilityLiteralSampler);
1782 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerAddressingMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001783 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001784 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerFilterMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001785
1786 InstructionDesc[OpSpecConstant].operands.push(OperandVariableLiterals, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06001787
1788 InstructionDesc[OpSpecConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001789
1790 InstructionDesc[OpSpecConstantOp].operands.push(OperandLiteralNumber, "'Opcode'");
1791 InstructionDesc[OpSpecConstantOp].operands.push(OperandVariableIds, "'Operands'");
John Kessenich140f3df2015-06-26 16:58:36 -06001792
1793 InstructionDesc[OpVariable].operands.push(OperandStorage, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001794 InstructionDesc[OpVariable].operands.push(OperandId, "'Initializer'", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001795
John Kessenich140f3df2015-06-26 16:58:36 -06001796 InstructionDesc[OpFunction].operands.push(OperandFunction, "");
1797 InstructionDesc[OpFunction].operands.push(OperandId, "'Function Type'");
1798
1799 InstructionDesc[OpFunctionCall].operands.push(OperandId, "'Function'");
1800 InstructionDesc[OpFunctionCall].operands.push(OperandVariableIds, "'Argument 0', +\n'Argument 1', +\n...");
1801
1802 InstructionDesc[OpExtInst].operands.push(OperandId, "'Set'");
1803 InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber, "'Instruction'");
1804 InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n...");
1805
1806 InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07001807 InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001808
1809 InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'");
1810 InstructionDesc[OpStore].operands.push(OperandId, "'Object'");
John Kessenich55e7d112015-11-15 21:33:39 -07001811 InstructionDesc[OpStore].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001812
John Kessenich5e4b1242015-08-06 22:53:06 -06001813 InstructionDesc[OpPhi].operands.push(OperandVariableIds, "'Variable, Parent, ...'");
John Kessenich140f3df2015-06-26 16:58:36 -06001814
1815 InstructionDesc[OpDecorate].operands.push(OperandId, "'Target'");
1816 InstructionDesc[OpDecorate].operands.push(OperandDecoration, "");
1817 InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1818
John Kessenich5e4b1242015-08-06 22:53:06 -06001819 InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001820 InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'");
1821 InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, "");
1822 InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1823
John Kessenich5e4b1242015-08-06 22:53:06 -06001824 InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'");
1825 InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001826
John Kessenich5e4b1242015-08-06 22:53:06 -06001827 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandId, "'Decoration Group'");
1828 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandVariableIdLiteral, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001829
1830 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Vector'");
1831 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Index'");
1832
1833 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Vector'");
1834 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Component'");
1835 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Index'");
1836
1837 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 1'");
1838 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 2'");
1839 InstructionDesc[OpVectorShuffle].operands.push(OperandVariableLiterals, "'Components'");
1840
1841 InstructionDesc[OpCompositeConstruct].operands.push(OperandVariableIds, "'Constituents'");
1842
1843 InstructionDesc[OpCompositeExtract].operands.push(OperandId, "'Composite'");
1844 InstructionDesc[OpCompositeExtract].operands.push(OperandVariableLiterals, "'Indexes'");
1845
1846 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Object'");
1847 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Composite'");
1848 InstructionDesc[OpCompositeInsert].operands.push(OperandVariableLiterals, "'Indexes'");
1849
1850 InstructionDesc[OpCopyObject].operands.push(OperandId, "'Operand'");
1851
1852 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Target'");
1853 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Source'");
John Kessenich55e7d112015-11-15 21:33:39 -07001854 InstructionDesc[OpCopyMemory].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001855
1856 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Target'");
1857 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Source'");
1858 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07001859 InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001860
John Kessenich5e4b1242015-08-06 22:53:06 -06001861 InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001862
John Kessenich5e4b1242015-08-06 22:53:06 -06001863 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'");
1864 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'");
John Kessenich140f3df2015-06-26 16:58:36 -06001865
John Kessenich55e7d112015-11-15 21:33:39 -07001866 InstructionDesc[OpImage].operands.push(OperandId, "'Sampled Image'");
1867
John Kessenich5e4b1242015-08-06 22:53:06 -06001868 InstructionDesc[OpImageRead].operands.push(OperandId, "'Image'");
1869 InstructionDesc[OpImageRead].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001870 InstructionDesc[OpImageRead].operands.push(OperandImageOperands, "", true);
1871 InstructionDesc[OpImageRead].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001872
John Kessenich5e4b1242015-08-06 22:53:06 -06001873 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Image'");
1874 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Coordinate'");
1875 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Texel'");
John Kessenich55e7d112015-11-15 21:33:39 -07001876 InstructionDesc[OpImageWrite].operands.push(OperandImageOperands, "", true);
1877 InstructionDesc[OpImageWrite].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001878
John Kessenich5e4b1242015-08-06 22:53:06 -06001879 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1880 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001881 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1882 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001883 InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001884
John Kessenich5e4b1242015-08-06 22:53:06 -06001885 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1886 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001887 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandImageOperands, "", true);
1888 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001889
John Kessenich5e4b1242015-08-06 22:53:06 -06001890 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1891 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1892 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001893 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1894 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001895 InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001896
John Kessenich5e4b1242015-08-06 22:53:06 -06001897 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1898 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1899 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001900 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1901 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001902 InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001903
John Kessenich5e4b1242015-08-06 22:53:06 -06001904 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
1905 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001906 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
1907 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001908 InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001909
John Kessenich5e4b1242015-08-06 22:53:06 -06001910 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
1911 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001912 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
1913 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001914 InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001915
John Kessenich5e4b1242015-08-06 22:53:06 -06001916 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1917 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1918 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001919 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1920 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001921 InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001922
John Kessenich5e4b1242015-08-06 22:53:06 -06001923 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1924 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1925 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001926 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1927 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001928 InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001929
John Kessenich55e7d112015-11-15 21:33:39 -07001930 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001931 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001932 InstructionDesc[OpImageFetch].operands.push(OperandImageOperands, "", true);
1933 InstructionDesc[OpImageFetch].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001934
John Kessenich5e4b1242015-08-06 22:53:06 -06001935 InstructionDesc[OpImageGather].operands.push(OperandId, "'Sampled Image'");
1936 InstructionDesc[OpImageGather].operands.push(OperandId, "'Coordinate'");
1937 InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'");
John Kessenich55e7d112015-11-15 21:33:39 -07001938 InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true);
1939 InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001940 InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001941
John Kessenich5e4b1242015-08-06 22:53:06 -06001942 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'");
1943 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'");
1944 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001945 InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true);
1946 InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001947 InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001948
John Kessenich55e7d112015-11-15 21:33:39 -07001949 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1950 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
1951 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1952 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true);
1953 InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1954
1955 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1956 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
1957 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true);
1958 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true);
1959 InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1960
1961 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1962 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1963 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
1964 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1965 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
1966 InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1967
1968 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1969 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1970 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
1971 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1972 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
1973 InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1974
1975 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
1976 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
1977 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
1978 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
1979 InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1980
1981 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
1982 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
1983 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
1984 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
1985 InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1986
1987 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1988 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1989 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
1990 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1991 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
1992 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1993
1994 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1995 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1996 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
1997 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1998 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
1999 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2000
2001 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'");
2002 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'");
2003 InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true);
2004 InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true);
2005 InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency);
2006
2007 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'");
2008 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'");
2009 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'");
2010 InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true);
2011 InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true);
2012 InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency);
2013
2014 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'");
2015 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'");
2016 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'");
2017 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true);
2018 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true);
2019 InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency);
2020
John Kessenich6c292d32016-02-15 20:58:50 -07002021 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'");
2022 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'");
2023 InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true);
2024 InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true);
2025 InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency);
2026
John Kessenich55e7d112015-11-15 21:33:39 -07002027 InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'");
2028 InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency);
2029
John Kessenich5e4b1242015-08-06 22:53:06 -06002030 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'");
2031 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'");
John Kessenich55e7d112015-11-15 21:33:39 -07002032 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel);
2033 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002034
John Kessenich5e4b1242015-08-06 22:53:06 -06002035 InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002036 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel);
2037 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002038
John Kessenich5e4b1242015-08-06 22:53:06 -06002039 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'");
2040 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07002041 InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002042
John Kessenich5e4b1242015-08-06 22:53:06 -06002043 InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002044 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel);
2045 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002046
John Kessenich5e4b1242015-08-06 22:53:06 -06002047 InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002048 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel);
2049 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002050
John Kessenich5e4b1242015-08-06 22:53:06 -06002051 InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'");
2052 InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002053
John Kessenich5e4b1242015-08-06 22:53:06 -06002054 InstructionDesc[OpImageQueryOrder].operands.push(OperandId, "'Image'");
2055 InstructionDesc[OpImageQueryOrder].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002056
2057 InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'");
2058 InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2059
2060 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandId, "'Base'");
2061 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2062
John Kessenich5e4b1242015-08-06 22:53:06 -06002063 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Base'");
2064 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Element'");
2065 InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2066 InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2067
John Kessenich55e7d112015-11-15 21:33:39 -07002068 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'");
2069 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'");
2070 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2071 InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2072
John Kessenich140f3df2015-06-26 16:58:36 -06002073 InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'");
2074
2075 InstructionDesc[OpFNegate].operands.push(OperandId, "'Operand'");
2076
2077 InstructionDesc[OpNot].operands.push(OperandId, "'Operand'");
2078
2079 InstructionDesc[OpAny].operands.push(OperandId, "'Vector'");
2080
2081 InstructionDesc[OpAll].operands.push(OperandId, "'Vector'");
2082
2083 InstructionDesc[OpConvertFToU].operands.push(OperandId, "'Float Value'");
2084
2085 InstructionDesc[OpConvertFToS].operands.push(OperandId, "'Float Value'");
2086
2087 InstructionDesc[OpConvertSToF].operands.push(OperandId, "'Signed Value'");
2088
John Kessenich5e4b1242015-08-06 22:53:06 -06002089 InstructionDesc[OpConvertUToF].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002090
John Kessenich5e4b1242015-08-06 22:53:06 -06002091 InstructionDesc[OpUConvert].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002092
2093 InstructionDesc[OpSConvert].operands.push(OperandId, "'Signed Value'");
2094
2095 InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'");
2096
2097 InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002098 InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002099
2100 InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002101 InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002102
2103 InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002104 InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002105
John Kessenich5e4b1242015-08-06 22:53:06 -06002106 InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer Value'");
2107 InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002108
John Kessenich5e4b1242015-08-06 22:53:06 -06002109 InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Pointer'");
2110 InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002111
John Kessenich5e4b1242015-08-06 22:53:06 -06002112 InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Pointer'");
2113 InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002114
John Kessenich5e4b1242015-08-06 22:53:06 -06002115 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Pointer'");
2116 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'Storage'");
2117 InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002118
John Kessenich5e4b1242015-08-06 22:53:06 -06002119 InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'Pointer'");
2120 InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002121
2122 InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'");
2123
John Kessenich5e4b1242015-08-06 22:53:06 -06002124 InstructionDesc[OpQuantizeToF16].operands.push(OperandId, "'Value'");
2125
2126 InstructionDesc[OpTranspose].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002127 InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'");
2128
2129 InstructionDesc[OpIsNan].operands.push(OperandId, "'x'");
2130
2131 InstructionDesc[OpIsInf].operands.push(OperandId, "'x'");
2132
John Kessenich5e4b1242015-08-06 22:53:06 -06002133 InstructionDesc[OpIsFinite].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002134 InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'");
2135
John Kessenich5e4b1242015-08-06 22:53:06 -06002136 InstructionDesc[OpIsNormal].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002137 InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'");
2138
John Kessenich5e4b1242015-08-06 22:53:06 -06002139 InstructionDesc[OpSignBitSet].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002140 InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'");
2141
John Kessenich5e4b1242015-08-06 22:53:06 -06002142 InstructionDesc[OpLessOrGreater].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002143 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'");
2144 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'");
2145
John Kessenich5e4b1242015-08-06 22:53:06 -06002146 InstructionDesc[OpOrdered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002147 InstructionDesc[OpOrdered].operands.push(OperandId, "'x'");
2148 InstructionDesc[OpOrdered].operands.push(OperandId, "'y'");
2149
John Kessenich5e4b1242015-08-06 22:53:06 -06002150 InstructionDesc[OpUnordered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002151 InstructionDesc[OpUnordered].operands.push(OperandId, "'x'");
2152 InstructionDesc[OpUnordered].operands.push(OperandId, "'y'");
2153
2154 InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'");
2155 InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002156 InstructionDesc[OpArrayLength].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002157
2158 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'");
2159 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'");
2160
2161 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 1'");
2162 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 2'");
2163
2164 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 1'");
2165 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 2'");
2166
2167 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 1'");
2168 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 2'");
2169
2170 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 1'");
2171 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 2'");
2172
2173 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 1'");
2174 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 2'");
2175
2176 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 1'");
2177 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 2'");
2178
2179 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 1'");
2180 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 2'");
2181
2182 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 1'");
2183 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 2'");
2184
2185 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 1'");
2186 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 2'");
2187
2188 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 1'");
2189 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 2'");
2190
2191 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 1'");
2192 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 2'");
2193
2194 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 1'");
2195 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 2'");
2196
2197 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 1'");
2198 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 2'");
2199
2200 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'");
2201 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'");
2202
John Kessenich5e4b1242015-08-06 22:53:06 -06002203 InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002204 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'");
2205 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'");
2206
John Kessenich5e4b1242015-08-06 22:53:06 -06002207 InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002208 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'");
2209 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'");
2210
John Kessenich5e4b1242015-08-06 22:53:06 -06002211 InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002212 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'");
2213 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'");
2214
John Kessenich5e4b1242015-08-06 22:53:06 -06002215 InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002216 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'");
2217 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'");
2218
John Kessenich5e4b1242015-08-06 22:53:06 -06002219 InstructionDesc[OpOuterProduct].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002220 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'");
2221 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'");
2222
2223 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 1'");
2224 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 2'");
2225
John Kessenich55e7d112015-11-15 21:33:39 -07002226 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 1'");
2227 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 2'");
2228
2229 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 1'");
2230 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 2'");
2231
2232 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 1'");
2233 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 2'");
2234
2235 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 1'");
2236 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 2'");
2237
John Kessenich5e4b1242015-08-06 22:53:06 -06002238 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Base'");
2239 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002240
John Kessenich5e4b1242015-08-06 22:53:06 -06002241 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Base'");
2242 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002243
John Kessenich5e4b1242015-08-06 22:53:06 -06002244 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Base'");
2245 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002246
2247 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 1'");
2248 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 2'");
2249
John Kessenich140f3df2015-06-26 16:58:36 -06002250 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 1'");
2251 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 2'");
2252
John Kessenich5e4b1242015-08-06 22:53:06 -06002253 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 1'");
2254 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 2'");
2255
2256 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 1'");
2257 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 2'");
2258
2259 InstructionDesc[OpLogicalNot].operands.push(OperandId, "'Operand'");
2260
John Kessenich140f3df2015-06-26 16:58:36 -06002261 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 1'");
2262 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 2'");
2263
2264 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 1'");
2265 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 2'");
2266
2267 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'");
2268 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'");
2269
John Kessenich5e4b1242015-08-06 22:53:06 -06002270 InstructionDesc[OpBitFieldInsert].capabilities.push_back(CapabilityShader);
2271 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Base'");
2272 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Insert'");
2273 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Offset'");
2274 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Count'");
2275
2276 InstructionDesc[OpBitFieldSExtract].capabilities.push_back(CapabilityShader);
2277 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'");
2278 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'");
2279 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'");
2280
2281 InstructionDesc[OpBitFieldUExtract].capabilities.push_back(CapabilityShader);
2282 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'");
2283 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'");
2284 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'");
2285
2286 InstructionDesc[OpBitReverse].capabilities.push_back(CapabilityShader);
2287 InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'");
2288
2289 InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'");
2290
John Kessenich140f3df2015-06-26 16:58:36 -06002291 InstructionDesc[OpSelect].operands.push(OperandId, "'Condition'");
2292 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 1'");
2293 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 2'");
2294
2295 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 1'");
2296 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 2'");
2297
2298 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 1'");
2299 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 2'");
2300
2301 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 1'");
2302 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 2'");
2303
2304 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 1'");
2305 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 2'");
2306
2307 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 1'");
2308 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 2'");
2309
2310 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 1'");
2311 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 2'");
2312
2313 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 1'");
2314 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 2'");
2315
2316 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 1'");
2317 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 2'");
2318
2319 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 1'");
2320 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 2'");
2321
2322 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 1'");
2323 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 2'");
2324
2325 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 1'");
2326 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 2'");
2327
2328 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 1'");
2329 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 2'");
2330
2331 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 1'");
2332 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 2'");
2333
2334 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 1'");
2335 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 2'");
2336
2337 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 1'");
2338 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 2'");
2339
2340 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 1'");
2341 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 2'");
2342
2343 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 1'");
2344 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 2'");
2345
2346 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 1'");
2347 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 2'");
2348
2349 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2350 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2351
2352 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2353 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2354
2355 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2356 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2357
2358 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2359 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2360
John Kessenich5e4b1242015-08-06 22:53:06 -06002361 InstructionDesc[OpDPdx].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002362 InstructionDesc[OpDPdx].operands.push(OperandId, "'P'");
2363
John Kessenich5e4b1242015-08-06 22:53:06 -06002364 InstructionDesc[OpDPdy].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002365 InstructionDesc[OpDPdy].operands.push(OperandId, "'P'");
2366
John Kessenich5e4b1242015-08-06 22:53:06 -06002367 InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002368 InstructionDesc[OpFwidth].operands.push(OperandId, "'P'");
2369
John Kessenich55e7d112015-11-15 21:33:39 -07002370 InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002371 InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'");
2372
John Kessenich55e7d112015-11-15 21:33:39 -07002373 InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002374 InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'");
2375
John Kessenich55e7d112015-11-15 21:33:39 -07002376 InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002377 InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'");
2378
John Kessenich55e7d112015-11-15 21:33:39 -07002379 InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002380 InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'");
2381
John Kessenich55e7d112015-11-15 21:33:39 -07002382 InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002383 InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'");
2384
John Kessenich55e7d112015-11-15 21:33:39 -07002385 InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002386 InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'");
2387
John Kessenich5e4b1242015-08-06 22:53:06 -06002388 InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002389
John Kessenich5e4b1242015-08-06 22:53:06 -06002390 InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002391
2392 InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002393 InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002394
2395 InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002396 InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002397
John Kessenich5e4b1242015-08-06 22:53:06 -06002398 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'");
2399 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'");
2400 InstructionDesc[OpControlBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
John Kessenich140f3df2015-06-26 16:58:36 -06002401
John Kessenich5e4b1242015-08-06 22:53:06 -06002402 InstructionDesc[OpMemoryBarrier].operands.push(OperandScope, "'Memory'");
John Kessenich140f3df2015-06-26 16:58:36 -06002403 InstructionDesc[OpMemoryBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
2404
John Kessenich5e4b1242015-08-06 22:53:06 -06002405 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Image'");
2406 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Coordinate'");
2407 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Sample'");
John Kessenich140f3df2015-06-26 16:58:36 -06002408
2409 InstructionDesc[OpAtomicLoad].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002410 InstructionDesc[OpAtomicLoad].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002411 InstructionDesc[OpAtomicLoad].operands.push(OperandMemorySemantics, "'Semantics'");
2412
2413 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002414 InstructionDesc[OpAtomicStore].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002415 InstructionDesc[OpAtomicStore].operands.push(OperandMemorySemantics, "'Semantics'");
2416 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Value'");
2417
2418 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002419 InstructionDesc[OpAtomicExchange].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002420 InstructionDesc[OpAtomicExchange].operands.push(OperandMemorySemantics, "'Semantics'");
2421 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Value'");
2422
2423 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002424 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandScope, "'Scope'");
2425 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Equal'");
2426 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002427 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Value'");
2428 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Comparator'");
2429
2430 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002431 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandScope, "'Scope'");
2432 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Equal'");
2433 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002434 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'");
2435 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002436 InstructionDesc[OpAtomicCompareExchangeWeak].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002437
2438 InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002439 InstructionDesc[OpAtomicIIncrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002440 InstructionDesc[OpAtomicIIncrement].operands.push(OperandMemorySemantics, "'Semantics'");
2441
2442 InstructionDesc[OpAtomicIDecrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002443 InstructionDesc[OpAtomicIDecrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002444 InstructionDesc[OpAtomicIDecrement].operands.push(OperandMemorySemantics, "'Semantics'");
2445
2446 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002447 InstructionDesc[OpAtomicIAdd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002448 InstructionDesc[OpAtomicIAdd].operands.push(OperandMemorySemantics, "'Semantics'");
2449 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Value'");
2450
2451 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002452 InstructionDesc[OpAtomicISub].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002453 InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics, "'Semantics'");
2454 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Value'");
2455
2456 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002457 InstructionDesc[OpAtomicUMin].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002458 InstructionDesc[OpAtomicUMin].operands.push(OperandMemorySemantics, "'Semantics'");
2459 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Value'");
2460
2461 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002462 InstructionDesc[OpAtomicUMax].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002463 InstructionDesc[OpAtomicUMax].operands.push(OperandMemorySemantics, "'Semantics'");
2464 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Value'");
2465
John Kessenich5e4b1242015-08-06 22:53:06 -06002466 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Pointer'");
2467 InstructionDesc[OpAtomicSMin].operands.push(OperandScope, "'Scope'");
2468 InstructionDesc[OpAtomicSMin].operands.push(OperandMemorySemantics, "'Semantics'");
2469 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002470
John Kessenich5e4b1242015-08-06 22:53:06 -06002471 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Pointer'");
2472 InstructionDesc[OpAtomicSMax].operands.push(OperandScope, "'Scope'");
2473 InstructionDesc[OpAtomicSMax].operands.push(OperandMemorySemantics, "'Semantics'");
2474 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002475
2476 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002477 InstructionDesc[OpAtomicAnd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002478 InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics, "'Semantics'");
2479 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Value'");
2480
2481 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002482 InstructionDesc[OpAtomicOr].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002483 InstructionDesc[OpAtomicOr].operands.push(OperandMemorySemantics, "'Semantics'");
2484 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Value'");
2485
2486 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002487 InstructionDesc[OpAtomicXor].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002488 InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics, "'Semantics'");
2489 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Value'");
2490
John Kessenich55e7d112015-11-15 21:33:39 -07002491 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'");
2492 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'");
2493 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'");
2494 InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel);
2495
2496 InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'");
2497 InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'");
2498 InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'");
2499 InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel);
2500
John Kessenich5e4b1242015-08-06 22:53:06 -06002501 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich55e7d112015-11-15 21:33:39 -07002502 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'");
John Kessenich140f3df2015-06-26 16:58:36 -06002503 InstructionDesc[OpLoopMerge].operands.push(OperandLoop, "");
2504
John Kessenich5e4b1242015-08-06 22:53:06 -06002505 InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich140f3df2015-06-26 16:58:36 -06002506 InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, "");
2507
2508 InstructionDesc[OpBranch].operands.push(OperandId, "'Target Label'");
2509
2510 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'Condition'");
2511 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'True Label'");
2512 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'False Label'");
2513 InstructionDesc[OpBranchConditional].operands.push(OperandVariableLiterals, "'Branch weights'");
2514
2515 InstructionDesc[OpSwitch].operands.push(OperandId, "'Selector'");
2516 InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'");
2517 InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'");
2518
John Kessenich5e4b1242015-08-06 22:53:06 -06002519 InstructionDesc[OpKill].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002520
2521 InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'");
2522
John Kessenich5e4b1242015-08-06 22:53:06 -06002523 InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'");
2524 InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002525 InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002526
John Kessenich5e4b1242015-08-06 22:53:06 -06002527 InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'");
2528 InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002529 InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002530
John Kessenich55e7d112015-11-15 21:33:39 -07002531 InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel);
2532 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'");
2533 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'");
2534 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'");
2535 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Num Elements'");
2536 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'");
2537 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002538
John Kessenich55e7d112015-11-15 21:33:39 -07002539 InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel);
2540 InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'");
2541 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'");
2542 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'");
John Kessenich140f3df2015-06-26 16:58:36 -06002543
John Kessenich5e4b1242015-08-06 22:53:06 -06002544 InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups);
2545 InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002546 InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'");
2547
John Kessenich5e4b1242015-08-06 22:53:06 -06002548 InstructionDesc[OpGroupAny].capabilities.push_back(CapabilityGroups);
2549 InstructionDesc[OpGroupAny].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002550 InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'");
2551
John Kessenich5e4b1242015-08-06 22:53:06 -06002552 InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapabilityGroups);
2553 InstructionDesc[OpGroupBroadcast].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002554 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'");
2555 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'");
2556
John Kessenich5e4b1242015-08-06 22:53:06 -06002557 InstructionDesc[OpGroupIAdd].capabilities.push_back(CapabilityGroups);
2558 InstructionDesc[OpGroupIAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002559 InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'");
2560 InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'");
2561
John Kessenich5e4b1242015-08-06 22:53:06 -06002562 InstructionDesc[OpGroupFAdd].capabilities.push_back(CapabilityGroups);
2563 InstructionDesc[OpGroupFAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002564 InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'");
2565 InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'");
2566
John Kessenich5e4b1242015-08-06 22:53:06 -06002567 InstructionDesc[OpGroupUMin].capabilities.push_back(CapabilityGroups);
2568 InstructionDesc[OpGroupUMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002569 InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'");
2570 InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'");
2571
John Kessenich5e4b1242015-08-06 22:53:06 -06002572 InstructionDesc[OpGroupSMin].capabilities.push_back(CapabilityGroups);
2573 InstructionDesc[OpGroupSMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002574 InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'");
2575 InstructionDesc[OpGroupSMin].operands.push(OperandId, "X");
2576
John Kessenich5e4b1242015-08-06 22:53:06 -06002577 InstructionDesc[OpGroupFMin].capabilities.push_back(CapabilityGroups);
2578 InstructionDesc[OpGroupFMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002579 InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'");
2580 InstructionDesc[OpGroupFMin].operands.push(OperandId, "X");
2581
John Kessenich5e4b1242015-08-06 22:53:06 -06002582 InstructionDesc[OpGroupUMax].capabilities.push_back(CapabilityGroups);
2583 InstructionDesc[OpGroupUMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002584 InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'");
2585 InstructionDesc[OpGroupUMax].operands.push(OperandId, "X");
2586
John Kessenich5e4b1242015-08-06 22:53:06 -06002587 InstructionDesc[OpGroupSMax].capabilities.push_back(CapabilityGroups);
2588 InstructionDesc[OpGroupSMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002589 InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'");
2590 InstructionDesc[OpGroupSMax].operands.push(OperandId, "X");
2591
John Kessenich5e4b1242015-08-06 22:53:06 -06002592 InstructionDesc[OpGroupFMax].capabilities.push_back(CapabilityGroups);
2593 InstructionDesc[OpGroupFMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002594 InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'");
2595 InstructionDesc[OpGroupFMax].operands.push(OperandId, "X");
2596
John Kessenich5e4b1242015-08-06 22:53:06 -06002597 InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes);
2598 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'");
2599 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002600 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'");
2601 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002602
John Kessenich5e4b1242015-08-06 22:53:06 -06002603 InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes);
2604 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'");
2605 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002606 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'");
2607 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002608
John Kessenich5e4b1242015-08-06 22:53:06 -06002609 InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes);
2610 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'");
2611 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'");
2612 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'");
2613 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002614 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'");
2615 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002616
John Kessenich5e4b1242015-08-06 22:53:06 -06002617 InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes);
2618 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'");
2619 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'");
2620 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'");
2621 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002622 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'");
2623 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002624
John Kessenich5e4b1242015-08-06 22:53:06 -06002625 InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2626 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2627 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002628 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2629 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002630
John Kessenich5e4b1242015-08-06 22:53:06 -06002631 InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2632 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2633 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002634 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2635 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002636
John Kessenich5e4b1242015-08-06 22:53:06 -06002637 InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes);
2638 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'");
2639 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002640 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2641 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002642
John Kessenich5e4b1242015-08-06 22:53:06 -06002643 InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes);
2644 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'");
2645 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002646 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2647 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002648
John Kessenich5e4b1242015-08-06 22:53:06 -06002649 InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes);
2650 InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'");
John Kessenich140f3df2015-06-26 16:58:36 -06002651
John Kessenich5e4b1242015-08-06 22:53:06 -06002652 InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes);
2653 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002654 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'");
2655 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002656
John Kessenich5e4b1242015-08-06 22:53:06 -06002657 InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes);
2658 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002659 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'");
2660 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002661
John Kessenich5e4b1242015-08-06 22:53:06 -06002662 InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2663 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'");
2664 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2665 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002666 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2667 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002668
John Kessenich5e4b1242015-08-06 22:53:06 -06002669 InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2670 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'");
2671 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2672 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002673 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2674 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002675
John Kessenich5e4b1242015-08-06 22:53:06 -06002676 InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes);
2677 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'");
2678 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'");
2679 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002680 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2681 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002682
John Kessenich5e4b1242015-08-06 22:53:06 -06002683 InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes);
2684 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'");
2685 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'");
2686 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002687 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2688 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002689
John Kessenich5e4b1242015-08-06 22:53:06 -06002690 InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002691 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'");
2692 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'");
2693 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'");
2694
John Kessenich5e4b1242015-08-06 22:53:06 -06002695 InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002696
John Kessenich5e4b1242015-08-06 22:53:06 -06002697 InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002698
John Kessenich5e4b1242015-08-06 22:53:06 -06002699 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Event'");
2700 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Profiling Info'");
2701 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002702
John Kessenich5e4b1242015-08-06 22:53:06 -06002703 InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002704
John Kessenich5e4b1242015-08-06 22:53:06 -06002705 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Event'");
2706 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Status'");
John Kessenich140f3df2015-06-26 16:58:36 -06002707
John Kessenich5e4b1242015-08-06 22:53:06 -06002708 InstructionDesc[OpIsValidEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2709 InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002710
John Kessenich5e4b1242015-08-06 22:53:06 -06002711 InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002712
John Kessenich5e4b1242015-08-06 22:53:06 -06002713 InstructionDesc[OpRetainEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2714 InstructionDesc[OpRetainEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002715
John Kessenich5e4b1242015-08-06 22:53:06 -06002716 InstructionDesc[OpReleaseEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2717 InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002718
John Kessenich5e4b1242015-08-06 22:53:06 -06002719 InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002720 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002721 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param'");
2722 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Size'");
2723 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002724
John Kessenich5e4b1242015-08-06 22:53:06 -06002725 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002726 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002727 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param'");
2728 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Size'");
2729 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002730
John Kessenich5e4b1242015-08-06 22:53:06 -06002731 InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002732 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'");
2733 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002734 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param'");
2735 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Size'");
2736 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002737
John Kessenich5e4b1242015-08-06 22:53:06 -06002738 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002739 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'");
2740 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002741 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param'");
2742 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Size'");
2743 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002744
John Kessenich5e4b1242015-08-06 22:53:06 -06002745 InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapabilityDeviceEnqueue);
2746 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Queue'");
2747 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Flags'");
John Kessenich140f3df2015-06-26 16:58:36 -06002748 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'");
2749 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Num Events'");
2750 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Wait Events'");
2751 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Ret Event'");
2752 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Invoke'");
2753 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param'");
2754 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Size'");
2755 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'");
2756 InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'");
2757
John Kessenich5e4b1242015-08-06 22:53:06 -06002758 InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapabilityDeviceEnqueue);
2759 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Queue'");
John Kessenich140f3df2015-06-26 16:58:36 -06002760 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'");
2761 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'");
2762 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'");
Rex Xu9d93a232016-05-05 12:30:44 +08002763
Rex Xu51596642016-09-21 18:56:12 +08002764 InstructionDesc[OpSubgroupBallotKHR].operands.push(OperandId, "'Predicate'");
2765
2766 InstructionDesc[OpSubgroupFirstInvocationKHR].operands.push(OperandId, "'Value'");
2767
chaocf200da82016-12-20 12:44:35 -08002768 InstructionDesc[OpSubgroupReadInvocationKHR].capabilities.push_back(CapabilityGroups);
2769 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'");
2770 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'");
2771
Rex Xu9d93a232016-05-05 12:30:44 +08002772#ifdef AMD_EXTENSIONS
2773 InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2774 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2775 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2776 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
2777
2778 InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2779 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2780 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2781 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'");
2782
2783 InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2784 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2785 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2786 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'");
2787
2788 InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2789 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2790 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2791 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X");
2792
2793 InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2794 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2795 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2796 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X");
2797
2798 InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2799 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2800 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2801 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X");
2802
2803 InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2804 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2805 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2806 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X");
2807
2808 InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2809 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2810 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2811 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X");
2812#endif
John Kessenich140f3df2015-06-26 16:58:36 -06002813}
2814
2815}; // end spv namespace