blob: de401c73ffdf821e30c29f6ab2f5e61c9055e366 [file] [log] [blame]
John Kessenich140f3df2015-06-26 16:58:36 -06001//
John Kessenich927608b2017-01-06 12:34:14 -07002// Copyright (C) 2014-2015 LunarG, Inc.
John Kessenich140f3df2015-06-26 16:58:36 -06003//
John Kessenich927608b2017-01-06 12:34:14 -07004// All rights reserved.
John Kessenich140f3df2015-06-26 16:58:36 -06005//
John Kessenich927608b2017-01-06 12:34:14 -07006// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions
8// are met:
John Kessenich140f3df2015-06-26 16:58:36 -06009//
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//
John Kessenich927608b2017-01-06 12:34:14 -070022// 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.
John Kessenich140f3df2015-06-26 16:58:36 -060034
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";
chaoc6e5acae2016-12-20 13:28:52 -0800264 case 5250: return "PassthroughNV";
chaoc0ad6a4e2016-12-19 16:29:34 -0800265#endif
John Kessenich140f3df2015-06-26 16:58:36 -0600266 }
267}
268
John Kessenich55e7d112015-11-15 21:33:39 -0700269const int BuiltInCeiling = 44;
John Kessenich140f3df2015-06-26 16:58:36 -0600270
271const char* BuiltInString(int builtIn)
272{
273 switch (builtIn) {
274 case 0: return "Position";
275 case 1: return "PointSize";
John Kessenich5e4b1242015-08-06 22:53:06 -0600276 case 2: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600277 case 3: return "ClipDistance";
278 case 4: return "CullDistance";
279 case 5: return "VertexId";
280 case 6: return "InstanceId";
281 case 7: return "PrimitiveId";
282 case 8: return "InvocationId";
283 case 9: return "Layer";
284 case 10: return "ViewportIndex";
285 case 11: return "TessLevelOuter";
286 case 12: return "TessLevelInner";
287 case 13: return "TessCoord";
288 case 14: return "PatchVertices";
289 case 15: return "FragCoord";
290 case 16: return "PointCoord";
291 case 17: return "FrontFacing";
292 case 18: return "SampleId";
293 case 19: return "SamplePosition";
294 case 20: return "SampleMask";
John Kessenich55e7d112015-11-15 21:33:39 -0700295 case 21: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600296 case 22: return "FragDepth";
297 case 23: return "HelperInvocation";
298 case 24: return "NumWorkgroups";
299 case 25: return "WorkgroupSize";
300 case 26: return "WorkgroupId";
301 case 27: return "LocalInvocationId";
302 case 28: return "GlobalInvocationId";
303 case 29: return "LocalInvocationIndex";
304 case 30: return "WorkDim";
305 case 31: return "GlobalSize";
306 case 32: return "EnqueuedWorkgroupSize";
307 case 33: return "GlobalOffset";
308 case 34: return "GlobalLinearId";
John Kessenich55e7d112015-11-15 21:33:39 -0700309 case 35: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600310 case 36: return "SubgroupSize";
311 case 37: return "SubgroupMaxSize";
312 case 38: return "NumSubgroups";
313 case 39: return "NumEnqueuedSubgroups";
314 case 40: return "SubgroupId";
315 case 41: return "SubgroupLocalInvocationId";
John Kessenich55e7d112015-11-15 21:33:39 -0700316 case 42: return "VertexIndex"; // TBD: put next to VertexId?
317 case 43: return "InstanceIndex"; // TBD: put next to InstanceId?
John Kessenich140f3df2015-06-26 16:58:36 -0600318
319 case BuiltInCeiling:
320 default: return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +0800321
Rex Xu51596642016-09-21 18:56:12 +0800322 case 4416: return "SubgroupEqMaskKHR";
323 case 4417: return "SubgroupGeMaskKHR";
324 case 4418: return "SubgroupGtMaskKHR";
325 case 4419: return "SubgroupLeMaskKHR";
326 case 4420: return "SubgroupLtMaskKHR";
327
Rex Xuf3b27472016-07-22 18:15:31 +0800328 case 4424: return "BaseVertex";
329 case 4425: return "BaseInstance";
330 case 4426: return "DrawIndex";
331
Rex Xu9d93a232016-05-05 12:30:44 +0800332#ifdef AMD_EXTENSIONS
333 case 4992: return "BaryCoordNoPerspAMD";
334 case 4993: return "BaryCoordNoPerspCentroidAMD";
335 case 4994: return "BaryCoordNoPerspSampleAMD";
336 case 4995: return "BaryCoordSmoothAMD";
337 case 4996: return "BaryCoordSmoothCentroidAMD";
338 case 4997: return "BaryCoordSmoothSampleAMD";
339 case 4998: return "BaryCoordPullModelAMD";
340#endif
John Kessenich140f3df2015-06-26 16:58:36 -0600341 }
342}
343
John Kessenich55e7d112015-11-15 21:33:39 -0700344const int DimensionCeiling = 7;
John Kessenich140f3df2015-06-26 16:58:36 -0600345
346const char* DimensionString(int dim)
347{
348 switch (dim) {
349 case 0: return "1D";
350 case 1: return "2D";
351 case 2: return "3D";
352 case 3: return "Cube";
353 case 4: return "Rect";
354 case 5: return "Buffer";
John Kessenich55e7d112015-11-15 21:33:39 -0700355 case 6: return "SubpassData";
John Kessenich140f3df2015-06-26 16:58:36 -0600356
357 case DimensionCeiling:
358 default: return "Bad";
359 }
360}
361
362const int SamplerAddressingModeCeiling = 5;
363
364const char* SamplerAddressingModeString(int mode)
365{
366 switch (mode) {
367 case 0: return "None";
368 case 1: return "ClampToEdge";
369 case 2: return "Clamp";
370 case 3: return "Repeat";
371 case 4: return "RepeatMirrored";
372
373 case SamplerAddressingModeCeiling:
374 default: return "Bad";
375 }
376}
377
378const int SamplerFilterModeCeiling = 2;
379
380const char* SamplerFilterModeString(int mode)
381{
382 switch (mode) {
383 case 0: return "Nearest";
384 case 1: return "Linear";
385
386 case SamplerFilterModeCeiling:
387 default: return "Bad";
388 }
389}
390
John Kessenich5e4b1242015-08-06 22:53:06 -0600391const int ImageFormatCeiling = 40;
392
393const char* ImageFormatString(int format)
394{
395 switch (format) {
396 case 0: return "Unknown";
397
398 // ES/Desktop float
399 case 1: return "Rgba32f";
400 case 2: return "Rgba16f";
401 case 3: return "R32f";
402 case 4: return "Rgba8";
403 case 5: return "Rgba8Snorm";
404
405 // Desktop float
406 case 6: return "Rg32f";
407 case 7: return "Rg16f";
408 case 8: return "R11fG11fB10f";
409 case 9: return "R16f";
410 case 10: return "Rgba16";
411 case 11: return "Rgb10A2";
412 case 12: return "Rg16";
413 case 13: return "Rg8";
414 case 14: return "R16";
415 case 15: return "R8";
416 case 16: return "Rgba16Snorm";
417 case 17: return "Rg16Snorm";
418 case 18: return "Rg8Snorm";
419 case 19: return "R16Snorm";
420 case 20: return "R8Snorm";
421
422 // ES/Desktop int
423 case 21: return "Rgba32i";
424 case 22: return "Rgba16i";
425 case 23: return "Rgba8i";
426 case 24: return "R32i";
427
428 // Desktop int
429 case 25: return "Rg32i";
430 case 26: return "Rg16i";
431 case 27: return "Rg8i";
432 case 28: return "R16i";
433 case 29: return "R8i";
434
435 // ES/Desktop uint
436 case 30: return "Rgba32ui";
437 case 31: return "Rgba16ui";
438 case 32: return "Rgba8ui";
439 case 33: return "R32ui";
440
441 // Desktop uint
442 case 34: return "Rgb10a2ui";
443 case 35: return "Rg32ui";
444 case 36: return "Rg16ui";
445 case 37: return "Rg8ui";
446 case 38: return "R16ui";
447 case 39: return "R8ui";
448
449 case ImageFormatCeiling:
450 default:
451 return "Bad";
452 }
453}
454
455const int ImageChannelOrderCeiling = 19;
456
457const char* ImageChannelOrderString(int format)
458{
459 switch (format) {
460 case 0: return "R";
461 case 1: return "A";
462 case 2: return "RG";
463 case 3: return "RA";
464 case 4: return "RGB";
465 case 5: return "RGBA";
466 case 6: return "BGRA";
467 case 7: return "ARGB";
468 case 8: return "Intensity";
469 case 9: return "Luminance";
470 case 10: return "Rx";
471 case 11: return "RGx";
472 case 12: return "RGBx";
473 case 13: return "Depth";
474 case 14: return "DepthStencil";
475 case 15: return "sRGB";
476 case 16: return "sRGBx";
477 case 17: return "sRGBA";
478 case 18: return "sBGRA";
479
480 case ImageChannelOrderCeiling:
481 default:
482 return "Bad";
483 }
484}
485
John Kessenich55e7d112015-11-15 21:33:39 -0700486const int ImageChannelDataTypeCeiling = 17;
John Kessenich5e4b1242015-08-06 22:53:06 -0600487
488const char* ImageChannelDataTypeString(int type)
489{
490 switch (type)
491 {
492 case 0: return "SnormInt8";
493 case 1: return "SnormInt16";
494 case 2: return "UnormInt8";
495 case 3: return "UnormInt16";
496 case 4: return "UnormShort565";
497 case 5: return "UnormShort555";
498 case 6: return "UnormInt101010";
499 case 7: return "SignedInt8";
500 case 8: return "SignedInt16";
501 case 9: return "SignedInt32";
502 case 10: return "UnsignedInt8";
503 case 11: return "UnsignedInt16";
504 case 12: return "UnsignedInt32";
505 case 13: return "HalfFloat";
506 case 14: return "Float";
507 case 15: return "UnormInt24";
John Kessenich55e7d112015-11-15 21:33:39 -0700508 case 16: return "UnormInt101010_2";
John Kessenich5e4b1242015-08-06 22:53:06 -0600509
510 case ImageChannelDataTypeCeiling:
511 default:
512 return "Bad";
513 }
514}
515
John Kessenich55e7d112015-11-15 21:33:39 -0700516const int ImageOperandsCeiling = 8;
John Kessenich5e4b1242015-08-06 22:53:06 -0600517
518const char* ImageOperandsString(int format)
519{
520 switch (format) {
521 case 0: return "Bias";
522 case 1: return "Lod";
523 case 2: return "Grad";
524 case 3: return "ConstOffset";
525 case 4: return "Offset";
526 case 5: return "ConstOffsets";
527 case 6: return "Sample";
John Kessenich55e7d112015-11-15 21:33:39 -0700528 case 7: return "MinLod";
John Kessenich5e4b1242015-08-06 22:53:06 -0600529
530 case ImageOperandsCeiling:
531 default:
532 return "Bad";
533 }
534}
535
John Kessenich140f3df2015-06-26 16:58:36 -0600536const int FPFastMathCeiling = 5;
537
538const char* FPFastMathString(int mode)
539{
540 switch (mode) {
541 case 0: return "NotNaN";
542 case 1: return "NotInf";
543 case 2: return "NSZ";
544 case 3: return "AllowRecip";
545 case 4: return "Fast";
546
547 case FPFastMathCeiling:
548 default: return "Bad";
549 }
550}
551
552const int FPRoundingModeCeiling = 4;
553
554const char* FPRoundingModeString(int mode)
555{
556 switch (mode) {
557 case 0: return "RTE";
558 case 1: return "RTZ";
559 case 2: return "RTP";
560 case 3: return "RTN";
561
562 case FPRoundingModeCeiling:
563 default: return "Bad";
564 }
565}
566
567const int LinkageTypeCeiling = 2;
568
569const char* LinkageTypeString(int type)
570{
571 switch (type) {
572 case 0: return "Export";
573 case 1: return "Import";
574
575 case LinkageTypeCeiling:
576 default: return "Bad";
577 }
578}
579
John Kessenich5e4b1242015-08-06 22:53:06 -0600580const int FuncParamAttrCeiling = 8;
John Kessenich140f3df2015-06-26 16:58:36 -0600581
582const char* FuncParamAttrString(int attr)
583{
584 switch (attr) {
585 case 0: return "Zext";
586 case 1: return "Sext";
587 case 2: return "ByVal";
588 case 3: return "Sret";
589 case 4: return "NoAlias";
590 case 5: return "NoCapture";
John Kessenich5e4b1242015-08-06 22:53:06 -0600591 case 6: return "NoWrite";
592 case 7: return "NoReadWrite";
John Kessenich140f3df2015-06-26 16:58:36 -0600593
594 case FuncParamAttrCeiling:
595 default: return "Bad";
596 }
597}
598
599const int AccessQualifierCeiling = 3;
600
601const char* AccessQualifierString(int attr)
602{
603 switch (attr) {
604 case 0: return "ReadOnly";
605 case 1: return "WriteOnly";
606 case 2: return "ReadWrite";
607
608 case AccessQualifierCeiling:
609 default: return "Bad";
610 }
611}
612
613const int SelectControlCeiling = 2;
614
615const char* SelectControlString(int cont)
616{
617 switch (cont) {
618 case 0: return "Flatten";
619 case 1: return "DontFlatten";
620
621 case SelectControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600622 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600623 }
624}
625
626const int LoopControlCeiling = 2;
627
628const char* LoopControlString(int cont)
629{
630 switch (cont) {
John Kessenich5e4b1242015-08-06 22:53:06 -0600631 case 0: return "Unroll";
632 case 1: return "DontUnroll";
John Kessenich140f3df2015-06-26 16:58:36 -0600633
634 case LoopControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600635 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600636 }
637}
638
639const int FunctionControlCeiling = 4;
640
641const char* FunctionControlString(int cont)
642{
643 switch (cont) {
644 case 0: return "Inline";
645 case 1: return "DontInline";
646 case 2: return "Pure";
647 case 3: return "Const";
648
649 case FunctionControlCeiling:
650 default: return "Bad";
651 }
652}
653
John Kessenich55e7d112015-11-15 21:33:39 -0700654const int MemorySemanticsCeiling = 12;
John Kessenich140f3df2015-06-26 16:58:36 -0600655
656const char* MemorySemanticsString(int mem)
657{
John Kessenich55e7d112015-11-15 21:33:39 -0700658 // Note: No bits set (None) means "Relaxed"
John Kessenich140f3df2015-06-26 16:58:36 -0600659 switch (mem) {
John Kessenich55e7d112015-11-15 21:33:39 -0700660 case 0: return "Bad"; // Note: this is a placeholder for 'Consume'
661 case 1: return "Acquire";
662 case 2: return "Release";
663 case 3: return "AcquireRelease";
664 case 4: return "SequentiallyConsistent";
665 case 5: return "Bad"; // Note: reserved for future expansion
666 case 6: return "UniformMemory";
667 case 7: return "SubgroupMemory";
668 case 8: return "WorkgroupMemory";
669 case 9: return "CrossWorkgroupMemory";
670 case 10: return "AtomicCounterMemory";
671 case 11: return "ImageMemory";
John Kessenich140f3df2015-06-26 16:58:36 -0600672
673 case MemorySemanticsCeiling:
674 default: return "Bad";
675 }
676}
677
John Kessenich55e7d112015-11-15 21:33:39 -0700678const int MemoryAccessCeiling = 3;
John Kessenich140f3df2015-06-26 16:58:36 -0600679
680const char* MemoryAccessString(int mem)
681{
682 switch (mem) {
683 case 0: return "Volatile";
684 case 1: return "Aligned";
John Kessenich55e7d112015-11-15 21:33:39 -0700685 case 2: return "Nontemporal";
John Kessenich140f3df2015-06-26 16:58:36 -0600686
687 case MemoryAccessCeiling:
688 default: return "Bad";
689 }
690}
691
John Kessenich5e4b1242015-08-06 22:53:06 -0600692const int ScopeCeiling = 5;
John Kessenich140f3df2015-06-26 16:58:36 -0600693
John Kessenich5e4b1242015-08-06 22:53:06 -0600694const char* ScopeString(int mem)
John Kessenich140f3df2015-06-26 16:58:36 -0600695{
696 switch (mem) {
697 case 0: return "CrossDevice";
698 case 1: return "Device";
699 case 2: return "Workgroup";
700 case 3: return "Subgroup";
John Kessenich5e4b1242015-08-06 22:53:06 -0600701 case 4: return "Invocation";
John Kessenich140f3df2015-06-26 16:58:36 -0600702
John Kessenich5e4b1242015-08-06 22:53:06 -0600703 case ScopeCeiling:
John Kessenich140f3df2015-06-26 16:58:36 -0600704 default: return "Bad";
705 }
706}
707
708const int GroupOperationCeiling = 3;
709
710const char* GroupOperationString(int gop)
711{
712
713 switch (gop)
714 {
715 case 0: return "Reduce";
716 case 1: return "InclusiveScan";
717 case 2: return "ExclusiveScan";
718
719 case GroupOperationCeiling:
720 default: return "Bad";
721 }
722}
723
724const int KernelEnqueueFlagsCeiling = 3;
725
726const char* KernelEnqueueFlagsString(int flag)
727{
728 switch (flag)
729 {
730 case 0: return "NoWait";
731 case 1: return "WaitKernel";
732 case 2: return "WaitWorkGroup";
733
734 case KernelEnqueueFlagsCeiling:
735 default: return "Bad";
736 }
737}
738
739const int KernelProfilingInfoCeiling = 1;
740
741const char* KernelProfilingInfoString(int info)
742{
743 switch (info)
744 {
745 case 0: return "CmdExecTime";
746
747 case KernelProfilingInfoCeiling:
748 default: return "Bad";
749 }
750}
751
John Kessenich6c292d32016-02-15 20:58:50 -0700752const int CapabilityCeiling = 58;
John Kessenich5e4b1242015-08-06 22:53:06 -0600753
754const char* CapabilityString(int info)
755{
756 switch (info)
757 {
758 case 0: return "Matrix";
759 case 1: return "Shader";
760 case 2: return "Geometry";
761 case 3: return "Tessellation";
762 case 4: return "Addresses";
763 case 5: return "Linkage";
764 case 6: return "Kernel";
765 case 7: return "Vector16";
766 case 8: return "Float16Buffer";
767 case 9: return "Float16";
768 case 10: return "Float64";
769 case 11: return "Int64";
770 case 12: return "Int64Atomics";
771 case 13: return "ImageBasic";
772 case 14: return "ImageReadWrite";
773 case 15: return "ImageMipmap";
John Kessenich55e7d112015-11-15 21:33:39 -0700774 case 16: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600775 case 17: return "Pipes";
776 case 18: return "Groups";
777 case 19: return "DeviceEnqueue";
778 case 20: return "LiteralSampler";
779 case 21: return "AtomicStorage";
780 case 22: return "Int16";
781 case 23: return "TessellationPointSize";
782 case 24: return "GeometryPointSize";
783 case 25: return "ImageGatherExtended";
John Kessenich55e7d112015-11-15 21:33:39 -0700784 case 26: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600785 case 27: return "StorageImageMultisample";
786 case 28: return "UniformBufferArrayDynamicIndexing";
787 case 29: return "SampledImageArrayDynamicIndexing";
788 case 30: return "StorageBufferArrayDynamicIndexing";
789 case 31: return "StorageImageArrayDynamicIndexing";
790 case 32: return "ClipDistance";
791 case 33: return "CullDistance";
792 case 34: return "ImageCubeArray";
793 case 35: return "SampleRateShading";
John Kessenich55e7d112015-11-15 21:33:39 -0700794 case 36: return "ImageRect";
795 case 37: return "SampledRect";
796 case 38: return "GenericPointer";
797 case 39: return "Int8";
798 case 40: return "InputAttachment";
799 case 41: return "SparseResidency";
800 case 42: return "MinLod";
801 case 43: return "Sampled1D";
802 case 44: return "Image1D";
803 case 45: return "SampledCubeArray";
804 case 46: return "SampledBuffer";
805 case 47: return "ImageBuffer";
806 case 48: return "ImageMSArray";
807 case 49: return "StorageImageExtendedFormats";
808 case 50: return "ImageQuery";
809 case 51: return "DerivativeControl";
810 case 52: return "InterpolationFunction";
811 case 53: return "TransformFeedback";
812 case 54: return "GeometryStreams";
813 case 55: return "StorageImageReadWithoutFormat";
814 case 56: return "StorageImageWriteWithoutFormat";
John Kessenich6c292d32016-02-15 20:58:50 -0700815 case 57: return "MultiViewport";
John Kessenich5e4b1242015-08-06 22:53:06 -0600816
817 case CapabilityCeiling:
818 default: return "Bad";
Rex Xu51596642016-09-21 18:56:12 +0800819
820 case 4423: return "SubgroupBallotKHR";
Rex Xuf3b27472016-07-22 18:15:31 +0800821 case 4427: return "DrawParameters";
chaoc6e5acae2016-12-20 13:28:52 -0800822
823#ifdef NV_EXTENSIONS
824 case 5251: return "GeometryShaderPassthroughNV";
825#endif
826
John Kessenich5e4b1242015-08-06 22:53:06 -0600827 }
828}
829
John Kessenich140f3df2015-06-26 16:58:36 -0600830const char* OpcodeString(int op)
831{
832 switch (op) {
833 case 0: return "OpNop";
John Kessenich5e4b1242015-08-06 22:53:06 -0600834 case 1: return "OpUndef";
John Kessenich55e7d112015-11-15 21:33:39 -0700835 case 2: return "OpSourceContinued";
John Kessenich5e4b1242015-08-06 22:53:06 -0600836 case 3: return "OpSource";
837 case 4: return "OpSourceExtension";
838 case 5: return "OpName";
839 case 6: return "OpMemberName";
840 case 7: return "OpString";
841 case 8: return "OpLine";
842 case 9: return "Bad";
843 case 10: return "OpExtension";
844 case 11: return "OpExtInstImport";
845 case 12: return "OpExtInst";
846 case 13: return "Bad";
847 case 14: return "OpMemoryModel";
848 case 15: return "OpEntryPoint";
849 case 16: return "OpExecutionMode";
850 case 17: return "OpCapability";
851 case 18: return "Bad";
852 case 19: return "OpTypeVoid";
853 case 20: return "OpTypeBool";
854 case 21: return "OpTypeInt";
855 case 22: return "OpTypeFloat";
856 case 23: return "OpTypeVector";
857 case 24: return "OpTypeMatrix";
858 case 25: return "OpTypeImage";
859 case 26: return "OpTypeSampler";
860 case 27: return "OpTypeSampledImage";
861 case 28: return "OpTypeArray";
862 case 29: return "OpTypeRuntimeArray";
863 case 30: return "OpTypeStruct";
864 case 31: return "OpTypeOpaque";
865 case 32: return "OpTypePointer";
866 case 33: return "OpTypeFunction";
867 case 34: return "OpTypeEvent";
868 case 35: return "OpTypeDeviceEvent";
869 case 36: return "OpTypeReserveId";
870 case 37: return "OpTypeQueue";
871 case 38: return "OpTypePipe";
John Kessenich55e7d112015-11-15 21:33:39 -0700872 case 39: return "OpTypeForwardPointer";
John Kessenich5e4b1242015-08-06 22:53:06 -0600873 case 40: return "Bad";
874 case 41: return "OpConstantTrue";
875 case 42: return "OpConstantFalse";
876 case 43: return "OpConstant";
877 case 44: return "OpConstantComposite";
878 case 45: return "OpConstantSampler";
879 case 46: return "OpConstantNull";
880 case 47: return "Bad";
881 case 48: return "OpSpecConstantTrue";
882 case 49: return "OpSpecConstantFalse";
883 case 50: return "OpSpecConstant";
884 case 51: return "OpSpecConstantComposite";
885 case 52: return "OpSpecConstantOp";
886 case 53: return "Bad";
887 case 54: return "OpFunction";
888 case 55: return "OpFunctionParameter";
889 case 56: return "OpFunctionEnd";
890 case 57: return "OpFunctionCall";
891 case 58: return "Bad";
892 case 59: return "OpVariable";
893 case 60: return "OpImageTexelPointer";
894 case 61: return "OpLoad";
895 case 62: return "OpStore";
896 case 63: return "OpCopyMemory";
897 case 64: return "OpCopyMemorySized";
898 case 65: return "OpAccessChain";
899 case 66: return "OpInBoundsAccessChain";
900 case 67: return "OpPtrAccessChain";
901 case 68: return "OpArrayLength";
902 case 69: return "OpGenericPtrMemSemantics";
John Kessenich55e7d112015-11-15 21:33:39 -0700903 case 70: return "OpInBoundsPtrAccessChain";
John Kessenich5e4b1242015-08-06 22:53:06 -0600904 case 71: return "OpDecorate";
905 case 72: return "OpMemberDecorate";
906 case 73: return "OpDecorationGroup";
907 case 74: return "OpGroupDecorate";
908 case 75: return "OpGroupMemberDecorate";
909 case 76: return "Bad";
910 case 77: return "OpVectorExtractDynamic";
911 case 78: return "OpVectorInsertDynamic";
912 case 79: return "OpVectorShuffle";
913 case 80: return "OpCompositeConstruct";
914 case 81: return "OpCompositeExtract";
915 case 82: return "OpCompositeInsert";
916 case 83: return "OpCopyObject";
917 case 84: return "OpTranspose";
918 case 85: return "Bad";
919 case 86: return "OpSampledImage";
920 case 87: return "OpImageSampleImplicitLod";
921 case 88: return "OpImageSampleExplicitLod";
922 case 89: return "OpImageSampleDrefImplicitLod";
923 case 90: return "OpImageSampleDrefExplicitLod";
924 case 91: return "OpImageSampleProjImplicitLod";
925 case 92: return "OpImageSampleProjExplicitLod";
926 case 93: return "OpImageSampleProjDrefImplicitLod";
927 case 94: return "OpImageSampleProjDrefExplicitLod";
928 case 95: return "OpImageFetch";
929 case 96: return "OpImageGather";
930 case 97: return "OpImageDrefGather";
931 case 98: return "OpImageRead";
932 case 99: return "OpImageWrite";
John Kessenich55e7d112015-11-15 21:33:39 -0700933 case 100: return "OpImage";
John Kessenich5e4b1242015-08-06 22:53:06 -0600934 case 101: return "OpImageQueryFormat";
935 case 102: return "OpImageQueryOrder";
936 case 103: return "OpImageQuerySizeLod";
937 case 104: return "OpImageQuerySize";
938 case 105: return "OpImageQueryLod";
939 case 106: return "OpImageQueryLevels";
940 case 107: return "OpImageQuerySamples";
941 case 108: return "Bad";
942 case 109: return "OpConvertFToU";
943 case 110: return "OpConvertFToS";
944 case 111: return "OpConvertSToF";
945 case 112: return "OpConvertUToF";
946 case 113: return "OpUConvert";
947 case 114: return "OpSConvert";
948 case 115: return "OpFConvert";
949 case 116: return "OpQuantizeToF16";
950 case 117: return "OpConvertPtrToU";
951 case 118: return "OpSatConvertSToU";
952 case 119: return "OpSatConvertUToS";
953 case 120: return "OpConvertUToPtr";
954 case 121: return "OpPtrCastToGeneric";
955 case 122: return "OpGenericCastToPtr";
956 case 123: return "OpGenericCastToPtrExplicit";
957 case 124: return "OpBitcast";
958 case 125: return "Bad";
959 case 126: return "OpSNegate";
960 case 127: return "OpFNegate";
961 case 128: return "OpIAdd";
962 case 129: return "OpFAdd";
963 case 130: return "OpISub";
964 case 131: return "OpFSub";
965 case 132: return "OpIMul";
966 case 133: return "OpFMul";
967 case 134: return "OpUDiv";
968 case 135: return "OpSDiv";
969 case 136: return "OpFDiv";
970 case 137: return "OpUMod";
971 case 138: return "OpSRem";
972 case 139: return "OpSMod";
973 case 140: return "OpFRem";
974 case 141: return "OpFMod";
975 case 142: return "OpVectorTimesScalar";
976 case 143: return "OpMatrixTimesScalar";
977 case 144: return "OpVectorTimesMatrix";
978 case 145: return "OpMatrixTimesVector";
979 case 146: return "OpMatrixTimesMatrix";
980 case 147: return "OpOuterProduct";
981 case 148: return "OpDot";
982 case 149: return "OpIAddCarry";
983 case 150: return "OpISubBorrow";
John Kessenich55e7d112015-11-15 21:33:39 -0700984 case 151: return "OpUMulExtended";
985 case 152: return "OpSMulExtended";
John Kessenich5e4b1242015-08-06 22:53:06 -0600986 case 153: return "Bad";
987 case 154: return "OpAny";
988 case 155: return "OpAll";
989 case 156: return "OpIsNan";
990 case 157: return "OpIsInf";
991 case 158: return "OpIsFinite";
992 case 159: return "OpIsNormal";
993 case 160: return "OpSignBitSet";
994 case 161: return "OpLessOrGreater";
995 case 162: return "OpOrdered";
996 case 163: return "OpUnordered";
997 case 164: return "OpLogicalEqual";
998 case 165: return "OpLogicalNotEqual";
999 case 166: return "OpLogicalOr";
1000 case 167: return "OpLogicalAnd";
1001 case 168: return "OpLogicalNot";
1002 case 169: return "OpSelect";
1003 case 170: return "OpIEqual";
1004 case 171: return "OpINotEqual";
1005 case 172: return "OpUGreaterThan";
1006 case 173: return "OpSGreaterThan";
1007 case 174: return "OpUGreaterThanEqual";
1008 case 175: return "OpSGreaterThanEqual";
1009 case 176: return "OpULessThan";
1010 case 177: return "OpSLessThan";
1011 case 178: return "OpULessThanEqual";
1012 case 179: return "OpSLessThanEqual";
1013 case 180: return "OpFOrdEqual";
1014 case 181: return "OpFUnordEqual";
1015 case 182: return "OpFOrdNotEqual";
1016 case 183: return "OpFUnordNotEqual";
1017 case 184: return "OpFOrdLessThan";
1018 case 185: return "OpFUnordLessThan";
1019 case 186: return "OpFOrdGreaterThan";
1020 case 187: return "OpFUnordGreaterThan";
1021 case 188: return "OpFOrdLessThanEqual";
1022 case 189: return "OpFUnordLessThanEqual";
1023 case 190: return "OpFOrdGreaterThanEqual";
1024 case 191: return "OpFUnordGreaterThanEqual";
1025 case 192: return "Bad";
1026 case 193: return "Bad";
1027 case 194: return "OpShiftRightLogical";
1028 case 195: return "OpShiftRightArithmetic";
1029 case 196: return "OpShiftLeftLogical";
1030 case 197: return "OpBitwiseOr";
1031 case 198: return "OpBitwiseXor";
1032 case 199: return "OpBitwiseAnd";
1033 case 200: return "OpNot";
1034 case 201: return "OpBitFieldInsert";
1035 case 202: return "OpBitFieldSExtract";
1036 case 203: return "OpBitFieldUExtract";
1037 case 204: return "OpBitReverse";
1038 case 205: return "OpBitCount";
1039 case 206: return "Bad";
1040 case 207: return "OpDPdx";
1041 case 208: return "OpDPdy";
1042 case 209: return "OpFwidth";
1043 case 210: return "OpDPdxFine";
1044 case 211: return "OpDPdyFine";
1045 case 212: return "OpFwidthFine";
1046 case 213: return "OpDPdxCoarse";
1047 case 214: return "OpDPdyCoarse";
1048 case 215: return "OpFwidthCoarse";
1049 case 216: return "Bad";
1050 case 217: return "Bad";
1051 case 218: return "OpEmitVertex";
1052 case 219: return "OpEndPrimitive";
1053 case 220: return "OpEmitStreamVertex";
1054 case 221: return "OpEndStreamPrimitive";
1055 case 222: return "Bad";
1056 case 223: return "Bad";
1057 case 224: return "OpControlBarrier";
1058 case 225: return "OpMemoryBarrier";
1059 case 226: return "Bad";
1060 case 227: return "OpAtomicLoad";
1061 case 228: return "OpAtomicStore";
1062 case 229: return "OpAtomicExchange";
1063 case 230: return "OpAtomicCompareExchange";
1064 case 231: return "OpAtomicCompareExchangeWeak";
1065 case 232: return "OpAtomicIIncrement";
1066 case 233: return "OpAtomicIDecrement";
1067 case 234: return "OpAtomicIAdd";
1068 case 235: return "OpAtomicISub";
1069 case 236: return "OpAtomicSMin";
1070 case 237: return "OpAtomicUMin";
1071 case 238: return "OpAtomicSMax";
1072 case 239: return "OpAtomicUMax";
1073 case 240: return "OpAtomicAnd";
1074 case 241: return "OpAtomicOr";
1075 case 242: return "OpAtomicXor";
1076 case 243: return "Bad";
1077 case 244: return "Bad";
1078 case 245: return "OpPhi";
1079 case 246: return "OpLoopMerge";
1080 case 247: return "OpSelectionMerge";
1081 case 248: return "OpLabel";
1082 case 249: return "OpBranch";
1083 case 250: return "OpBranchConditional";
1084 case 251: return "OpSwitch";
1085 case 252: return "OpKill";
1086 case 253: return "OpReturn";
1087 case 254: return "OpReturnValue";
1088 case 255: return "OpUnreachable";
1089 case 256: return "OpLifetimeStart";
1090 case 257: return "OpLifetimeStop";
1091 case 258: return "Bad";
John Kessenich55e7d112015-11-15 21:33:39 -07001092 case 259: return "OpGroupAsyncCopy";
1093 case 260: return "OpGroupWaitEvents";
John Kessenich5e4b1242015-08-06 22:53:06 -06001094 case 261: return "OpGroupAll";
1095 case 262: return "OpGroupAny";
1096 case 263: return "OpGroupBroadcast";
1097 case 264: return "OpGroupIAdd";
1098 case 265: return "OpGroupFAdd";
1099 case 266: return "OpGroupFMin";
1100 case 267: return "OpGroupUMin";
1101 case 268: return "OpGroupSMin";
1102 case 269: return "OpGroupFMax";
1103 case 270: return "OpGroupUMax";
1104 case 271: return "OpGroupSMax";
1105 case 272: return "Bad";
1106 case 273: return "Bad";
1107 case 274: return "OpReadPipe";
1108 case 275: return "OpWritePipe";
1109 case 276: return "OpReservedReadPipe";
1110 case 277: return "OpReservedWritePipe";
1111 case 278: return "OpReserveReadPipePackets";
1112 case 279: return "OpReserveWritePipePackets";
1113 case 280: return "OpCommitReadPipe";
1114 case 281: return "OpCommitWritePipe";
1115 case 282: return "OpIsValidReserveId";
1116 case 283: return "OpGetNumPipePackets";
1117 case 284: return "OpGetMaxPipePackets";
1118 case 285: return "OpGroupReserveReadPipePackets";
1119 case 286: return "OpGroupReserveWritePipePackets";
1120 case 287: return "OpGroupCommitReadPipe";
1121 case 288: return "OpGroupCommitWritePipe";
1122 case 289: return "Bad";
1123 case 290: return "Bad";
1124 case 291: return "OpEnqueueMarker";
1125 case 292: return "OpEnqueueKernel";
1126 case 293: return "OpGetKernelNDrangeSubGroupCount";
1127 case 294: return "OpGetKernelNDrangeMaxSubGroupSize";
1128 case 295: return "OpGetKernelWorkGroupSize";
1129 case 296: return "OpGetKernelPreferredWorkGroupSizeMultiple";
1130 case 297: return "OpRetainEvent";
1131 case 298: return "OpReleaseEvent";
1132 case 299: return "OpCreateUserEvent";
1133 case 300: return "OpIsValidEvent";
1134 case 301: return "OpSetUserEventStatus";
1135 case 302: return "OpCaptureEventProfilingInfo";
1136 case 303: return "OpGetDefaultQueue";
1137 case 304: return "OpBuildNDRange";
John Kessenich55e7d112015-11-15 21:33:39 -07001138 case 305: return "OpImageSparseSampleImplicitLod";
1139 case 306: return "OpImageSparseSampleExplicitLod";
1140 case 307: return "OpImageSparseSampleDrefImplicitLod";
1141 case 308: return "OpImageSparseSampleDrefExplicitLod";
1142 case 309: return "OpImageSparseSampleProjImplicitLod";
1143 case 310: return "OpImageSparseSampleProjExplicitLod";
1144 case 311: return "OpImageSparseSampleProjDrefImplicitLod";
1145 case 312: return "OpImageSparseSampleProjDrefExplicitLod";
1146 case 313: return "OpImageSparseFetch";
1147 case 314: return "OpImageSparseGather";
1148 case 315: return "OpImageSparseDrefGather";
1149 case 316: return "OpImageSparseTexelsResident";
1150 case 317: return "OpNoLine";
1151 case 318: return "OpAtomicFlagTestAndSet";
1152 case 319: return "OpAtomicFlagClear";
John Kessenich6c292d32016-02-15 20:58:50 -07001153 case 320: return "OpImageSparseRead";
John Kessenich140f3df2015-06-26 16:58:36 -06001154
1155 case OpcodeCeiling:
1156 default:
1157 return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +08001158
Rex Xu51596642016-09-21 18:56:12 +08001159 case 4421: return "OpSubgroupBallotKHR";
1160 case 4422: return "OpSubgroupFirstInvocationKHR";
chaocf200da82016-12-20 12:44:35 -08001161 case 4432: return "OpSubgroupReadInvocationKHR";
Rex Xu51596642016-09-21 18:56:12 +08001162
Rex Xu9d93a232016-05-05 12:30:44 +08001163#ifdef AMD_EXTENSIONS
1164 case 5000: return "OpGroupIAddNonUniformAMD";
1165 case 5001: return "OpGroupFAddNonUniformAMD";
1166 case 5002: return "OpGroupFMinNonUniformAMD";
1167 case 5003: return "OpGroupUMinNonUniformAMD";
1168 case 5004: return "OpGroupSMinNonUniformAMD";
1169 case 5005: return "OpGroupFMaxNonUniformAMD";
1170 case 5006: return "OpGroupUMaxNonUniformAMD";
1171 case 5007: return "OpGroupSMaxNonUniformAMD";
1172#endif
John Kessenich140f3df2015-06-26 16:58:36 -06001173 }
1174}
1175
1176// The set of objects that hold all the instruction/operand
1177// parameterization information.
Rex Xu9d93a232016-05-05 12:30:44 +08001178InstructionParameters InstructionDesc[OpCodeMask + 1];
John Kessenich140f3df2015-06-26 16:58:36 -06001179OperandParameters ExecutionModeOperands[ExecutionModeCeiling];
1180OperandParameters DecorationOperands[DecorationCeiling];
1181
1182EnumDefinition OperandClassParams[OperandCount];
1183EnumParameters ExecutionModelParams[ExecutionModelCeiling];
1184EnumParameters AddressingParams[AddressingModelCeiling];
1185EnumParameters MemoryParams[MemoryModelCeiling];
1186EnumParameters ExecutionModeParams[ExecutionModeCeiling];
1187EnumParameters StorageParams[StorageClassCeiling];
1188EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling];
1189EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001190EnumParameters ImageFormatParams[ImageFormatCeiling];
1191EnumParameters ImageChannelOrderParams[ImageChannelOrderCeiling];
1192EnumParameters ImageChannelDataTypeParams[ImageChannelDataTypeCeiling];
1193EnumParameters ImageOperandsParams[ImageOperandsCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001194EnumParameters FPFastMathParams[FPFastMathCeiling];
1195EnumParameters FPRoundingModeParams[FPRoundingModeCeiling];
1196EnumParameters LinkageTypeParams[LinkageTypeCeiling];
1197EnumParameters DecorationParams[DecorationCeiling];
1198EnumParameters BuiltInParams[BuiltInCeiling];
1199EnumParameters DimensionalityParams[DimensionCeiling];
1200EnumParameters FuncParamAttrParams[FuncParamAttrCeiling];
1201EnumParameters AccessQualifierParams[AccessQualifierCeiling];
1202EnumParameters GroupOperationParams[GroupOperationCeiling];
1203EnumParameters LoopControlParams[FunctionControlCeiling];
1204EnumParameters SelectionControlParams[SelectControlCeiling];
1205EnumParameters FunctionControlParams[FunctionControlCeiling];
1206EnumParameters MemorySemanticsParams[MemorySemanticsCeiling];
1207EnumParameters MemoryAccessParams[MemoryAccessCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001208EnumParameters ScopeParams[ScopeCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001209EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling];
1210EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001211EnumParameters CapabilityParams[CapabilityCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001212
1213// Set up all the parameterizing descriptions of the opcodes, operands, etc.
1214void Parameterize()
1215{
John Kessenich140f3df2015-06-26 16:58:36 -06001216 // only do this once.
John Kessenich5e4b1242015-08-06 22:53:06 -06001217 static bool initialized = false;
John Kessenich140f3df2015-06-26 16:58:36 -06001218 if (initialized)
1219 return;
John Kessenich140f3df2015-06-26 16:58:36 -06001220 initialized = true;
1221
1222 // Exceptions to having a result <id> and a resulting type <id>.
1223 // (Everything is initialized to have both).
1224
1225 InstructionDesc[OpNop].setResultAndType(false, false);
1226 InstructionDesc[OpSource].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001227 InstructionDesc[OpSourceContinued].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001228 InstructionDesc[OpSourceExtension].setResultAndType(false, false);
1229 InstructionDesc[OpExtension].setResultAndType(false, false);
1230 InstructionDesc[OpExtInstImport].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001231 InstructionDesc[OpCapability].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001232 InstructionDesc[OpMemoryModel].setResultAndType(false, false);
1233 InstructionDesc[OpEntryPoint].setResultAndType(false, false);
1234 InstructionDesc[OpExecutionMode].setResultAndType(false, false);
1235 InstructionDesc[OpTypeVoid].setResultAndType(true, false);
1236 InstructionDesc[OpTypeBool].setResultAndType(true, false);
1237 InstructionDesc[OpTypeInt].setResultAndType(true, false);
1238 InstructionDesc[OpTypeFloat].setResultAndType(true, false);
1239 InstructionDesc[OpTypeVector].setResultAndType(true, false);
1240 InstructionDesc[OpTypeMatrix].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001241 InstructionDesc[OpTypeImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001242 InstructionDesc[OpTypeSampler].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001243 InstructionDesc[OpTypeSampledImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001244 InstructionDesc[OpTypeArray].setResultAndType(true, false);
1245 InstructionDesc[OpTypeRuntimeArray].setResultAndType(true, false);
1246 InstructionDesc[OpTypeStruct].setResultAndType(true, false);
1247 InstructionDesc[OpTypeOpaque].setResultAndType(true, false);
1248 InstructionDesc[OpTypePointer].setResultAndType(true, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001249 InstructionDesc[OpTypeForwardPointer].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001250 InstructionDesc[OpTypeFunction].setResultAndType(true, false);
1251 InstructionDesc[OpTypeEvent].setResultAndType(true, false);
1252 InstructionDesc[OpTypeDeviceEvent].setResultAndType(true, false);
1253 InstructionDesc[OpTypeReserveId].setResultAndType(true, false);
1254 InstructionDesc[OpTypeQueue].setResultAndType(true, false);
1255 InstructionDesc[OpTypePipe].setResultAndType(true, false);
1256 InstructionDesc[OpFunctionEnd].setResultAndType(false, false);
1257 InstructionDesc[OpStore].setResultAndType(false, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001258 InstructionDesc[OpImageWrite].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001259 InstructionDesc[OpDecorationGroup].setResultAndType(true, false);
1260 InstructionDesc[OpDecorate].setResultAndType(false, false);
1261 InstructionDesc[OpMemberDecorate].setResultAndType(false, false);
1262 InstructionDesc[OpGroupDecorate].setResultAndType(false, false);
1263 InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false);
1264 InstructionDesc[OpName].setResultAndType(false, false);
1265 InstructionDesc[OpMemberName].setResultAndType(false, false);
1266 InstructionDesc[OpString].setResultAndType(true, false);
1267 InstructionDesc[OpLine].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001268 InstructionDesc[OpNoLine].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001269 InstructionDesc[OpCopyMemory].setResultAndType(false, false);
1270 InstructionDesc[OpCopyMemorySized].setResultAndType(false, false);
1271 InstructionDesc[OpEmitVertex].setResultAndType(false, false);
1272 InstructionDesc[OpEndPrimitive].setResultAndType(false, false);
1273 InstructionDesc[OpEmitStreamVertex].setResultAndType(false, false);
1274 InstructionDesc[OpEndStreamPrimitive].setResultAndType(false, false);
1275 InstructionDesc[OpControlBarrier].setResultAndType(false, false);
1276 InstructionDesc[OpMemoryBarrier].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001277 InstructionDesc[OpAtomicStore].setResultAndType(false, false);
1278 InstructionDesc[OpLoopMerge].setResultAndType(false, false);
1279 InstructionDesc[OpSelectionMerge].setResultAndType(false, false);
1280 InstructionDesc[OpLabel].setResultAndType(true, false);
1281 InstructionDesc[OpBranch].setResultAndType(false, false);
1282 InstructionDesc[OpBranchConditional].setResultAndType(false, false);
1283 InstructionDesc[OpSwitch].setResultAndType(false, false);
1284 InstructionDesc[OpKill].setResultAndType(false, false);
1285 InstructionDesc[OpReturn].setResultAndType(false, false);
1286 InstructionDesc[OpReturnValue].setResultAndType(false, false);
1287 InstructionDesc[OpUnreachable].setResultAndType(false, false);
1288 InstructionDesc[OpLifetimeStart].setResultAndType(false, false);
1289 InstructionDesc[OpLifetimeStop].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001290 InstructionDesc[OpCommitReadPipe].setResultAndType(false, false);
1291 InstructionDesc[OpCommitWritePipe].setResultAndType(false, false);
1292 InstructionDesc[OpGroupCommitWritePipe].setResultAndType(false, false);
1293 InstructionDesc[OpGroupCommitReadPipe].setResultAndType(false, false);
1294 InstructionDesc[OpCaptureEventProfilingInfo].setResultAndType(false, false);
1295 InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false);
1296 InstructionDesc[OpRetainEvent].setResultAndType(false, false);
1297 InstructionDesc[OpReleaseEvent].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001298 InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false);
1299 InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001300
1301 // Specific additional context-dependent operands
1302
John Kessenich55e7d112015-11-15 21:33:39 -07001303 ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "'Number of <<Invocation,invocations>>'");
John Kessenich140f3df2015-06-26 16:58:36 -06001304
1305 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'x size'");
1306 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'y size'");
1307 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'z size'");
1308
1309 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'x size'");
1310 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'y size'");
1311 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'z size'");
1312
John Kessenich5e4b1242015-08-06 22:53:06 -06001313 ExecutionModeOperands[ExecutionModeOutputVertices].push(OperandLiteralNumber, "'Vertex count'");
1314 ExecutionModeOperands[ExecutionModeVecTypeHint].push(OperandLiteralNumber, "'Vector type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001315
John Kessenich55e7d112015-11-15 21:33:39 -07001316 DecorationOperands[DecorationStream].push(OperandLiteralNumber, "'Stream Number'");
1317 DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "'Location'");
1318 DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "'Component'");
1319 DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "'Index'");
1320 DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "'Binding Point'");
1321 DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "'Descriptor Set'");
1322 DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "'Byte Offset'");
1323 DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "'XFB Buffer Number'");
1324 DecorationOperands[DecorationXfbStride].push(OperandLiteralNumber, "'XFB Stride'");
1325 DecorationOperands[DecorationArrayStride].push(OperandLiteralNumber, "'Array Stride'");
1326 DecorationOperands[DecorationMatrixStride].push(OperandLiteralNumber, "'Matrix Stride'");
John Kessenich140f3df2015-06-26 16:58:36 -06001327 DecorationOperands[DecorationBuiltIn].push(OperandLiteralNumber, "See <<BuiltIn,*BuiltIn*>>");
John Kessenich55e7d112015-11-15 21:33:39 -07001328 DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "'Floating-Point Rounding Mode'");
1329 DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "'Fast-Math Mode'");
1330 DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "'Name'");
1331 DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "'Linkage Type'");
1332 DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "'Function Parameter Attribute'");
1333 DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "'Specialization Constant ID'");
1334 DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'");
1335 DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06001336
1337 OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0);
1338 OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams);
1339 OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams);
1340 OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams);
1341 OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams);
1342 OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands);
1343 OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams);
1344 OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams);
1345 OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams);
1346 OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001347 OperandClassParams[OperandSamplerImageFormat].set(ImageFormatCeiling, ImageFormatString, ImageFormatParams);
1348 OperandClassParams[OperandImageChannelOrder].set(ImageChannelOrderCeiling, ImageChannelOrderString, ImageChannelOrderParams);
1349 OperandClassParams[OperandImageChannelDataType].set(ImageChannelDataTypeCeiling, ImageChannelDataTypeString, ImageChannelDataTypeParams);
1350 OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true);
John Kessenich140f3df2015-06-26 16:58:36 -06001351 OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true);
1352 OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams);
1353 OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams);
1354 OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams);
1355 OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams);
1356 OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams);
1357 OperandClassParams[OperandDecoration].setOperands(DecorationOperands);
1358 OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams);
1359 OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true);
1360 OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true);
1361 OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true);
1362 OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true);
1363 OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001364 OperandClassParams[OperandScope].set(ScopeCeiling, ScopeString, ScopeParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001365 OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams);
1366 OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams);
1367 OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001368 OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001369 OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0);
1370
John Kessenich55e7d112015-11-15 21:33:39 -07001371 CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix);
1372 CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader);
1373 CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader);
1374 CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel);
1375 CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001376 CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64);
1377 CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel);
1378 CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic);
1379 CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic);
1380 CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel);
1381 CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel);
1382 CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel);
1383 CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader);
1384 CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader);
1385 CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation);
1386 CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry);
1387 CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader);
1388 CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader);
1389 CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader);
1390 CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1391 CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1392 CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1393 CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1394 CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader);
1395 CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader);
1396 CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses);
1397 CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel);
1398 CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader);
1399 CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader);
1400 CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader);
1401 CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader);
1402 CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader);
1403 CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader);
1404 CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader);
1405 CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader);
1406 CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D);
1407 CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect);
1408 CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer);
1409 CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray);
1410 CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader);
1411 CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader);
1412 CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader);
1413 CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader);
1414 CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry);
1415 CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader);
1416 CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001417 CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001418
John Kessenich5e4b1242015-08-06 22:53:06 -06001419 AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses);
1420 AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001421
John Kessenich5e4b1242015-08-06 22:53:06 -06001422 MemoryParams[MemoryModelSimple].caps.push_back(CapabilityShader);
1423 MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader);
1424 MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001425
John Kessenich55e7d112015-11-15 21:33:39 -07001426 MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001427 MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001428
John Kessenich5e4b1242015-08-06 22:53:06 -06001429 ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader);
1430 ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation);
1431 ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation);
1432 ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapabilityGeometry);
1433 ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapabilityShader);
1434 ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapabilityShader);
1435 ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001436
1437 // Storage capabilites
John Kessenich5e4b1242015-08-06 22:53:06 -06001438 StorageParams[StorageClassInput].caps.push_back(CapabilityShader);
1439 StorageParams[StorageClassUniform].caps.push_back(CapabilityShader);
1440 StorageParams[StorageClassOutput].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001441 StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001442 StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel);
1443 StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001444 StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001445
1446 // Sampler Filter & Addressing mode capabilities
John Kessenich5e4b1242015-08-06 22:53:06 -06001447 SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel);
1448 SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapabilityKernel);
1449 SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapabilityKernel);
1450 SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapabilityKernel);
1451 SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001452
John Kessenich5e4b1242015-08-06 22:53:06 -06001453 SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapabilityKernel);
1454 SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel);
1455
1456 // image format capabilities
John Kessenich55e7d112015-11-15 21:33:39 -07001457
1458 // ES/Desktop float
1459 ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader);
1460 ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader);
1461 ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader);
1462 ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader);
1463 ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader);
1464
1465 // Desktop float
1466 ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats);
1467 ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1468 ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats);
1469 ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1470 ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats);
1471 ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats);
1472 ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats);
1473 ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats);
1474 ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats);
1475 ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats);
1476 ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1477 ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1478 ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1479 ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1480 ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1481
1482 // ES/Desktop int
1483 ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader);
1484 ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader);
1485 ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader);
1486 ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader);
1487
1488 // Desktop int
1489 ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats);
1490 ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1491 ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1492 ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1493 ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1494
1495 // ES/Desktop uint
1496 ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader);
1497 ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader);
1498 ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader);
1499 ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader);
1500
1501 // Desktop uint
1502 ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1503 ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1504 ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1505 ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1506 ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1507 ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
John Kessenich5e4b1242015-08-06 22:53:06 -06001508
1509 // image channel order capabilities
1510 for (int i = 0; i < ImageChannelOrderCeiling; ++i) {
1511 ImageChannelOrderParams[i].caps.push_back(CapabilityKernel);
1512 }
1513
1514 // image channel type capabilities
1515 for (int i = 0; i < ImageChannelDataTypeCeiling; ++i) {
1516 ImageChannelDataTypeParams[i].caps.push_back(CapabilityKernel);
1517 }
1518
1519 // image lookup operands
1520 ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader);
1521 ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended);
John Kessenich55e7d112015-11-15 21:33:39 -07001522 ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod);
John Kessenich140f3df2015-06-26 16:58:36 -06001523
1524 // fast math flags capabilities
1525 for (int i = 0; i < FPFastMathCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001526 FPFastMathParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001527 }
1528
1529 // fp rounding mode capabilities
1530 for (int i = 0; i < FPRoundingModeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001531 FPRoundingModeParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001532 }
1533
1534 // linkage types
1535 for (int i = 0; i < LinkageTypeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001536 LinkageTypeParams[i].caps.push_back(CapabilityLinkage);
John Kessenich140f3df2015-06-26 16:58:36 -06001537 }
1538
1539 // function argument types
1540 for (int i = 0; i < FuncParamAttrCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001541 FuncParamAttrParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001542 }
1543
1544 // function argument types
1545 for (int i = 0; i < AccessQualifierCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001546 AccessQualifierParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001547 }
1548
John Kessenich5e4b1242015-08-06 22:53:06 -06001549 ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapabilityGeometry);
1550 ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapabilityTessellation);
1551 ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapabilityTessellation);
1552 ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapabilityTessellation);
1553 ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapabilityTessellation);
1554 ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapabilityTessellation);
1555 ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapabilityShader);
1556 ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapabilityShader);
1557 ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader);
1558 ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader);
1559 ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation);
John Kessenich55e7d112015-11-15 21:33:39 -07001560 ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001561 ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001562 ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader);
1563 ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader);
1564 ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader);
1565 ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapabilityKernel);
1566 ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry);
1567 ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry);
1568 ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001569 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry);
1570 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001571 ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001572 ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation);
1573 ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001574 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry);
1575 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation);
1576 ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry);
1577 ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapabilityGeometry);
1578 ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapabilityGeometry);
1579 ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapabilityKernel);
1580 ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001581
John Kessenich5e4b1242015-08-06 22:53:06 -06001582 DecorationParams[DecorationRelaxedPrecision].caps.push_back(CapabilityShader);
1583 DecorationParams[DecorationBlock].caps.push_back(CapabilityShader);
1584 DecorationParams[DecorationBufferBlock].caps.push_back(CapabilityShader);
1585 DecorationParams[DecorationRowMajor].caps.push_back(CapabilityMatrix);
1586 DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix);
1587 DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader);
1588 DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001589 DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001590 DecorationParams[DecorationFlat].caps.push_back(CapabilityShader);
1591 DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation);
1592 DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001593 DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001594 DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader);
1595 DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel);
1596 DecorationParams[DecorationUniform].caps.push_back(CapabilityShader);
1597 DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel);
1598 DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001599 DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001600 DecorationParams[DecorationLocation].caps.push_back(CapabilityShader);
1601 DecorationParams[DecorationComponent].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001602 DecorationParams[DecorationOffset].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001603 DecorationParams[DecorationIndex].caps.push_back(CapabilityShader);
1604 DecorationParams[DecorationBinding].caps.push_back(CapabilityShader);
1605 DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001606 DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback);
1607 DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001608 DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001609 DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix);
John Kessenich5e4b1242015-08-06 22:53:06 -06001610 DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel);
1611 DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel);
1612 DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel);
1613 DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage);
1614 DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001615 DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader);
1616 DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment);
1617 DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001618
John Kessenich5e4b1242015-08-06 22:53:06 -06001619 BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader);
1620 BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001621 BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance);
1622 BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance);
John Kessenich55e7d112015-11-15 21:33:39 -07001623
John Kessenich5e4b1242015-08-06 22:53:06 -06001624 BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001625 BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . .";
1626
John Kessenich5e4b1242015-08-06 22:53:06 -06001627 BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001628 BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . .";
1629
1630 BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader);
1631 BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . .";
1632
1633 BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader);
1634 BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . .";
1635
John Kessenich5e4b1242015-08-06 22:53:06 -06001636 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry);
1637 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation);
1638 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry);
1639 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation);
1640 BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry);
John Kessenich6c292d32016-02-15 20:58:50 -07001641 BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport);
John Kessenich5e4b1242015-08-06 22:53:06 -06001642 BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation);
1643 BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation);
1644 BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation);
1645 BuiltInParams[BuiltInPatchVertices].caps.push_back(CapabilityTessellation);
1646 BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader);
1647 BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader);
1648 BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001649 BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading);
1650 BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading);
1651 BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001652 BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader);
1653 BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001654 BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel);
1655 BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel);
1656 BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel);
1657 BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel);
1658 BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001659
John Kessenich5e4b1242015-08-06 22:53:06 -06001660 BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel);
1661 BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel);
1662 BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapabilityKernel);
1663 BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapabilityKernel);
1664 BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel);
1665 BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001666
John Kessenich55e7d112015-11-15 21:33:39 -07001667 DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D);
John Kessenich5e4b1242015-08-06 22:53:06 -06001668 DimensionalityParams[DimCube].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001669 DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect);
1670 DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer);
1671 DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment);
John Kessenich140f3df2015-06-26 16:58:36 -06001672
1673 // Group Operations
1674 for (int i = 0; i < GroupOperationCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001675 GroupOperationParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001676 }
1677
1678 // Enqueue flags
1679 for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001680 KernelEnqueueFlagsParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001681 }
1682
1683 // Profiling info
John Kessenich5e4b1242015-08-06 22:53:06 -06001684 KernelProfilingInfoParams[0].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001685
1686 // set name of operator, an initial set of <id> style operands, and the description
1687
1688 InstructionDesc[OpSource].operands.push(OperandSource, "");
1689 InstructionDesc[OpSource].operands.push(OperandLiteralNumber, "'Version'");
John Kessenich55e7d112015-11-15 21:33:39 -07001690 InstructionDesc[OpSource].operands.push(OperandId, "'File'", true);
1691 InstructionDesc[OpSource].operands.push(OperandLiteralString, "'Source'", true);
1692
1693 InstructionDesc[OpSourceContinued].operands.push(OperandLiteralString, "'Continued Source'");
John Kessenich140f3df2015-06-26 16:58:36 -06001694
1695 InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString, "'Extension'");
1696
1697 InstructionDesc[OpName].operands.push(OperandId, "'Target'");
1698 InstructionDesc[OpName].operands.push(OperandLiteralString, "'Name'");
1699
1700 InstructionDesc[OpMemberName].operands.push(OperandId, "'Type'");
1701 InstructionDesc[OpMemberName].operands.push(OperandLiteralNumber, "'Member'");
1702 InstructionDesc[OpMemberName].operands.push(OperandLiteralString, "'Name'");
1703
1704 InstructionDesc[OpString].operands.push(OperandLiteralString, "'String'");
1705
John Kessenich140f3df2015-06-26 16:58:36 -06001706 InstructionDesc[OpLine].operands.push(OperandId, "'File'");
1707 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Line'");
1708 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Column'");
1709
1710 InstructionDesc[OpExtension].operands.push(OperandLiteralString, "'Name'");
1711
1712 InstructionDesc[OpExtInstImport].operands.push(OperandLiteralString, "'Name'");
1713
John Kessenich5e4b1242015-08-06 22:53:06 -06001714 InstructionDesc[OpCapability].operands.push(OperandCapability, "'Capability'");
1715
John Kessenich140f3df2015-06-26 16:58:36 -06001716 InstructionDesc[OpMemoryModel].operands.push(OperandAddressing, "");
1717 InstructionDesc[OpMemoryModel].operands.push(OperandMemory, "");
1718
1719 InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel, "");
1720 InstructionDesc[OpEntryPoint].operands.push(OperandId, "'Entry Point'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001721 InstructionDesc[OpEntryPoint].operands.push(OperandLiteralString, "'Name'");
John Kessenich55e7d112015-11-15 21:33:39 -07001722 InstructionDesc[OpEntryPoint].operands.push(OperandVariableIds, "'Interface'");
John Kessenich140f3df2015-06-26 16:58:36 -06001723
1724 InstructionDesc[OpExecutionMode].operands.push(OperandId, "'Entry Point'");
1725 InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode, "'Mode'");
John Kessenich55e7d112015-11-15 21:33:39 -07001726 InstructionDesc[OpExecutionMode].operands.push(OperandOptionalLiteral, "See <<Execution_Mode,Execution Mode>>");
John Kessenich140f3df2015-06-26 16:58:36 -06001727
1728 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Width'");
1729 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Signedness'");
1730
1731 InstructionDesc[OpTypeFloat].operands.push(OperandLiteralNumber, "'Width'");
1732
John Kessenich5e4b1242015-08-06 22:53:06 -06001733 InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component Type'");
1734 InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001735
John Kessenich5e4b1242015-08-06 22:53:06 -06001736 InstructionDesc[OpTypeMatrix].capabilities.push_back(CapabilityMatrix);
1737 InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column Type'");
1738 InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001739
John Kessenich5e4b1242015-08-06 22:53:06 -06001740 InstructionDesc[OpTypeImage].operands.push(OperandId, "'Sampled Type'");
1741 InstructionDesc[OpTypeImage].operands.push(OperandDimensionality, "");
1742 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Depth'");
1743 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Arrayed'");
1744 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'MS'");
1745 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Sampled'");
1746 InstructionDesc[OpTypeImage].operands.push(OperandSamplerImageFormat, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001747 InstructionDesc[OpTypeImage].operands.push(OperandAccessQualifier, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001748
John Kessenich5e4b1242015-08-06 22:53:06 -06001749 InstructionDesc[OpTypeSampledImage].operands.push(OperandId, "'Image Type'");
1750
1751 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001752 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'");
1753
John Kessenich5e4b1242015-08-06 22:53:06 -06001754 InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapabilityShader);
1755 InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001756
1757 InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n...");
1758
John Kessenich5e4b1242015-08-06 22:53:06 -06001759 InstructionDesc[OpTypeOpaque].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001760 InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type.");
1761
1762 InstructionDesc[OpTypePointer].operands.push(OperandStorage, "");
1763 InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'");
1764
John Kessenich55e7d112015-11-15 21:33:39 -07001765 InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses);
1766 InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'");
1767 InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, "");
1768
John Kessenich5e4b1242015-08-06 22:53:06 -06001769 InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001770
John Kessenich55e7d112015-11-15 21:33:39 -07001771 InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001772
John Kessenich5e4b1242015-08-06 22:53:06 -06001773 InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001774
John Kessenich55e7d112015-11-15 21:33:39 -07001775 InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001776
John Kessenich140f3df2015-06-26 16:58:36 -06001777 InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001778 InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001779
1780 InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'");
1781 InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n...");
1782
1783 InstructionDesc[OpConstant].operands.push(OperandVariableLiterals, "'Value'");
1784
1785 InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
1786
John Kessenich5e4b1242015-08-06 22:53:06 -06001787 InstructionDesc[OpConstantSampler].capabilities.push_back(CapabilityLiteralSampler);
1788 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerAddressingMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001789 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001790 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerFilterMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001791
1792 InstructionDesc[OpSpecConstant].operands.push(OperandVariableLiterals, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06001793
1794 InstructionDesc[OpSpecConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001795
1796 InstructionDesc[OpSpecConstantOp].operands.push(OperandLiteralNumber, "'Opcode'");
1797 InstructionDesc[OpSpecConstantOp].operands.push(OperandVariableIds, "'Operands'");
John Kessenich140f3df2015-06-26 16:58:36 -06001798
1799 InstructionDesc[OpVariable].operands.push(OperandStorage, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001800 InstructionDesc[OpVariable].operands.push(OperandId, "'Initializer'", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001801
John Kessenich140f3df2015-06-26 16:58:36 -06001802 InstructionDesc[OpFunction].operands.push(OperandFunction, "");
1803 InstructionDesc[OpFunction].operands.push(OperandId, "'Function Type'");
1804
1805 InstructionDesc[OpFunctionCall].operands.push(OperandId, "'Function'");
1806 InstructionDesc[OpFunctionCall].operands.push(OperandVariableIds, "'Argument 0', +\n'Argument 1', +\n...");
1807
1808 InstructionDesc[OpExtInst].operands.push(OperandId, "'Set'");
1809 InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber, "'Instruction'");
1810 InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n...");
1811
1812 InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07001813 InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001814
1815 InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'");
1816 InstructionDesc[OpStore].operands.push(OperandId, "'Object'");
John Kessenich55e7d112015-11-15 21:33:39 -07001817 InstructionDesc[OpStore].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001818
John Kessenich5e4b1242015-08-06 22:53:06 -06001819 InstructionDesc[OpPhi].operands.push(OperandVariableIds, "'Variable, Parent, ...'");
John Kessenich140f3df2015-06-26 16:58:36 -06001820
1821 InstructionDesc[OpDecorate].operands.push(OperandId, "'Target'");
1822 InstructionDesc[OpDecorate].operands.push(OperandDecoration, "");
1823 InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1824
John Kessenich5e4b1242015-08-06 22:53:06 -06001825 InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001826 InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'");
1827 InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, "");
1828 InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1829
John Kessenich5e4b1242015-08-06 22:53:06 -06001830 InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'");
1831 InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001832
John Kessenich5e4b1242015-08-06 22:53:06 -06001833 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandId, "'Decoration Group'");
1834 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandVariableIdLiteral, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001835
1836 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Vector'");
1837 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Index'");
1838
1839 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Vector'");
1840 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Component'");
1841 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Index'");
1842
1843 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 1'");
1844 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 2'");
1845 InstructionDesc[OpVectorShuffle].operands.push(OperandVariableLiterals, "'Components'");
1846
1847 InstructionDesc[OpCompositeConstruct].operands.push(OperandVariableIds, "'Constituents'");
1848
1849 InstructionDesc[OpCompositeExtract].operands.push(OperandId, "'Composite'");
1850 InstructionDesc[OpCompositeExtract].operands.push(OperandVariableLiterals, "'Indexes'");
1851
1852 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Object'");
1853 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Composite'");
1854 InstructionDesc[OpCompositeInsert].operands.push(OperandVariableLiterals, "'Indexes'");
1855
1856 InstructionDesc[OpCopyObject].operands.push(OperandId, "'Operand'");
1857
1858 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Target'");
1859 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Source'");
John Kessenich55e7d112015-11-15 21:33:39 -07001860 InstructionDesc[OpCopyMemory].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001861
1862 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Target'");
1863 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Source'");
1864 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07001865 InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001866
John Kessenich5e4b1242015-08-06 22:53:06 -06001867 InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001868
John Kessenich5e4b1242015-08-06 22:53:06 -06001869 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'");
1870 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'");
John Kessenich140f3df2015-06-26 16:58:36 -06001871
John Kessenich55e7d112015-11-15 21:33:39 -07001872 InstructionDesc[OpImage].operands.push(OperandId, "'Sampled Image'");
1873
John Kessenich5e4b1242015-08-06 22:53:06 -06001874 InstructionDesc[OpImageRead].operands.push(OperandId, "'Image'");
1875 InstructionDesc[OpImageRead].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001876 InstructionDesc[OpImageRead].operands.push(OperandImageOperands, "", true);
1877 InstructionDesc[OpImageRead].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001878
John Kessenich5e4b1242015-08-06 22:53:06 -06001879 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Image'");
1880 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Coordinate'");
1881 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Texel'");
John Kessenich55e7d112015-11-15 21:33:39 -07001882 InstructionDesc[OpImageWrite].operands.push(OperandImageOperands, "", true);
1883 InstructionDesc[OpImageWrite].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001884
John Kessenich5e4b1242015-08-06 22:53:06 -06001885 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1886 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001887 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1888 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001889 InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001890
John Kessenich5e4b1242015-08-06 22:53:06 -06001891 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1892 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001893 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandImageOperands, "", true);
1894 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001895
John Kessenich5e4b1242015-08-06 22:53:06 -06001896 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1897 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1898 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001899 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1900 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001901 InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001902
John Kessenich5e4b1242015-08-06 22:53:06 -06001903 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1904 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1905 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001906 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1907 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001908 InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001909
John Kessenich5e4b1242015-08-06 22:53:06 -06001910 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
1911 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001912 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
1913 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001914 InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001915
John Kessenich5e4b1242015-08-06 22:53:06 -06001916 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
1917 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001918 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
1919 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001920 InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001921
John Kessenich5e4b1242015-08-06 22:53:06 -06001922 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1923 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1924 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001925 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1926 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001927 InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001928
John Kessenich5e4b1242015-08-06 22:53:06 -06001929 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1930 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1931 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001932 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1933 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001934 InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001935
John Kessenich55e7d112015-11-15 21:33:39 -07001936 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001937 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001938 InstructionDesc[OpImageFetch].operands.push(OperandImageOperands, "", true);
1939 InstructionDesc[OpImageFetch].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001940
John Kessenich5e4b1242015-08-06 22:53:06 -06001941 InstructionDesc[OpImageGather].operands.push(OperandId, "'Sampled Image'");
1942 InstructionDesc[OpImageGather].operands.push(OperandId, "'Coordinate'");
1943 InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'");
John Kessenich55e7d112015-11-15 21:33:39 -07001944 InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true);
1945 InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001946 InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001947
John Kessenich5e4b1242015-08-06 22:53:06 -06001948 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'");
1949 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'");
1950 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001951 InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true);
1952 InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001953 InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001954
John Kessenich55e7d112015-11-15 21:33:39 -07001955 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1956 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
1957 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1958 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true);
1959 InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1960
1961 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1962 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
1963 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true);
1964 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true);
1965 InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1966
1967 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1968 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1969 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
1970 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1971 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
1972 InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1973
1974 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1975 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1976 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
1977 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1978 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
1979 InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1980
1981 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
1982 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
1983 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
1984 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
1985 InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1986
1987 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
1988 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
1989 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
1990 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
1991 InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency);
1992
1993 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1994 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1995 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
1996 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1997 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
1998 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1999
2000 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
2001 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
2002 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
2003 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
2004 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
2005 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2006
2007 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'");
2008 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'");
2009 InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true);
2010 InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true);
2011 InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency);
2012
2013 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'");
2014 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'");
2015 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'");
2016 InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true);
2017 InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true);
2018 InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency);
2019
2020 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'");
2021 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'");
2022 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'");
2023 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true);
2024 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true);
2025 InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency);
2026
John Kessenich6c292d32016-02-15 20:58:50 -07002027 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'");
2028 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'");
2029 InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true);
2030 InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true);
2031 InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency);
2032
John Kessenich55e7d112015-11-15 21:33:39 -07002033 InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'");
2034 InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency);
2035
John Kessenich5e4b1242015-08-06 22:53:06 -06002036 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'");
2037 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'");
John Kessenich55e7d112015-11-15 21:33:39 -07002038 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel);
2039 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002040
John Kessenich5e4b1242015-08-06 22:53:06 -06002041 InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002042 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel);
2043 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002044
John Kessenich5e4b1242015-08-06 22:53:06 -06002045 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'");
2046 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07002047 InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002048
John Kessenich5e4b1242015-08-06 22:53:06 -06002049 InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002050 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel);
2051 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002052
John Kessenich5e4b1242015-08-06 22:53:06 -06002053 InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002054 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel);
2055 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002056
John Kessenich5e4b1242015-08-06 22:53:06 -06002057 InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'");
2058 InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002059
John Kessenich5e4b1242015-08-06 22:53:06 -06002060 InstructionDesc[OpImageQueryOrder].operands.push(OperandId, "'Image'");
2061 InstructionDesc[OpImageQueryOrder].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002062
2063 InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'");
2064 InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2065
2066 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandId, "'Base'");
2067 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2068
John Kessenich5e4b1242015-08-06 22:53:06 -06002069 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Base'");
2070 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Element'");
2071 InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2072 InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2073
John Kessenich55e7d112015-11-15 21:33:39 -07002074 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'");
2075 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'");
2076 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2077 InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2078
John Kessenich140f3df2015-06-26 16:58:36 -06002079 InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'");
2080
2081 InstructionDesc[OpFNegate].operands.push(OperandId, "'Operand'");
2082
2083 InstructionDesc[OpNot].operands.push(OperandId, "'Operand'");
2084
2085 InstructionDesc[OpAny].operands.push(OperandId, "'Vector'");
2086
2087 InstructionDesc[OpAll].operands.push(OperandId, "'Vector'");
2088
2089 InstructionDesc[OpConvertFToU].operands.push(OperandId, "'Float Value'");
2090
2091 InstructionDesc[OpConvertFToS].operands.push(OperandId, "'Float Value'");
2092
2093 InstructionDesc[OpConvertSToF].operands.push(OperandId, "'Signed Value'");
2094
John Kessenich5e4b1242015-08-06 22:53:06 -06002095 InstructionDesc[OpConvertUToF].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002096
John Kessenich5e4b1242015-08-06 22:53:06 -06002097 InstructionDesc[OpUConvert].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002098
2099 InstructionDesc[OpSConvert].operands.push(OperandId, "'Signed Value'");
2100
2101 InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'");
2102
2103 InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002104 InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002105
2106 InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002107 InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002108
2109 InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002110 InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002111
John Kessenich5e4b1242015-08-06 22:53:06 -06002112 InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer Value'");
2113 InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002114
John Kessenich5e4b1242015-08-06 22:53:06 -06002115 InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Pointer'");
2116 InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002117
John Kessenich5e4b1242015-08-06 22:53:06 -06002118 InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Pointer'");
2119 InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002120
John Kessenich5e4b1242015-08-06 22:53:06 -06002121 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Pointer'");
2122 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'Storage'");
2123 InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002124
John Kessenich5e4b1242015-08-06 22:53:06 -06002125 InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'Pointer'");
2126 InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002127
2128 InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'");
2129
John Kessenich5e4b1242015-08-06 22:53:06 -06002130 InstructionDesc[OpQuantizeToF16].operands.push(OperandId, "'Value'");
2131
2132 InstructionDesc[OpTranspose].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002133 InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'");
2134
2135 InstructionDesc[OpIsNan].operands.push(OperandId, "'x'");
2136
2137 InstructionDesc[OpIsInf].operands.push(OperandId, "'x'");
2138
John Kessenich5e4b1242015-08-06 22:53:06 -06002139 InstructionDesc[OpIsFinite].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002140 InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'");
2141
John Kessenich5e4b1242015-08-06 22:53:06 -06002142 InstructionDesc[OpIsNormal].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002143 InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'");
2144
John Kessenich5e4b1242015-08-06 22:53:06 -06002145 InstructionDesc[OpSignBitSet].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002146 InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'");
2147
John Kessenich5e4b1242015-08-06 22:53:06 -06002148 InstructionDesc[OpLessOrGreater].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002149 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'");
2150 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'");
2151
John Kessenich5e4b1242015-08-06 22:53:06 -06002152 InstructionDesc[OpOrdered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002153 InstructionDesc[OpOrdered].operands.push(OperandId, "'x'");
2154 InstructionDesc[OpOrdered].operands.push(OperandId, "'y'");
2155
John Kessenich5e4b1242015-08-06 22:53:06 -06002156 InstructionDesc[OpUnordered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002157 InstructionDesc[OpUnordered].operands.push(OperandId, "'x'");
2158 InstructionDesc[OpUnordered].operands.push(OperandId, "'y'");
2159
2160 InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'");
2161 InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002162 InstructionDesc[OpArrayLength].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002163
2164 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'");
2165 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'");
2166
2167 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 1'");
2168 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 2'");
2169
2170 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 1'");
2171 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 2'");
2172
2173 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 1'");
2174 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 2'");
2175
2176 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 1'");
2177 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 2'");
2178
2179 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 1'");
2180 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 2'");
2181
2182 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 1'");
2183 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 2'");
2184
2185 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 1'");
2186 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 2'");
2187
2188 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 1'");
2189 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 2'");
2190
2191 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 1'");
2192 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 2'");
2193
2194 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 1'");
2195 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 2'");
2196
2197 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 1'");
2198 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 2'");
2199
2200 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 1'");
2201 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 2'");
2202
2203 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 1'");
2204 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 2'");
2205
2206 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'");
2207 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'");
2208
John Kessenich5e4b1242015-08-06 22:53:06 -06002209 InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002210 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'");
2211 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'");
2212
John Kessenich5e4b1242015-08-06 22:53:06 -06002213 InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002214 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'");
2215 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'");
2216
John Kessenich5e4b1242015-08-06 22:53:06 -06002217 InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002218 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'");
2219 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'");
2220
John Kessenich5e4b1242015-08-06 22:53:06 -06002221 InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002222 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'");
2223 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'");
2224
John Kessenich5e4b1242015-08-06 22:53:06 -06002225 InstructionDesc[OpOuterProduct].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002226 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'");
2227 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'");
2228
2229 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 1'");
2230 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 2'");
2231
John Kessenich55e7d112015-11-15 21:33:39 -07002232 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 1'");
2233 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 2'");
2234
2235 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 1'");
2236 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 2'");
2237
2238 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 1'");
2239 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 2'");
2240
2241 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 1'");
2242 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 2'");
2243
John Kessenich5e4b1242015-08-06 22:53:06 -06002244 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Base'");
2245 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002246
John Kessenich5e4b1242015-08-06 22:53:06 -06002247 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Base'");
2248 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002249
John Kessenich5e4b1242015-08-06 22:53:06 -06002250 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Base'");
2251 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002252
2253 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 1'");
2254 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 2'");
2255
John Kessenich140f3df2015-06-26 16:58:36 -06002256 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 1'");
2257 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 2'");
2258
John Kessenich5e4b1242015-08-06 22:53:06 -06002259 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 1'");
2260 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 2'");
2261
2262 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 1'");
2263 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 2'");
2264
2265 InstructionDesc[OpLogicalNot].operands.push(OperandId, "'Operand'");
2266
John Kessenich140f3df2015-06-26 16:58:36 -06002267 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 1'");
2268 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 2'");
2269
2270 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 1'");
2271 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 2'");
2272
2273 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'");
2274 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'");
2275
John Kessenich5e4b1242015-08-06 22:53:06 -06002276 InstructionDesc[OpBitFieldInsert].capabilities.push_back(CapabilityShader);
2277 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Base'");
2278 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Insert'");
2279 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Offset'");
2280 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Count'");
2281
2282 InstructionDesc[OpBitFieldSExtract].capabilities.push_back(CapabilityShader);
2283 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'");
2284 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'");
2285 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'");
2286
2287 InstructionDesc[OpBitFieldUExtract].capabilities.push_back(CapabilityShader);
2288 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'");
2289 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'");
2290 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'");
2291
2292 InstructionDesc[OpBitReverse].capabilities.push_back(CapabilityShader);
2293 InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'");
2294
2295 InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'");
2296
John Kessenich140f3df2015-06-26 16:58:36 -06002297 InstructionDesc[OpSelect].operands.push(OperandId, "'Condition'");
2298 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 1'");
2299 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 2'");
2300
2301 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 1'");
2302 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 2'");
2303
2304 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 1'");
2305 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 2'");
2306
2307 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 1'");
2308 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 2'");
2309
2310 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 1'");
2311 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 2'");
2312
2313 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 1'");
2314 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 2'");
2315
2316 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 1'");
2317 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 2'");
2318
2319 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 1'");
2320 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 2'");
2321
2322 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 1'");
2323 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 2'");
2324
2325 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 1'");
2326 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 2'");
2327
2328 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 1'");
2329 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 2'");
2330
2331 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 1'");
2332 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 2'");
2333
2334 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 1'");
2335 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 2'");
2336
2337 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 1'");
2338 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 2'");
2339
2340 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 1'");
2341 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 2'");
2342
2343 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 1'");
2344 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 2'");
2345
2346 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 1'");
2347 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 2'");
2348
2349 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 1'");
2350 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 2'");
2351
2352 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 1'");
2353 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 2'");
2354
2355 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2356 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2357
2358 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2359 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2360
2361 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2362 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2363
2364 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2365 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2366
John Kessenich5e4b1242015-08-06 22:53:06 -06002367 InstructionDesc[OpDPdx].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002368 InstructionDesc[OpDPdx].operands.push(OperandId, "'P'");
2369
John Kessenich5e4b1242015-08-06 22:53:06 -06002370 InstructionDesc[OpDPdy].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002371 InstructionDesc[OpDPdy].operands.push(OperandId, "'P'");
2372
John Kessenich5e4b1242015-08-06 22:53:06 -06002373 InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002374 InstructionDesc[OpFwidth].operands.push(OperandId, "'P'");
2375
John Kessenich55e7d112015-11-15 21:33:39 -07002376 InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002377 InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'");
2378
John Kessenich55e7d112015-11-15 21:33:39 -07002379 InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002380 InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'");
2381
John Kessenich55e7d112015-11-15 21:33:39 -07002382 InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002383 InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'");
2384
John Kessenich55e7d112015-11-15 21:33:39 -07002385 InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002386 InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'");
2387
John Kessenich55e7d112015-11-15 21:33:39 -07002388 InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002389 InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'");
2390
John Kessenich55e7d112015-11-15 21:33:39 -07002391 InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002392 InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'");
2393
John Kessenich5e4b1242015-08-06 22:53:06 -06002394 InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002395
John Kessenich5e4b1242015-08-06 22:53:06 -06002396 InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002397
2398 InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002399 InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002400
2401 InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002402 InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002403
John Kessenich5e4b1242015-08-06 22:53:06 -06002404 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'");
2405 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'");
2406 InstructionDesc[OpControlBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
John Kessenich140f3df2015-06-26 16:58:36 -06002407
John Kessenich5e4b1242015-08-06 22:53:06 -06002408 InstructionDesc[OpMemoryBarrier].operands.push(OperandScope, "'Memory'");
John Kessenich140f3df2015-06-26 16:58:36 -06002409 InstructionDesc[OpMemoryBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
2410
John Kessenich5e4b1242015-08-06 22:53:06 -06002411 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Image'");
2412 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Coordinate'");
2413 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Sample'");
John Kessenich140f3df2015-06-26 16:58:36 -06002414
2415 InstructionDesc[OpAtomicLoad].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002416 InstructionDesc[OpAtomicLoad].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002417 InstructionDesc[OpAtomicLoad].operands.push(OperandMemorySemantics, "'Semantics'");
2418
2419 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002420 InstructionDesc[OpAtomicStore].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002421 InstructionDesc[OpAtomicStore].operands.push(OperandMemorySemantics, "'Semantics'");
2422 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Value'");
2423
2424 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002425 InstructionDesc[OpAtomicExchange].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002426 InstructionDesc[OpAtomicExchange].operands.push(OperandMemorySemantics, "'Semantics'");
2427 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Value'");
2428
2429 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002430 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandScope, "'Scope'");
2431 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Equal'");
2432 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002433 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Value'");
2434 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Comparator'");
2435
2436 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002437 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandScope, "'Scope'");
2438 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Equal'");
2439 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002440 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'");
2441 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002442 InstructionDesc[OpAtomicCompareExchangeWeak].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002443
2444 InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002445 InstructionDesc[OpAtomicIIncrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002446 InstructionDesc[OpAtomicIIncrement].operands.push(OperandMemorySemantics, "'Semantics'");
2447
2448 InstructionDesc[OpAtomicIDecrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002449 InstructionDesc[OpAtomicIDecrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002450 InstructionDesc[OpAtomicIDecrement].operands.push(OperandMemorySemantics, "'Semantics'");
2451
2452 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002453 InstructionDesc[OpAtomicIAdd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002454 InstructionDesc[OpAtomicIAdd].operands.push(OperandMemorySemantics, "'Semantics'");
2455 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Value'");
2456
2457 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002458 InstructionDesc[OpAtomicISub].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002459 InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics, "'Semantics'");
2460 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Value'");
2461
2462 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002463 InstructionDesc[OpAtomicUMin].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002464 InstructionDesc[OpAtomicUMin].operands.push(OperandMemorySemantics, "'Semantics'");
2465 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Value'");
2466
2467 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002468 InstructionDesc[OpAtomicUMax].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002469 InstructionDesc[OpAtomicUMax].operands.push(OperandMemorySemantics, "'Semantics'");
2470 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Value'");
2471
John Kessenich5e4b1242015-08-06 22:53:06 -06002472 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Pointer'");
2473 InstructionDesc[OpAtomicSMin].operands.push(OperandScope, "'Scope'");
2474 InstructionDesc[OpAtomicSMin].operands.push(OperandMemorySemantics, "'Semantics'");
2475 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002476
John Kessenich5e4b1242015-08-06 22:53:06 -06002477 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Pointer'");
2478 InstructionDesc[OpAtomicSMax].operands.push(OperandScope, "'Scope'");
2479 InstructionDesc[OpAtomicSMax].operands.push(OperandMemorySemantics, "'Semantics'");
2480 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002481
2482 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002483 InstructionDesc[OpAtomicAnd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002484 InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics, "'Semantics'");
2485 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Value'");
2486
2487 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002488 InstructionDesc[OpAtomicOr].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002489 InstructionDesc[OpAtomicOr].operands.push(OperandMemorySemantics, "'Semantics'");
2490 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Value'");
2491
2492 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002493 InstructionDesc[OpAtomicXor].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002494 InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics, "'Semantics'");
2495 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Value'");
2496
John Kessenich55e7d112015-11-15 21:33:39 -07002497 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'");
2498 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'");
2499 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'");
2500 InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel);
2501
2502 InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'");
2503 InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'");
2504 InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'");
2505 InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel);
2506
John Kessenich5e4b1242015-08-06 22:53:06 -06002507 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich55e7d112015-11-15 21:33:39 -07002508 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'");
John Kessenich140f3df2015-06-26 16:58:36 -06002509 InstructionDesc[OpLoopMerge].operands.push(OperandLoop, "");
2510
John Kessenich5e4b1242015-08-06 22:53:06 -06002511 InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich140f3df2015-06-26 16:58:36 -06002512 InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, "");
2513
2514 InstructionDesc[OpBranch].operands.push(OperandId, "'Target Label'");
2515
2516 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'Condition'");
2517 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'True Label'");
2518 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'False Label'");
2519 InstructionDesc[OpBranchConditional].operands.push(OperandVariableLiterals, "'Branch weights'");
2520
2521 InstructionDesc[OpSwitch].operands.push(OperandId, "'Selector'");
2522 InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'");
2523 InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'");
2524
John Kessenich5e4b1242015-08-06 22:53:06 -06002525 InstructionDesc[OpKill].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002526
2527 InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'");
2528
John Kessenich5e4b1242015-08-06 22:53:06 -06002529 InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'");
2530 InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002531 InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002532
John Kessenich5e4b1242015-08-06 22:53:06 -06002533 InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'");
2534 InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002535 InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002536
John Kessenich55e7d112015-11-15 21:33:39 -07002537 InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel);
2538 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'");
2539 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'");
2540 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'");
2541 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Num Elements'");
2542 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'");
2543 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002544
John Kessenich55e7d112015-11-15 21:33:39 -07002545 InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel);
2546 InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'");
2547 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'");
2548 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'");
John Kessenich140f3df2015-06-26 16:58:36 -06002549
John Kessenich5e4b1242015-08-06 22:53:06 -06002550 InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups);
2551 InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002552 InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'");
2553
John Kessenich5e4b1242015-08-06 22:53:06 -06002554 InstructionDesc[OpGroupAny].capabilities.push_back(CapabilityGroups);
2555 InstructionDesc[OpGroupAny].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002556 InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'");
2557
John Kessenich5e4b1242015-08-06 22:53:06 -06002558 InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapabilityGroups);
2559 InstructionDesc[OpGroupBroadcast].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002560 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'");
2561 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'");
2562
John Kessenich5e4b1242015-08-06 22:53:06 -06002563 InstructionDesc[OpGroupIAdd].capabilities.push_back(CapabilityGroups);
2564 InstructionDesc[OpGroupIAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002565 InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'");
2566 InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'");
2567
John Kessenich5e4b1242015-08-06 22:53:06 -06002568 InstructionDesc[OpGroupFAdd].capabilities.push_back(CapabilityGroups);
2569 InstructionDesc[OpGroupFAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002570 InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'");
2571 InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'");
2572
John Kessenich5e4b1242015-08-06 22:53:06 -06002573 InstructionDesc[OpGroupUMin].capabilities.push_back(CapabilityGroups);
2574 InstructionDesc[OpGroupUMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002575 InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'");
2576 InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'");
2577
John Kessenich5e4b1242015-08-06 22:53:06 -06002578 InstructionDesc[OpGroupSMin].capabilities.push_back(CapabilityGroups);
2579 InstructionDesc[OpGroupSMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002580 InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'");
2581 InstructionDesc[OpGroupSMin].operands.push(OperandId, "X");
2582
John Kessenich5e4b1242015-08-06 22:53:06 -06002583 InstructionDesc[OpGroupFMin].capabilities.push_back(CapabilityGroups);
2584 InstructionDesc[OpGroupFMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002585 InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'");
2586 InstructionDesc[OpGroupFMin].operands.push(OperandId, "X");
2587
John Kessenich5e4b1242015-08-06 22:53:06 -06002588 InstructionDesc[OpGroupUMax].capabilities.push_back(CapabilityGroups);
2589 InstructionDesc[OpGroupUMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002590 InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'");
2591 InstructionDesc[OpGroupUMax].operands.push(OperandId, "X");
2592
John Kessenich5e4b1242015-08-06 22:53:06 -06002593 InstructionDesc[OpGroupSMax].capabilities.push_back(CapabilityGroups);
2594 InstructionDesc[OpGroupSMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002595 InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'");
2596 InstructionDesc[OpGroupSMax].operands.push(OperandId, "X");
2597
John Kessenich5e4b1242015-08-06 22:53:06 -06002598 InstructionDesc[OpGroupFMax].capabilities.push_back(CapabilityGroups);
2599 InstructionDesc[OpGroupFMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002600 InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'");
2601 InstructionDesc[OpGroupFMax].operands.push(OperandId, "X");
2602
John Kessenich5e4b1242015-08-06 22:53:06 -06002603 InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes);
2604 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'");
2605 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002606 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'");
2607 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002608
John Kessenich5e4b1242015-08-06 22:53:06 -06002609 InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes);
2610 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'");
2611 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002612 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'");
2613 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002614
John Kessenich5e4b1242015-08-06 22:53:06 -06002615 InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes);
2616 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'");
2617 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'");
2618 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'");
2619 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002620 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'");
2621 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002622
John Kessenich5e4b1242015-08-06 22:53:06 -06002623 InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes);
2624 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'");
2625 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'");
2626 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'");
2627 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002628 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'");
2629 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002630
John Kessenich5e4b1242015-08-06 22:53:06 -06002631 InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2632 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2633 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002634 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2635 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002636
John Kessenich5e4b1242015-08-06 22:53:06 -06002637 InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2638 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2639 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002640 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2641 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002642
John Kessenich5e4b1242015-08-06 22:53:06 -06002643 InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes);
2644 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'");
2645 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002646 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2647 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002648
John Kessenich5e4b1242015-08-06 22:53:06 -06002649 InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes);
2650 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'");
2651 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002652 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2653 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002654
John Kessenich5e4b1242015-08-06 22:53:06 -06002655 InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes);
2656 InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'");
John Kessenich140f3df2015-06-26 16:58:36 -06002657
John Kessenich5e4b1242015-08-06 22:53:06 -06002658 InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes);
2659 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002660 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'");
2661 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002662
John Kessenich5e4b1242015-08-06 22:53:06 -06002663 InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes);
2664 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002665 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'");
2666 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002667
John Kessenich5e4b1242015-08-06 22:53:06 -06002668 InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2669 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'");
2670 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2671 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002672 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2673 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002674
John Kessenich5e4b1242015-08-06 22:53:06 -06002675 InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2676 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'");
2677 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2678 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002679 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2680 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002681
John Kessenich5e4b1242015-08-06 22:53:06 -06002682 InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes);
2683 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'");
2684 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'");
2685 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002686 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2687 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002688
John Kessenich5e4b1242015-08-06 22:53:06 -06002689 InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes);
2690 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'");
2691 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'");
2692 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002693 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2694 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002695
John Kessenich5e4b1242015-08-06 22:53:06 -06002696 InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002697 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'");
2698 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'");
2699 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'");
2700
John Kessenich5e4b1242015-08-06 22:53:06 -06002701 InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002702
John Kessenich5e4b1242015-08-06 22:53:06 -06002703 InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002704
John Kessenich5e4b1242015-08-06 22:53:06 -06002705 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Event'");
2706 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Profiling Info'");
2707 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002708
John Kessenich5e4b1242015-08-06 22:53:06 -06002709 InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002710
John Kessenich5e4b1242015-08-06 22:53:06 -06002711 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Event'");
2712 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Status'");
John Kessenich140f3df2015-06-26 16:58:36 -06002713
John Kessenich5e4b1242015-08-06 22:53:06 -06002714 InstructionDesc[OpIsValidEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2715 InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002716
John Kessenich5e4b1242015-08-06 22:53:06 -06002717 InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002718
John Kessenich5e4b1242015-08-06 22:53:06 -06002719 InstructionDesc[OpRetainEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2720 InstructionDesc[OpRetainEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002721
John Kessenich5e4b1242015-08-06 22:53:06 -06002722 InstructionDesc[OpReleaseEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2723 InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002724
John Kessenich5e4b1242015-08-06 22:53:06 -06002725 InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002726 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002727 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param'");
2728 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Size'");
2729 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002730
John Kessenich5e4b1242015-08-06 22:53:06 -06002731 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002732 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002733 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param'");
2734 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Size'");
2735 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002736
John Kessenich5e4b1242015-08-06 22:53:06 -06002737 InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002738 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'");
2739 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002740 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param'");
2741 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Size'");
2742 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002743
John Kessenich5e4b1242015-08-06 22:53:06 -06002744 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002745 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'");
2746 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002747 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param'");
2748 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Size'");
2749 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002750
John Kessenich5e4b1242015-08-06 22:53:06 -06002751 InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapabilityDeviceEnqueue);
2752 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Queue'");
2753 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Flags'");
John Kessenich140f3df2015-06-26 16:58:36 -06002754 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'");
2755 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Num Events'");
2756 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Wait Events'");
2757 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Ret Event'");
2758 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Invoke'");
2759 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param'");
2760 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Size'");
2761 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'");
2762 InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'");
2763
John Kessenich5e4b1242015-08-06 22:53:06 -06002764 InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapabilityDeviceEnqueue);
2765 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Queue'");
John Kessenich140f3df2015-06-26 16:58:36 -06002766 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'");
2767 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'");
2768 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'");
Rex Xu9d93a232016-05-05 12:30:44 +08002769
Rex Xu51596642016-09-21 18:56:12 +08002770 InstructionDesc[OpSubgroupBallotKHR].operands.push(OperandId, "'Predicate'");
2771
2772 InstructionDesc[OpSubgroupFirstInvocationKHR].operands.push(OperandId, "'Value'");
2773
chaocf200da82016-12-20 12:44:35 -08002774 InstructionDesc[OpSubgroupReadInvocationKHR].capabilities.push_back(CapabilityGroups);
2775 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'");
2776 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'");
2777
Rex Xu9d93a232016-05-05 12:30:44 +08002778#ifdef AMD_EXTENSIONS
2779 InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2780 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2781 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2782 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
2783
2784 InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2785 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2786 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2787 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'");
2788
2789 InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2790 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2791 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2792 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'");
2793
2794 InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2795 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2796 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2797 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X");
2798
2799 InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2800 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2801 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2802 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X");
2803
2804 InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2805 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2806 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2807 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X");
2808
2809 InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2810 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2811 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2812 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X");
2813
2814 InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2815 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2816 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2817 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X");
2818#endif
John Kessenich140f3df2015-06-26 16:58:36 -06002819}
2820
2821}; // end spv namespace