blob: fb0cc36eaec99303b049efa98dc601f5588a5945 [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
John Kessenich6c8aaac2017-02-27 01:20:51 -070051 #include "GLSL.ext.KHR.h"
Rex Xu51596642016-09-21 18:56:12 +080052#ifdef AMD_EXTENSIONS
Rex Xu9d93a232016-05-05 12:30:44 +080053 #include "GLSL.ext.AMD.h"
Rex Xu51596642016-09-21 18:56:12 +080054#endif
chaoc0ad6a4e2016-12-19 16:29:34 -080055#ifdef NV_EXTENSIONS
56 #include "GLSL.ext.NV.h"
57#endif
Rex Xu9d93a232016-05-05 12:30:44 +080058 }
59}
Rex Xu9d93a232016-05-05 12:30:44 +080060
John Kessenich140f3df2015-06-26 16:58:36 -060061namespace spv {
62
63//
64// Whole set of functions that translate enumerants to their text strings for
65// the specification (or their sanitized versions for auto-generating the
John Kessenich5e4b1242015-08-06 22:53:06 -060066// spirv headers.
John Kessenich140f3df2015-06-26 16:58:36 -060067//
68// Also, the ceilings are declared next to these, to help keep them in sync.
69// Ceilings should be
70// - one more than the maximum value an enumerant takes on, for non-mask enumerants
John Kessenicha09eefd2017-04-07 15:40:30 -060071// (for non-sparse enums, this is the number of enumerants)
John Kessenich140f3df2015-06-26 16:58:36 -060072// - the number of bits consumed by the set of masks
John Kessenicha09eefd2017-04-07 15:40:30 -060073// (for non-sparse mask enums, this is the number of enumerants)
John Kessenich140f3df2015-06-26 16:58:36 -060074//
75
John Kessenich66e2faf2016-03-12 18:34:36 -070076const int SourceLanguageCeiling = 6; // HLSL todo: need official enumerant
John Kessenich140f3df2015-06-26 16:58:36 -060077
78const char* SourceString(int source)
79{
80 switch (source) {
81 case 0: return "Unknown";
82 case 1: return "ESSL";
83 case 2: return "GLSL";
John Kessenich55e7d112015-11-15 21:33:39 -070084 case 3: return "OpenCL_C";
85 case 4: return "OpenCL_CPP";
John Kessenich66e2faf2016-03-12 18:34:36 -070086 case 5: return "HLSL";
John Kessenich140f3df2015-06-26 16:58:36 -060087
88 case SourceLanguageCeiling:
89 default: return "Bad";
90 }
91}
92
93const int ExecutionModelCeiling = 7;
94
95const char* ExecutionModelString(int model)
96{
97 switch (model) {
98 case 0: return "Vertex";
99 case 1: return "TessellationControl";
100 case 2: return "TessellationEvaluation";
101 case 3: return "Geometry";
102 case 4: return "Fragment";
103 case 5: return "GLCompute";
104 case 6: return "Kernel";
105
106 case ExecutionModelCeiling:
107 default: return "Bad";
108 }
109}
110
111const int AddressingModelCeiling = 3;
112
113const char* AddressingString(int addr)
114{
115 switch (addr) {
116 case 0: return "Logical";
117 case 1: return "Physical32";
118 case 2: return "Physical64";
119
120 case AddressingModelCeiling:
121 default: return "Bad";
122 }
123}
124
John Kessenich5e4b1242015-08-06 22:53:06 -0600125const int MemoryModelCeiling = 3;
John Kessenich140f3df2015-06-26 16:58:36 -0600126
127const char* MemoryString(int mem)
128{
129 switch (mem) {
130 case 0: return "Simple";
131 case 1: return "GLSL450";
John Kessenich5e4b1242015-08-06 22:53:06 -0600132 case 2: return "OpenCL";
John Kessenich140f3df2015-06-26 16:58:36 -0600133
134 case MemoryModelCeiling:
135 default: return "Bad";
136 }
137}
138
John Kessenich55e7d112015-11-15 21:33:39 -0700139const int ExecutionModeCeiling = 33;
John Kessenich140f3df2015-06-26 16:58:36 -0600140
141const char* ExecutionModeString(int mode)
142{
143 switch (mode) {
144 case 0: return "Invocations";
145 case 1: return "SpacingEqual";
146 case 2: return "SpacingFractionalEven";
147 case 3: return "SpacingFractionalOdd";
148 case 4: return "VertexOrderCw";
149 case 5: return "VertexOrderCcw";
150 case 6: return "PixelCenterInteger";
151 case 7: return "OriginUpperLeft";
John Kessenich5e4b1242015-08-06 22:53:06 -0600152 case 8: return "OriginLowerLeft";
153 case 9: return "EarlyFragmentTests";
154 case 10: return "PointMode";
155 case 11: return "Xfb";
156 case 12: return "DepthReplacing";
John Kessenich55e7d112015-11-15 21:33:39 -0700157 case 13: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600158 case 14: return "DepthGreater";
159 case 15: return "DepthLess";
160 case 16: return "DepthUnchanged";
161 case 17: return "LocalSize";
162 case 18: return "LocalSizeHint";
163 case 19: return "InputPoints";
164 case 20: return "InputLines";
165 case 21: return "InputLinesAdjacency";
John Kessenich55e7d112015-11-15 21:33:39 -0700166 case 22: return "Triangles";
John Kessenich5e4b1242015-08-06 22:53:06 -0600167 case 23: return "InputTrianglesAdjacency";
John Kessenich55e7d112015-11-15 21:33:39 -0700168 case 24: return "Quads";
169 case 25: return "Isolines";
John Kessenich5e4b1242015-08-06 22:53:06 -0600170 case 26: return "OutputVertices";
171 case 27: return "OutputPoints";
172 case 28: return "OutputLineStrip";
173 case 29: return "OutputTriangleStrip";
174 case 30: return "VecTypeHint";
175 case 31: return "ContractionOff";
John Kessenich55e7d112015-11-15 21:33:39 -0700176 case 32: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600177
chaocc1204522017-06-30 17:14:30 -0700178 case 4446: return "PostDepthCoverage";
John Kessenich140f3df2015-06-26 16:58:36 -0600179 case ExecutionModeCeiling:
180 default: return "Bad";
181 }
182}
183
John Kessenich67027182017-04-19 18:34:49 -0600184const int StorageClassCeiling = 13;
John Kessenich140f3df2015-06-26 16:58:36 -0600185
186const char* StorageClassString(int StorageClass)
187{
188 switch (StorageClass) {
189 case 0: return "UniformConstant";
190 case 1: return "Input";
191 case 2: return "Uniform";
192 case 3: return "Output";
John Kessenich55e7d112015-11-15 21:33:39 -0700193 case 4: return "Workgroup";
194 case 5: return "CrossWorkgroup";
195 case 6: return "Private";
John Kessenich140f3df2015-06-26 16:58:36 -0600196 case 7: return "Function";
197 case 8: return "Generic";
John Kessenich55e7d112015-11-15 21:33:39 -0700198 case 9: return "PushConstant";
John Kessenich140f3df2015-06-26 16:58:36 -0600199 case 10: return "AtomicCounter";
John Kessenich5e4b1242015-08-06 22:53:06 -0600200 case 11: return "Image";
John Kessenich67027182017-04-19 18:34:49 -0600201 case 12: return "StorageBuffer";
John Kessenich140f3df2015-06-26 16:58:36 -0600202
203 case StorageClassCeiling:
204 default: return "Bad";
205 }
206}
207
John Kessenich55e7d112015-11-15 21:33:39 -0700208const int DecorationCeiling = 45;
John Kessenich140f3df2015-06-26 16:58:36 -0600209
210const char* DecorationString(int decoration)
211{
212 switch (decoration) {
John Kessenich5e4b1242015-08-06 22:53:06 -0600213 case 0: return "RelaxedPrecision";
214 case 1: return "SpecId";
215 case 2: return "Block";
216 case 3: return "BufferBlock";
217 case 4: return "RowMajor";
218 case 5: return "ColMajor";
219 case 6: return "ArrayStride";
220 case 7: return "MatrixStride";
221 case 8: return "GLSLShared";
222 case 9: return "GLSLPacked";
223 case 10: return "CPacked";
224 case 11: return "BuiltIn";
John Kessenich55e7d112015-11-15 21:33:39 -0700225 case 12: return "Bad";
226 case 13: return "NoPerspective";
John Kessenich5e4b1242015-08-06 22:53:06 -0600227 case 14: return "Flat";
228 case 15: return "Patch";
229 case 16: return "Centroid";
230 case 17: return "Sample";
231 case 18: return "Invariant";
232 case 19: return "Restrict";
233 case 20: return "Aliased";
234 case 21: return "Volatile";
235 case 22: return "Constant";
236 case 23: return "Coherent";
John Kessenich55e7d112015-11-15 21:33:39 -0700237 case 24: return "NonWritable";
238 case 25: return "NonReadable";
John Kessenich5e4b1242015-08-06 22:53:06 -0600239 case 26: return "Uniform";
John Kessenich55e7d112015-11-15 21:33:39 -0700240 case 27: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600241 case 28: return "SaturatedConversion";
242 case 29: return "Stream";
243 case 30: return "Location";
244 case 31: return "Component";
245 case 32: return "Index";
246 case 33: return "Binding";
247 case 34: return "DescriptorSet";
248 case 35: return "Offset";
John Kessenich5e4b1242015-08-06 22:53:06 -0600249 case 36: return "XfbBuffer";
250 case 37: return "XfbStride";
251 case 38: return "FuncParamAttr";
252 case 39: return "FP Rounding Mode";
253 case 40: return "FP Fast Math Mode";
254 case 41: return "Linkage Attributes";
John Kessenich55e7d112015-11-15 21:33:39 -0700255 case 42: return "NoContraction";
256 case 43: return "InputAttachmentIndex";
257 case 44: return "Alignment";
John Kessenich140f3df2015-06-26 16:58:36 -0600258
259 case DecorationCeiling:
260 default: return "Bad";
Rex Xu9d93a232016-05-05 12:30:44 +0800261
262#ifdef AMD_EXTENSIONS
263 case 4999: return "ExplicitInterpAMD";
264#endif
chaoc0ad6a4e2016-12-19 16:29:34 -0800265#ifdef NV_EXTENSIONS
266 case 5248: return "OverrideCoverageNV";
chaoc6e5acae2016-12-20 13:28:52 -0800267 case 5250: return "PassthroughNV";
chaoc771d89f2017-01-13 01:10:53 -0800268 case 5252: return "ViewportRelativeNV";
269 case 5256: return "SecondaryViewportRelativeNV";
chaoc0ad6a4e2016-12-19 16:29:34 -0800270#endif
John Kessenich140f3df2015-06-26 16:58:36 -0600271 }
272}
273
John Kessenich55e7d112015-11-15 21:33:39 -0700274const int BuiltInCeiling = 44;
John Kessenich140f3df2015-06-26 16:58:36 -0600275
276const char* BuiltInString(int builtIn)
277{
278 switch (builtIn) {
279 case 0: return "Position";
280 case 1: return "PointSize";
John Kessenich5e4b1242015-08-06 22:53:06 -0600281 case 2: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600282 case 3: return "ClipDistance";
283 case 4: return "CullDistance";
284 case 5: return "VertexId";
285 case 6: return "InstanceId";
286 case 7: return "PrimitiveId";
287 case 8: return "InvocationId";
288 case 9: return "Layer";
289 case 10: return "ViewportIndex";
290 case 11: return "TessLevelOuter";
291 case 12: return "TessLevelInner";
292 case 13: return "TessCoord";
293 case 14: return "PatchVertices";
294 case 15: return "FragCoord";
295 case 16: return "PointCoord";
296 case 17: return "FrontFacing";
297 case 18: return "SampleId";
298 case 19: return "SamplePosition";
299 case 20: return "SampleMask";
John Kessenich55e7d112015-11-15 21:33:39 -0700300 case 21: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600301 case 22: return "FragDepth";
302 case 23: return "HelperInvocation";
303 case 24: return "NumWorkgroups";
304 case 25: return "WorkgroupSize";
305 case 26: return "WorkgroupId";
306 case 27: return "LocalInvocationId";
307 case 28: return "GlobalInvocationId";
308 case 29: return "LocalInvocationIndex";
309 case 30: return "WorkDim";
310 case 31: return "GlobalSize";
311 case 32: return "EnqueuedWorkgroupSize";
312 case 33: return "GlobalOffset";
313 case 34: return "GlobalLinearId";
John Kessenich55e7d112015-11-15 21:33:39 -0700314 case 35: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600315 case 36: return "SubgroupSize";
316 case 37: return "SubgroupMaxSize";
317 case 38: return "NumSubgroups";
318 case 39: return "NumEnqueuedSubgroups";
319 case 40: return "SubgroupId";
320 case 41: return "SubgroupLocalInvocationId";
John Kessenich55e7d112015-11-15 21:33:39 -0700321 case 42: return "VertexIndex"; // TBD: put next to VertexId?
322 case 43: return "InstanceIndex"; // TBD: put next to InstanceId?
John Kessenich140f3df2015-06-26 16:58:36 -0600323
Rex Xu51596642016-09-21 18:56:12 +0800324 case 4416: return "SubgroupEqMaskKHR";
325 case 4417: return "SubgroupGeMaskKHR";
326 case 4418: return "SubgroupGtMaskKHR";
327 case 4419: return "SubgroupLeMaskKHR";
328 case 4420: return "SubgroupLtMaskKHR";
John Kessenich6c8aaac2017-02-27 01:20:51 -0700329 case 4438: return "DeviceIndex";
330 case 4440: return "ViewIndex";
Rex Xuf3b27472016-07-22 18:15:31 +0800331 case 4424: return "BaseVertex";
332 case 4425: return "BaseInstance";
333 case 4426: return "DrawIndex";
334
Rex Xu9d93a232016-05-05 12:30:44 +0800335#ifdef AMD_EXTENSIONS
336 case 4992: return "BaryCoordNoPerspAMD";
337 case 4993: return "BaryCoordNoPerspCentroidAMD";
338 case 4994: return "BaryCoordNoPerspSampleAMD";
339 case 4995: return "BaryCoordSmoothAMD";
340 case 4996: return "BaryCoordSmoothCentroidAMD";
341 case 4997: return "BaryCoordSmoothSampleAMD";
342 case 4998: return "BaryCoordPullModelAMD";
343#endif
John Kessenich6c8aaac2017-02-27 01:20:51 -0700344
chaoc771d89f2017-01-13 01:10:53 -0800345#ifdef NV_EXTENSIONS
346 case 5253: return "ViewportMaskNV";
347 case 5257: return "SecondaryPositionNV";
348 case 5258: return "SecondaryViewportMaskNV";
John Kessenich42e33c92017-02-27 01:50:28 -0700349 case 5261: return "PositionPerViewNV";
350 case 5262: return "ViewportMaskPerViewNV";
chaoc771d89f2017-01-13 01:10:53 -0800351#endif
John Kessenich6c8aaac2017-02-27 01:20:51 -0700352
353 case BuiltInCeiling:
354 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600355 }
356}
357
John Kessenich55e7d112015-11-15 21:33:39 -0700358const int DimensionCeiling = 7;
John Kessenich140f3df2015-06-26 16:58:36 -0600359
360const char* DimensionString(int dim)
361{
362 switch (dim) {
363 case 0: return "1D";
364 case 1: return "2D";
365 case 2: return "3D";
366 case 3: return "Cube";
367 case 4: return "Rect";
368 case 5: return "Buffer";
John Kessenich55e7d112015-11-15 21:33:39 -0700369 case 6: return "SubpassData";
John Kessenich140f3df2015-06-26 16:58:36 -0600370
371 case DimensionCeiling:
372 default: return "Bad";
373 }
374}
375
376const int SamplerAddressingModeCeiling = 5;
377
378const char* SamplerAddressingModeString(int mode)
379{
380 switch (mode) {
381 case 0: return "None";
382 case 1: return "ClampToEdge";
383 case 2: return "Clamp";
384 case 3: return "Repeat";
385 case 4: return "RepeatMirrored";
386
387 case SamplerAddressingModeCeiling:
388 default: return "Bad";
389 }
390}
391
392const int SamplerFilterModeCeiling = 2;
393
394const char* SamplerFilterModeString(int mode)
395{
396 switch (mode) {
397 case 0: return "Nearest";
398 case 1: return "Linear";
399
400 case SamplerFilterModeCeiling:
401 default: return "Bad";
402 }
403}
404
John Kessenich5e4b1242015-08-06 22:53:06 -0600405const int ImageFormatCeiling = 40;
406
407const char* ImageFormatString(int format)
408{
409 switch (format) {
410 case 0: return "Unknown";
411
412 // ES/Desktop float
413 case 1: return "Rgba32f";
414 case 2: return "Rgba16f";
415 case 3: return "R32f";
416 case 4: return "Rgba8";
417 case 5: return "Rgba8Snorm";
418
419 // Desktop float
420 case 6: return "Rg32f";
421 case 7: return "Rg16f";
422 case 8: return "R11fG11fB10f";
423 case 9: return "R16f";
424 case 10: return "Rgba16";
425 case 11: return "Rgb10A2";
426 case 12: return "Rg16";
427 case 13: return "Rg8";
428 case 14: return "R16";
429 case 15: return "R8";
430 case 16: return "Rgba16Snorm";
431 case 17: return "Rg16Snorm";
432 case 18: return "Rg8Snorm";
433 case 19: return "R16Snorm";
434 case 20: return "R8Snorm";
435
436 // ES/Desktop int
437 case 21: return "Rgba32i";
438 case 22: return "Rgba16i";
439 case 23: return "Rgba8i";
440 case 24: return "R32i";
441
442 // Desktop int
443 case 25: return "Rg32i";
444 case 26: return "Rg16i";
445 case 27: return "Rg8i";
446 case 28: return "R16i";
447 case 29: return "R8i";
448
449 // ES/Desktop uint
450 case 30: return "Rgba32ui";
451 case 31: return "Rgba16ui";
452 case 32: return "Rgba8ui";
453 case 33: return "R32ui";
454
455 // Desktop uint
456 case 34: return "Rgb10a2ui";
457 case 35: return "Rg32ui";
458 case 36: return "Rg16ui";
459 case 37: return "Rg8ui";
460 case 38: return "R16ui";
461 case 39: return "R8ui";
462
463 case ImageFormatCeiling:
464 default:
465 return "Bad";
466 }
467}
468
469const int ImageChannelOrderCeiling = 19;
470
471const char* ImageChannelOrderString(int format)
472{
473 switch (format) {
474 case 0: return "R";
475 case 1: return "A";
476 case 2: return "RG";
477 case 3: return "RA";
478 case 4: return "RGB";
479 case 5: return "RGBA";
480 case 6: return "BGRA";
481 case 7: return "ARGB";
482 case 8: return "Intensity";
483 case 9: return "Luminance";
484 case 10: return "Rx";
485 case 11: return "RGx";
486 case 12: return "RGBx";
487 case 13: return "Depth";
488 case 14: return "DepthStencil";
489 case 15: return "sRGB";
490 case 16: return "sRGBx";
491 case 17: return "sRGBA";
492 case 18: return "sBGRA";
493
494 case ImageChannelOrderCeiling:
495 default:
496 return "Bad";
497 }
498}
499
John Kessenich55e7d112015-11-15 21:33:39 -0700500const int ImageChannelDataTypeCeiling = 17;
John Kessenich5e4b1242015-08-06 22:53:06 -0600501
502const char* ImageChannelDataTypeString(int type)
503{
504 switch (type)
505 {
506 case 0: return "SnormInt8";
507 case 1: return "SnormInt16";
508 case 2: return "UnormInt8";
509 case 3: return "UnormInt16";
510 case 4: return "UnormShort565";
511 case 5: return "UnormShort555";
512 case 6: return "UnormInt101010";
513 case 7: return "SignedInt8";
514 case 8: return "SignedInt16";
515 case 9: return "SignedInt32";
516 case 10: return "UnsignedInt8";
517 case 11: return "UnsignedInt16";
518 case 12: return "UnsignedInt32";
519 case 13: return "HalfFloat";
520 case 14: return "Float";
521 case 15: return "UnormInt24";
John Kessenich55e7d112015-11-15 21:33:39 -0700522 case 16: return "UnormInt101010_2";
John Kessenich5e4b1242015-08-06 22:53:06 -0600523
524 case ImageChannelDataTypeCeiling:
525 default:
526 return "Bad";
527 }
528}
529
John Kessenich55e7d112015-11-15 21:33:39 -0700530const int ImageOperandsCeiling = 8;
John Kessenich5e4b1242015-08-06 22:53:06 -0600531
532const char* ImageOperandsString(int format)
533{
534 switch (format) {
535 case 0: return "Bias";
536 case 1: return "Lod";
537 case 2: return "Grad";
538 case 3: return "ConstOffset";
539 case 4: return "Offset";
540 case 5: return "ConstOffsets";
541 case 6: return "Sample";
John Kessenich55e7d112015-11-15 21:33:39 -0700542 case 7: return "MinLod";
John Kessenich5e4b1242015-08-06 22:53:06 -0600543
544 case ImageOperandsCeiling:
545 default:
546 return "Bad";
547 }
548}
549
John Kessenich140f3df2015-06-26 16:58:36 -0600550const int FPFastMathCeiling = 5;
551
552const char* FPFastMathString(int mode)
553{
554 switch (mode) {
555 case 0: return "NotNaN";
556 case 1: return "NotInf";
557 case 2: return "NSZ";
558 case 3: return "AllowRecip";
559 case 4: return "Fast";
560
561 case FPFastMathCeiling:
562 default: return "Bad";
563 }
564}
565
566const int FPRoundingModeCeiling = 4;
567
568const char* FPRoundingModeString(int mode)
569{
570 switch (mode) {
571 case 0: return "RTE";
572 case 1: return "RTZ";
573 case 2: return "RTP";
574 case 3: return "RTN";
575
576 case FPRoundingModeCeiling:
577 default: return "Bad";
578 }
579}
580
581const int LinkageTypeCeiling = 2;
582
583const char* LinkageTypeString(int type)
584{
585 switch (type) {
586 case 0: return "Export";
587 case 1: return "Import";
588
589 case LinkageTypeCeiling:
590 default: return "Bad";
591 }
592}
593
John Kessenich5e4b1242015-08-06 22:53:06 -0600594const int FuncParamAttrCeiling = 8;
John Kessenich140f3df2015-06-26 16:58:36 -0600595
596const char* FuncParamAttrString(int attr)
597{
598 switch (attr) {
599 case 0: return "Zext";
600 case 1: return "Sext";
601 case 2: return "ByVal";
602 case 3: return "Sret";
603 case 4: return "NoAlias";
604 case 5: return "NoCapture";
John Kessenich5e4b1242015-08-06 22:53:06 -0600605 case 6: return "NoWrite";
606 case 7: return "NoReadWrite";
John Kessenich140f3df2015-06-26 16:58:36 -0600607
608 case FuncParamAttrCeiling:
609 default: return "Bad";
610 }
611}
612
613const int AccessQualifierCeiling = 3;
614
615const char* AccessQualifierString(int attr)
616{
617 switch (attr) {
618 case 0: return "ReadOnly";
619 case 1: return "WriteOnly";
620 case 2: return "ReadWrite";
621
622 case AccessQualifierCeiling:
623 default: return "Bad";
624 }
625}
626
627const int SelectControlCeiling = 2;
628
629const char* SelectControlString(int cont)
630{
631 switch (cont) {
632 case 0: return "Flatten";
633 case 1: return "DontFlatten";
634
635 case SelectControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600636 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600637 }
638}
639
Rex Xu57e65922017-07-04 23:23:40 +0800640const int LoopControlCeiling = 4;
John Kessenich140f3df2015-06-26 16:58:36 -0600641
642const char* LoopControlString(int cont)
643{
644 switch (cont) {
John Kessenich5e4b1242015-08-06 22:53:06 -0600645 case 0: return "Unroll";
646 case 1: return "DontUnroll";
Rex Xu57e65922017-07-04 23:23:40 +0800647 case 2: return "DependencyInfinite";
648 case 3: return "DependencyLength";
John Kessenich140f3df2015-06-26 16:58:36 -0600649
650 case LoopControlCeiling:
John Kessenich5e4b1242015-08-06 22:53:06 -0600651 default: return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -0600652 }
653}
654
655const int FunctionControlCeiling = 4;
656
657const char* FunctionControlString(int cont)
658{
659 switch (cont) {
660 case 0: return "Inline";
661 case 1: return "DontInline";
662 case 2: return "Pure";
663 case 3: return "Const";
664
665 case FunctionControlCeiling:
666 default: return "Bad";
667 }
668}
669
John Kessenich55e7d112015-11-15 21:33:39 -0700670const int MemorySemanticsCeiling = 12;
John Kessenich140f3df2015-06-26 16:58:36 -0600671
672const char* MemorySemanticsString(int mem)
673{
John Kessenich55e7d112015-11-15 21:33:39 -0700674 // Note: No bits set (None) means "Relaxed"
John Kessenich140f3df2015-06-26 16:58:36 -0600675 switch (mem) {
John Kessenich55e7d112015-11-15 21:33:39 -0700676 case 0: return "Bad"; // Note: this is a placeholder for 'Consume'
677 case 1: return "Acquire";
678 case 2: return "Release";
679 case 3: return "AcquireRelease";
680 case 4: return "SequentiallyConsistent";
681 case 5: return "Bad"; // Note: reserved for future expansion
682 case 6: return "UniformMemory";
683 case 7: return "SubgroupMemory";
684 case 8: return "WorkgroupMemory";
685 case 9: return "CrossWorkgroupMemory";
686 case 10: return "AtomicCounterMemory";
687 case 11: return "ImageMemory";
John Kessenich140f3df2015-06-26 16:58:36 -0600688
689 case MemorySemanticsCeiling:
690 default: return "Bad";
691 }
692}
693
John Kessenich55e7d112015-11-15 21:33:39 -0700694const int MemoryAccessCeiling = 3;
John Kessenich140f3df2015-06-26 16:58:36 -0600695
696const char* MemoryAccessString(int mem)
697{
698 switch (mem) {
699 case 0: return "Volatile";
700 case 1: return "Aligned";
John Kessenich55e7d112015-11-15 21:33:39 -0700701 case 2: return "Nontemporal";
John Kessenich140f3df2015-06-26 16:58:36 -0600702
703 case MemoryAccessCeiling:
704 default: return "Bad";
705 }
706}
707
John Kessenich5e4b1242015-08-06 22:53:06 -0600708const int ScopeCeiling = 5;
John Kessenich140f3df2015-06-26 16:58:36 -0600709
John Kessenich5e4b1242015-08-06 22:53:06 -0600710const char* ScopeString(int mem)
John Kessenich140f3df2015-06-26 16:58:36 -0600711{
712 switch (mem) {
713 case 0: return "CrossDevice";
714 case 1: return "Device";
715 case 2: return "Workgroup";
716 case 3: return "Subgroup";
John Kessenich5e4b1242015-08-06 22:53:06 -0600717 case 4: return "Invocation";
John Kessenich140f3df2015-06-26 16:58:36 -0600718
John Kessenich5e4b1242015-08-06 22:53:06 -0600719 case ScopeCeiling:
John Kessenich140f3df2015-06-26 16:58:36 -0600720 default: return "Bad";
721 }
722}
723
724const int GroupOperationCeiling = 3;
725
726const char* GroupOperationString(int gop)
727{
728
729 switch (gop)
730 {
731 case 0: return "Reduce";
732 case 1: return "InclusiveScan";
733 case 2: return "ExclusiveScan";
734
735 case GroupOperationCeiling:
736 default: return "Bad";
737 }
738}
739
740const int KernelEnqueueFlagsCeiling = 3;
741
742const char* KernelEnqueueFlagsString(int flag)
743{
744 switch (flag)
745 {
746 case 0: return "NoWait";
747 case 1: return "WaitKernel";
748 case 2: return "WaitWorkGroup";
749
750 case KernelEnqueueFlagsCeiling:
751 default: return "Bad";
752 }
753}
754
755const int KernelProfilingInfoCeiling = 1;
756
757const char* KernelProfilingInfoString(int info)
758{
759 switch (info)
760 {
761 case 0: return "CmdExecTime";
762
763 case KernelProfilingInfoCeiling:
764 default: return "Bad";
765 }
766}
767
John Kessenich6c292d32016-02-15 20:58:50 -0700768const int CapabilityCeiling = 58;
John Kessenich5e4b1242015-08-06 22:53:06 -0600769
770const char* CapabilityString(int info)
771{
772 switch (info)
773 {
774 case 0: return "Matrix";
775 case 1: return "Shader";
776 case 2: return "Geometry";
777 case 3: return "Tessellation";
778 case 4: return "Addresses";
779 case 5: return "Linkage";
780 case 6: return "Kernel";
781 case 7: return "Vector16";
782 case 8: return "Float16Buffer";
783 case 9: return "Float16";
784 case 10: return "Float64";
785 case 11: return "Int64";
786 case 12: return "Int64Atomics";
787 case 13: return "ImageBasic";
788 case 14: return "ImageReadWrite";
789 case 15: return "ImageMipmap";
John Kessenich55e7d112015-11-15 21:33:39 -0700790 case 16: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600791 case 17: return "Pipes";
792 case 18: return "Groups";
793 case 19: return "DeviceEnqueue";
794 case 20: return "LiteralSampler";
795 case 21: return "AtomicStorage";
796 case 22: return "Int16";
797 case 23: return "TessellationPointSize";
798 case 24: return "GeometryPointSize";
799 case 25: return "ImageGatherExtended";
John Kessenich55e7d112015-11-15 21:33:39 -0700800 case 26: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600801 case 27: return "StorageImageMultisample";
802 case 28: return "UniformBufferArrayDynamicIndexing";
803 case 29: return "SampledImageArrayDynamicIndexing";
804 case 30: return "StorageBufferArrayDynamicIndexing";
805 case 31: return "StorageImageArrayDynamicIndexing";
806 case 32: return "ClipDistance";
807 case 33: return "CullDistance";
808 case 34: return "ImageCubeArray";
809 case 35: return "SampleRateShading";
John Kessenich55e7d112015-11-15 21:33:39 -0700810 case 36: return "ImageRect";
811 case 37: return "SampledRect";
812 case 38: return "GenericPointer";
813 case 39: return "Int8";
814 case 40: return "InputAttachment";
815 case 41: return "SparseResidency";
816 case 42: return "MinLod";
817 case 43: return "Sampled1D";
818 case 44: return "Image1D";
819 case 45: return "SampledCubeArray";
820 case 46: return "SampledBuffer";
821 case 47: return "ImageBuffer";
822 case 48: return "ImageMSArray";
823 case 49: return "StorageImageExtendedFormats";
824 case 50: return "ImageQuery";
825 case 51: return "DerivativeControl";
826 case 52: return "InterpolationFunction";
827 case 53: return "TransformFeedback";
828 case 54: return "GeometryStreams";
829 case 55: return "StorageImageReadWithoutFormat";
830 case 56: return "StorageImageWriteWithoutFormat";
John Kessenich6c292d32016-02-15 20:58:50 -0700831 case 57: return "MultiViewport";
John Kessenich5e4b1242015-08-06 22:53:06 -0600832
Rex Xu51596642016-09-21 18:56:12 +0800833 case 4423: return "SubgroupBallotKHR";
Rex Xuf3b27472016-07-22 18:15:31 +0800834 case 4427: return "DrawParameters";
Ashwin Kolhec720f3e2017-01-18 14:16:49 -0800835 case 4431: return "SubgroupVoteKHR";
chaoc6e5acae2016-12-20 13:28:52 -0800836
Rex Xuf89ad982017-04-07 23:22:33 +0800837 case 4433: return "StorageUniformBufferBlock16";
838 case 4434: return "StorageUniform16";
839 case 4435: return "StoragePushConstant16";
840 case 4436: return "StorageInputOutput16";
841
John Kessenichd1141842017-04-13 17:08:11 -0600842 case 4437: return "DeviceGroup";
843 case 4439: return "MultiView";
844
Rex Xu225e0fc2016-11-17 17:47:59 +0800845#ifdef AMD_EXTENSIONS
846 case 5009: return "ImageGatherBiasLodAMD";
847#endif
848
chaocc1204522017-06-30 17:14:30 -0700849 case 4447: return "SampleMaskPostDepthCoverage";
chaoc6e5acae2016-12-20 13:28:52 -0800850#ifdef NV_EXTENSIONS
851 case 5251: return "GeometryShaderPassthroughNV";
chaoc771d89f2017-01-13 01:10:53 -0800852 case 5254: return "ShaderViewportIndexLayerNV";
853 case 5255: return "ShaderViewportMaskNV";
854 case 5259: return "ShaderStereoViewNV";
John Kessenich42e33c92017-02-27 01:50:28 -0700855 case 5260: return "PerViewAttributesNV";
chaoc6e5acae2016-12-20 13:28:52 -0800856#endif
857
John Kessenich6c8aaac2017-02-27 01:20:51 -0700858 case CapabilityCeiling:
859 default: return "Bad";
John Kessenich5e4b1242015-08-06 22:53:06 -0600860 }
861}
862
John Kessenich140f3df2015-06-26 16:58:36 -0600863const char* OpcodeString(int op)
864{
865 switch (op) {
866 case 0: return "OpNop";
John Kessenich5e4b1242015-08-06 22:53:06 -0600867 case 1: return "OpUndef";
John Kessenich55e7d112015-11-15 21:33:39 -0700868 case 2: return "OpSourceContinued";
John Kessenich5e4b1242015-08-06 22:53:06 -0600869 case 3: return "OpSource";
870 case 4: return "OpSourceExtension";
871 case 5: return "OpName";
872 case 6: return "OpMemberName";
873 case 7: return "OpString";
874 case 8: return "OpLine";
875 case 9: return "Bad";
876 case 10: return "OpExtension";
877 case 11: return "OpExtInstImport";
878 case 12: return "OpExtInst";
879 case 13: return "Bad";
880 case 14: return "OpMemoryModel";
881 case 15: return "OpEntryPoint";
882 case 16: return "OpExecutionMode";
883 case 17: return "OpCapability";
884 case 18: return "Bad";
885 case 19: return "OpTypeVoid";
886 case 20: return "OpTypeBool";
887 case 21: return "OpTypeInt";
888 case 22: return "OpTypeFloat";
889 case 23: return "OpTypeVector";
890 case 24: return "OpTypeMatrix";
891 case 25: return "OpTypeImage";
892 case 26: return "OpTypeSampler";
893 case 27: return "OpTypeSampledImage";
894 case 28: return "OpTypeArray";
895 case 29: return "OpTypeRuntimeArray";
896 case 30: return "OpTypeStruct";
897 case 31: return "OpTypeOpaque";
898 case 32: return "OpTypePointer";
899 case 33: return "OpTypeFunction";
900 case 34: return "OpTypeEvent";
901 case 35: return "OpTypeDeviceEvent";
902 case 36: return "OpTypeReserveId";
903 case 37: return "OpTypeQueue";
904 case 38: return "OpTypePipe";
John Kessenich55e7d112015-11-15 21:33:39 -0700905 case 39: return "OpTypeForwardPointer";
John Kessenich5e4b1242015-08-06 22:53:06 -0600906 case 40: return "Bad";
907 case 41: return "OpConstantTrue";
908 case 42: return "OpConstantFalse";
909 case 43: return "OpConstant";
910 case 44: return "OpConstantComposite";
911 case 45: return "OpConstantSampler";
912 case 46: return "OpConstantNull";
913 case 47: return "Bad";
914 case 48: return "OpSpecConstantTrue";
915 case 49: return "OpSpecConstantFalse";
916 case 50: return "OpSpecConstant";
917 case 51: return "OpSpecConstantComposite";
918 case 52: return "OpSpecConstantOp";
919 case 53: return "Bad";
920 case 54: return "OpFunction";
921 case 55: return "OpFunctionParameter";
922 case 56: return "OpFunctionEnd";
923 case 57: return "OpFunctionCall";
924 case 58: return "Bad";
925 case 59: return "OpVariable";
926 case 60: return "OpImageTexelPointer";
927 case 61: return "OpLoad";
928 case 62: return "OpStore";
929 case 63: return "OpCopyMemory";
930 case 64: return "OpCopyMemorySized";
931 case 65: return "OpAccessChain";
932 case 66: return "OpInBoundsAccessChain";
933 case 67: return "OpPtrAccessChain";
934 case 68: return "OpArrayLength";
935 case 69: return "OpGenericPtrMemSemantics";
John Kessenich55e7d112015-11-15 21:33:39 -0700936 case 70: return "OpInBoundsPtrAccessChain";
John Kessenich5e4b1242015-08-06 22:53:06 -0600937 case 71: return "OpDecorate";
938 case 72: return "OpMemberDecorate";
939 case 73: return "OpDecorationGroup";
940 case 74: return "OpGroupDecorate";
941 case 75: return "OpGroupMemberDecorate";
942 case 76: return "Bad";
943 case 77: return "OpVectorExtractDynamic";
944 case 78: return "OpVectorInsertDynamic";
945 case 79: return "OpVectorShuffle";
946 case 80: return "OpCompositeConstruct";
947 case 81: return "OpCompositeExtract";
948 case 82: return "OpCompositeInsert";
949 case 83: return "OpCopyObject";
950 case 84: return "OpTranspose";
951 case 85: return "Bad";
952 case 86: return "OpSampledImage";
953 case 87: return "OpImageSampleImplicitLod";
954 case 88: return "OpImageSampleExplicitLod";
955 case 89: return "OpImageSampleDrefImplicitLod";
956 case 90: return "OpImageSampleDrefExplicitLod";
957 case 91: return "OpImageSampleProjImplicitLod";
958 case 92: return "OpImageSampleProjExplicitLod";
959 case 93: return "OpImageSampleProjDrefImplicitLod";
960 case 94: return "OpImageSampleProjDrefExplicitLod";
961 case 95: return "OpImageFetch";
962 case 96: return "OpImageGather";
963 case 97: return "OpImageDrefGather";
964 case 98: return "OpImageRead";
965 case 99: return "OpImageWrite";
John Kessenich55e7d112015-11-15 21:33:39 -0700966 case 100: return "OpImage";
John Kessenich5e4b1242015-08-06 22:53:06 -0600967 case 101: return "OpImageQueryFormat";
968 case 102: return "OpImageQueryOrder";
969 case 103: return "OpImageQuerySizeLod";
970 case 104: return "OpImageQuerySize";
971 case 105: return "OpImageQueryLod";
972 case 106: return "OpImageQueryLevels";
973 case 107: return "OpImageQuerySamples";
974 case 108: return "Bad";
975 case 109: return "OpConvertFToU";
976 case 110: return "OpConvertFToS";
977 case 111: return "OpConvertSToF";
978 case 112: return "OpConvertUToF";
979 case 113: return "OpUConvert";
980 case 114: return "OpSConvert";
981 case 115: return "OpFConvert";
982 case 116: return "OpQuantizeToF16";
983 case 117: return "OpConvertPtrToU";
984 case 118: return "OpSatConvertSToU";
985 case 119: return "OpSatConvertUToS";
986 case 120: return "OpConvertUToPtr";
987 case 121: return "OpPtrCastToGeneric";
988 case 122: return "OpGenericCastToPtr";
989 case 123: return "OpGenericCastToPtrExplicit";
990 case 124: return "OpBitcast";
991 case 125: return "Bad";
992 case 126: return "OpSNegate";
993 case 127: return "OpFNegate";
994 case 128: return "OpIAdd";
995 case 129: return "OpFAdd";
996 case 130: return "OpISub";
997 case 131: return "OpFSub";
998 case 132: return "OpIMul";
999 case 133: return "OpFMul";
1000 case 134: return "OpUDiv";
1001 case 135: return "OpSDiv";
1002 case 136: return "OpFDiv";
1003 case 137: return "OpUMod";
1004 case 138: return "OpSRem";
1005 case 139: return "OpSMod";
1006 case 140: return "OpFRem";
1007 case 141: return "OpFMod";
1008 case 142: return "OpVectorTimesScalar";
1009 case 143: return "OpMatrixTimesScalar";
1010 case 144: return "OpVectorTimesMatrix";
1011 case 145: return "OpMatrixTimesVector";
1012 case 146: return "OpMatrixTimesMatrix";
1013 case 147: return "OpOuterProduct";
1014 case 148: return "OpDot";
1015 case 149: return "OpIAddCarry";
1016 case 150: return "OpISubBorrow";
John Kessenich55e7d112015-11-15 21:33:39 -07001017 case 151: return "OpUMulExtended";
1018 case 152: return "OpSMulExtended";
John Kessenich5e4b1242015-08-06 22:53:06 -06001019 case 153: return "Bad";
1020 case 154: return "OpAny";
1021 case 155: return "OpAll";
1022 case 156: return "OpIsNan";
1023 case 157: return "OpIsInf";
1024 case 158: return "OpIsFinite";
1025 case 159: return "OpIsNormal";
1026 case 160: return "OpSignBitSet";
1027 case 161: return "OpLessOrGreater";
1028 case 162: return "OpOrdered";
1029 case 163: return "OpUnordered";
1030 case 164: return "OpLogicalEqual";
1031 case 165: return "OpLogicalNotEqual";
1032 case 166: return "OpLogicalOr";
1033 case 167: return "OpLogicalAnd";
1034 case 168: return "OpLogicalNot";
1035 case 169: return "OpSelect";
1036 case 170: return "OpIEqual";
1037 case 171: return "OpINotEqual";
1038 case 172: return "OpUGreaterThan";
1039 case 173: return "OpSGreaterThan";
1040 case 174: return "OpUGreaterThanEqual";
1041 case 175: return "OpSGreaterThanEqual";
1042 case 176: return "OpULessThan";
1043 case 177: return "OpSLessThan";
1044 case 178: return "OpULessThanEqual";
1045 case 179: return "OpSLessThanEqual";
1046 case 180: return "OpFOrdEqual";
1047 case 181: return "OpFUnordEqual";
1048 case 182: return "OpFOrdNotEqual";
1049 case 183: return "OpFUnordNotEqual";
1050 case 184: return "OpFOrdLessThan";
1051 case 185: return "OpFUnordLessThan";
1052 case 186: return "OpFOrdGreaterThan";
1053 case 187: return "OpFUnordGreaterThan";
1054 case 188: return "OpFOrdLessThanEqual";
1055 case 189: return "OpFUnordLessThanEqual";
1056 case 190: return "OpFOrdGreaterThanEqual";
1057 case 191: return "OpFUnordGreaterThanEqual";
1058 case 192: return "Bad";
1059 case 193: return "Bad";
1060 case 194: return "OpShiftRightLogical";
1061 case 195: return "OpShiftRightArithmetic";
1062 case 196: return "OpShiftLeftLogical";
1063 case 197: return "OpBitwiseOr";
1064 case 198: return "OpBitwiseXor";
1065 case 199: return "OpBitwiseAnd";
1066 case 200: return "OpNot";
1067 case 201: return "OpBitFieldInsert";
1068 case 202: return "OpBitFieldSExtract";
1069 case 203: return "OpBitFieldUExtract";
1070 case 204: return "OpBitReverse";
1071 case 205: return "OpBitCount";
1072 case 206: return "Bad";
1073 case 207: return "OpDPdx";
1074 case 208: return "OpDPdy";
1075 case 209: return "OpFwidth";
1076 case 210: return "OpDPdxFine";
1077 case 211: return "OpDPdyFine";
1078 case 212: return "OpFwidthFine";
1079 case 213: return "OpDPdxCoarse";
1080 case 214: return "OpDPdyCoarse";
1081 case 215: return "OpFwidthCoarse";
1082 case 216: return "Bad";
1083 case 217: return "Bad";
1084 case 218: return "OpEmitVertex";
1085 case 219: return "OpEndPrimitive";
1086 case 220: return "OpEmitStreamVertex";
1087 case 221: return "OpEndStreamPrimitive";
1088 case 222: return "Bad";
1089 case 223: return "Bad";
1090 case 224: return "OpControlBarrier";
1091 case 225: return "OpMemoryBarrier";
1092 case 226: return "Bad";
1093 case 227: return "OpAtomicLoad";
1094 case 228: return "OpAtomicStore";
1095 case 229: return "OpAtomicExchange";
1096 case 230: return "OpAtomicCompareExchange";
1097 case 231: return "OpAtomicCompareExchangeWeak";
1098 case 232: return "OpAtomicIIncrement";
1099 case 233: return "OpAtomicIDecrement";
1100 case 234: return "OpAtomicIAdd";
1101 case 235: return "OpAtomicISub";
1102 case 236: return "OpAtomicSMin";
1103 case 237: return "OpAtomicUMin";
1104 case 238: return "OpAtomicSMax";
1105 case 239: return "OpAtomicUMax";
1106 case 240: return "OpAtomicAnd";
1107 case 241: return "OpAtomicOr";
1108 case 242: return "OpAtomicXor";
1109 case 243: return "Bad";
1110 case 244: return "Bad";
1111 case 245: return "OpPhi";
1112 case 246: return "OpLoopMerge";
1113 case 247: return "OpSelectionMerge";
1114 case 248: return "OpLabel";
1115 case 249: return "OpBranch";
1116 case 250: return "OpBranchConditional";
1117 case 251: return "OpSwitch";
1118 case 252: return "OpKill";
1119 case 253: return "OpReturn";
1120 case 254: return "OpReturnValue";
1121 case 255: return "OpUnreachable";
1122 case 256: return "OpLifetimeStart";
1123 case 257: return "OpLifetimeStop";
1124 case 258: return "Bad";
John Kessenich55e7d112015-11-15 21:33:39 -07001125 case 259: return "OpGroupAsyncCopy";
1126 case 260: return "OpGroupWaitEvents";
John Kessenich5e4b1242015-08-06 22:53:06 -06001127 case 261: return "OpGroupAll";
1128 case 262: return "OpGroupAny";
1129 case 263: return "OpGroupBroadcast";
1130 case 264: return "OpGroupIAdd";
1131 case 265: return "OpGroupFAdd";
1132 case 266: return "OpGroupFMin";
1133 case 267: return "OpGroupUMin";
1134 case 268: return "OpGroupSMin";
1135 case 269: return "OpGroupFMax";
1136 case 270: return "OpGroupUMax";
1137 case 271: return "OpGroupSMax";
1138 case 272: return "Bad";
1139 case 273: return "Bad";
1140 case 274: return "OpReadPipe";
1141 case 275: return "OpWritePipe";
1142 case 276: return "OpReservedReadPipe";
1143 case 277: return "OpReservedWritePipe";
1144 case 278: return "OpReserveReadPipePackets";
1145 case 279: return "OpReserveWritePipePackets";
1146 case 280: return "OpCommitReadPipe";
1147 case 281: return "OpCommitWritePipe";
1148 case 282: return "OpIsValidReserveId";
1149 case 283: return "OpGetNumPipePackets";
1150 case 284: return "OpGetMaxPipePackets";
1151 case 285: return "OpGroupReserveReadPipePackets";
1152 case 286: return "OpGroupReserveWritePipePackets";
1153 case 287: return "OpGroupCommitReadPipe";
1154 case 288: return "OpGroupCommitWritePipe";
1155 case 289: return "Bad";
1156 case 290: return "Bad";
1157 case 291: return "OpEnqueueMarker";
1158 case 292: return "OpEnqueueKernel";
1159 case 293: return "OpGetKernelNDrangeSubGroupCount";
1160 case 294: return "OpGetKernelNDrangeMaxSubGroupSize";
1161 case 295: return "OpGetKernelWorkGroupSize";
1162 case 296: return "OpGetKernelPreferredWorkGroupSizeMultiple";
1163 case 297: return "OpRetainEvent";
1164 case 298: return "OpReleaseEvent";
1165 case 299: return "OpCreateUserEvent";
1166 case 300: return "OpIsValidEvent";
1167 case 301: return "OpSetUserEventStatus";
1168 case 302: return "OpCaptureEventProfilingInfo";
1169 case 303: return "OpGetDefaultQueue";
1170 case 304: return "OpBuildNDRange";
John Kessenich55e7d112015-11-15 21:33:39 -07001171 case 305: return "OpImageSparseSampleImplicitLod";
1172 case 306: return "OpImageSparseSampleExplicitLod";
1173 case 307: return "OpImageSparseSampleDrefImplicitLod";
1174 case 308: return "OpImageSparseSampleDrefExplicitLod";
1175 case 309: return "OpImageSparseSampleProjImplicitLod";
1176 case 310: return "OpImageSparseSampleProjExplicitLod";
1177 case 311: return "OpImageSparseSampleProjDrefImplicitLod";
1178 case 312: return "OpImageSparseSampleProjDrefExplicitLod";
1179 case 313: return "OpImageSparseFetch";
1180 case 314: return "OpImageSparseGather";
1181 case 315: return "OpImageSparseDrefGather";
1182 case 316: return "OpImageSparseTexelsResident";
1183 case 317: return "OpNoLine";
1184 case 318: return "OpAtomicFlagTestAndSet";
1185 case 319: return "OpAtomicFlagClear";
John Kessenich6c292d32016-02-15 20:58:50 -07001186 case 320: return "OpImageSparseRead";
John Kessenich140f3df2015-06-26 16:58:36 -06001187
Rex Xu51596642016-09-21 18:56:12 +08001188 case 4421: return "OpSubgroupBallotKHR";
1189 case 4422: return "OpSubgroupFirstInvocationKHR";
Maciej Jesionowski5227b6d2017-02-17 13:45:08 +01001190 case 4428: return "OpSubgroupAllKHR";
1191 case 4429: return "OpSubgroupAnyKHR";
Ashwin Kolhec720f3e2017-01-18 14:16:49 -08001192 case 4430: return "OpSubgroupAllEqualKHR";
chaocf200da82016-12-20 12:44:35 -08001193 case 4432: return "OpSubgroupReadInvocationKHR";
Rex Xu51596642016-09-21 18:56:12 +08001194
Rex Xu9d93a232016-05-05 12:30:44 +08001195#ifdef AMD_EXTENSIONS
1196 case 5000: return "OpGroupIAddNonUniformAMD";
1197 case 5001: return "OpGroupFAddNonUniformAMD";
1198 case 5002: return "OpGroupFMinNonUniformAMD";
1199 case 5003: return "OpGroupUMinNonUniformAMD";
1200 case 5004: return "OpGroupSMinNonUniformAMD";
1201 case 5005: return "OpGroupFMaxNonUniformAMD";
1202 case 5006: return "OpGroupUMaxNonUniformAMD";
1203 case 5007: return "OpGroupSMaxNonUniformAMD";
1204#endif
John Kessenich6c8aaac2017-02-27 01:20:51 -07001205
1206 case OpcodeCeiling:
1207 default:
1208 return "Bad";
John Kessenich140f3df2015-06-26 16:58:36 -06001209 }
1210}
1211
1212// The set of objects that hold all the instruction/operand
1213// parameterization information.
Rex Xu9d93a232016-05-05 12:30:44 +08001214InstructionParameters InstructionDesc[OpCodeMask + 1];
John Kessenich140f3df2015-06-26 16:58:36 -06001215OperandParameters ExecutionModeOperands[ExecutionModeCeiling];
1216OperandParameters DecorationOperands[DecorationCeiling];
1217
1218EnumDefinition OperandClassParams[OperandCount];
1219EnumParameters ExecutionModelParams[ExecutionModelCeiling];
1220EnumParameters AddressingParams[AddressingModelCeiling];
1221EnumParameters MemoryParams[MemoryModelCeiling];
1222EnumParameters ExecutionModeParams[ExecutionModeCeiling];
1223EnumParameters StorageParams[StorageClassCeiling];
1224EnumParameters SamplerAddressingModeParams[SamplerAddressingModeCeiling];
1225EnumParameters SamplerFilterModeParams[SamplerFilterModeCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001226EnumParameters ImageFormatParams[ImageFormatCeiling];
1227EnumParameters ImageChannelOrderParams[ImageChannelOrderCeiling];
1228EnumParameters ImageChannelDataTypeParams[ImageChannelDataTypeCeiling];
1229EnumParameters ImageOperandsParams[ImageOperandsCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001230EnumParameters FPFastMathParams[FPFastMathCeiling];
1231EnumParameters FPRoundingModeParams[FPRoundingModeCeiling];
1232EnumParameters LinkageTypeParams[LinkageTypeCeiling];
1233EnumParameters DecorationParams[DecorationCeiling];
1234EnumParameters BuiltInParams[BuiltInCeiling];
1235EnumParameters DimensionalityParams[DimensionCeiling];
1236EnumParameters FuncParamAttrParams[FuncParamAttrCeiling];
1237EnumParameters AccessQualifierParams[AccessQualifierCeiling];
1238EnumParameters GroupOperationParams[GroupOperationCeiling];
1239EnumParameters LoopControlParams[FunctionControlCeiling];
1240EnumParameters SelectionControlParams[SelectControlCeiling];
1241EnumParameters FunctionControlParams[FunctionControlCeiling];
1242EnumParameters MemorySemanticsParams[MemorySemanticsCeiling];
1243EnumParameters MemoryAccessParams[MemoryAccessCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001244EnumParameters ScopeParams[ScopeCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001245EnumParameters KernelEnqueueFlagsParams[KernelEnqueueFlagsCeiling];
1246EnumParameters KernelProfilingInfoParams[KernelProfilingInfoCeiling];
John Kessenich5e4b1242015-08-06 22:53:06 -06001247EnumParameters CapabilityParams[CapabilityCeiling];
John Kessenich140f3df2015-06-26 16:58:36 -06001248
1249// Set up all the parameterizing descriptions of the opcodes, operands, etc.
1250void Parameterize()
1251{
John Kessenich140f3df2015-06-26 16:58:36 -06001252 // only do this once.
John Kessenich5e4b1242015-08-06 22:53:06 -06001253 static bool initialized = false;
John Kessenich140f3df2015-06-26 16:58:36 -06001254 if (initialized)
1255 return;
John Kessenich140f3df2015-06-26 16:58:36 -06001256 initialized = true;
1257
1258 // Exceptions to having a result <id> and a resulting type <id>.
1259 // (Everything is initialized to have both).
1260
1261 InstructionDesc[OpNop].setResultAndType(false, false);
1262 InstructionDesc[OpSource].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001263 InstructionDesc[OpSourceContinued].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001264 InstructionDesc[OpSourceExtension].setResultAndType(false, false);
1265 InstructionDesc[OpExtension].setResultAndType(false, false);
1266 InstructionDesc[OpExtInstImport].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001267 InstructionDesc[OpCapability].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001268 InstructionDesc[OpMemoryModel].setResultAndType(false, false);
1269 InstructionDesc[OpEntryPoint].setResultAndType(false, false);
1270 InstructionDesc[OpExecutionMode].setResultAndType(false, false);
1271 InstructionDesc[OpTypeVoid].setResultAndType(true, false);
1272 InstructionDesc[OpTypeBool].setResultAndType(true, false);
1273 InstructionDesc[OpTypeInt].setResultAndType(true, false);
1274 InstructionDesc[OpTypeFloat].setResultAndType(true, false);
1275 InstructionDesc[OpTypeVector].setResultAndType(true, false);
1276 InstructionDesc[OpTypeMatrix].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001277 InstructionDesc[OpTypeImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001278 InstructionDesc[OpTypeSampler].setResultAndType(true, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001279 InstructionDesc[OpTypeSampledImage].setResultAndType(true, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001280 InstructionDesc[OpTypeArray].setResultAndType(true, false);
1281 InstructionDesc[OpTypeRuntimeArray].setResultAndType(true, false);
1282 InstructionDesc[OpTypeStruct].setResultAndType(true, false);
1283 InstructionDesc[OpTypeOpaque].setResultAndType(true, false);
1284 InstructionDesc[OpTypePointer].setResultAndType(true, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001285 InstructionDesc[OpTypeForwardPointer].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001286 InstructionDesc[OpTypeFunction].setResultAndType(true, false);
1287 InstructionDesc[OpTypeEvent].setResultAndType(true, false);
1288 InstructionDesc[OpTypeDeviceEvent].setResultAndType(true, false);
1289 InstructionDesc[OpTypeReserveId].setResultAndType(true, false);
1290 InstructionDesc[OpTypeQueue].setResultAndType(true, false);
1291 InstructionDesc[OpTypePipe].setResultAndType(true, false);
1292 InstructionDesc[OpFunctionEnd].setResultAndType(false, false);
1293 InstructionDesc[OpStore].setResultAndType(false, false);
John Kessenich5e4b1242015-08-06 22:53:06 -06001294 InstructionDesc[OpImageWrite].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001295 InstructionDesc[OpDecorationGroup].setResultAndType(true, false);
1296 InstructionDesc[OpDecorate].setResultAndType(false, false);
1297 InstructionDesc[OpMemberDecorate].setResultAndType(false, false);
1298 InstructionDesc[OpGroupDecorate].setResultAndType(false, false);
1299 InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false);
1300 InstructionDesc[OpName].setResultAndType(false, false);
1301 InstructionDesc[OpMemberName].setResultAndType(false, false);
1302 InstructionDesc[OpString].setResultAndType(true, false);
1303 InstructionDesc[OpLine].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001304 InstructionDesc[OpNoLine].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001305 InstructionDesc[OpCopyMemory].setResultAndType(false, false);
1306 InstructionDesc[OpCopyMemorySized].setResultAndType(false, false);
1307 InstructionDesc[OpEmitVertex].setResultAndType(false, false);
1308 InstructionDesc[OpEndPrimitive].setResultAndType(false, false);
1309 InstructionDesc[OpEmitStreamVertex].setResultAndType(false, false);
1310 InstructionDesc[OpEndStreamPrimitive].setResultAndType(false, false);
1311 InstructionDesc[OpControlBarrier].setResultAndType(false, false);
1312 InstructionDesc[OpMemoryBarrier].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001313 InstructionDesc[OpAtomicStore].setResultAndType(false, false);
1314 InstructionDesc[OpLoopMerge].setResultAndType(false, false);
1315 InstructionDesc[OpSelectionMerge].setResultAndType(false, false);
1316 InstructionDesc[OpLabel].setResultAndType(true, false);
1317 InstructionDesc[OpBranch].setResultAndType(false, false);
1318 InstructionDesc[OpBranchConditional].setResultAndType(false, false);
1319 InstructionDesc[OpSwitch].setResultAndType(false, false);
1320 InstructionDesc[OpKill].setResultAndType(false, false);
1321 InstructionDesc[OpReturn].setResultAndType(false, false);
1322 InstructionDesc[OpReturnValue].setResultAndType(false, false);
1323 InstructionDesc[OpUnreachable].setResultAndType(false, false);
1324 InstructionDesc[OpLifetimeStart].setResultAndType(false, false);
1325 InstructionDesc[OpLifetimeStop].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001326 InstructionDesc[OpCommitReadPipe].setResultAndType(false, false);
1327 InstructionDesc[OpCommitWritePipe].setResultAndType(false, false);
1328 InstructionDesc[OpGroupCommitWritePipe].setResultAndType(false, false);
1329 InstructionDesc[OpGroupCommitReadPipe].setResultAndType(false, false);
1330 InstructionDesc[OpCaptureEventProfilingInfo].setResultAndType(false, false);
1331 InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false);
1332 InstructionDesc[OpRetainEvent].setResultAndType(false, false);
1333 InstructionDesc[OpReleaseEvent].setResultAndType(false, false);
John Kessenich55e7d112015-11-15 21:33:39 -07001334 InstructionDesc[OpGroupWaitEvents].setResultAndType(false, false);
1335 InstructionDesc[OpAtomicFlagClear].setResultAndType(false, false);
John Kessenich140f3df2015-06-26 16:58:36 -06001336
1337 // Specific additional context-dependent operands
1338
John Kessenich55e7d112015-11-15 21:33:39 -07001339 ExecutionModeOperands[ExecutionModeInvocations].push(OperandLiteralNumber, "'Number of <<Invocation,invocations>>'");
John Kessenich140f3df2015-06-26 16:58:36 -06001340
1341 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'x size'");
1342 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'y size'");
1343 ExecutionModeOperands[ExecutionModeLocalSize].push(OperandLiteralNumber, "'z size'");
1344
1345 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'x size'");
1346 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'y size'");
1347 ExecutionModeOperands[ExecutionModeLocalSizeHint].push(OperandLiteralNumber, "'z size'");
1348
John Kessenich5e4b1242015-08-06 22:53:06 -06001349 ExecutionModeOperands[ExecutionModeOutputVertices].push(OperandLiteralNumber, "'Vertex count'");
1350 ExecutionModeOperands[ExecutionModeVecTypeHint].push(OperandLiteralNumber, "'Vector type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001351
John Kessenich55e7d112015-11-15 21:33:39 -07001352 DecorationOperands[DecorationStream].push(OperandLiteralNumber, "'Stream Number'");
1353 DecorationOperands[DecorationLocation].push(OperandLiteralNumber, "'Location'");
1354 DecorationOperands[DecorationComponent].push(OperandLiteralNumber, "'Component'");
1355 DecorationOperands[DecorationIndex].push(OperandLiteralNumber, "'Index'");
1356 DecorationOperands[DecorationBinding].push(OperandLiteralNumber, "'Binding Point'");
1357 DecorationOperands[DecorationDescriptorSet].push(OperandLiteralNumber, "'Descriptor Set'");
1358 DecorationOperands[DecorationOffset].push(OperandLiteralNumber, "'Byte Offset'");
1359 DecorationOperands[DecorationXfbBuffer].push(OperandLiteralNumber, "'XFB Buffer Number'");
1360 DecorationOperands[DecorationXfbStride].push(OperandLiteralNumber, "'XFB Stride'");
1361 DecorationOperands[DecorationArrayStride].push(OperandLiteralNumber, "'Array Stride'");
1362 DecorationOperands[DecorationMatrixStride].push(OperandLiteralNumber, "'Matrix Stride'");
John Kessenich140f3df2015-06-26 16:58:36 -06001363 DecorationOperands[DecorationBuiltIn].push(OperandLiteralNumber, "See <<BuiltIn,*BuiltIn*>>");
John Kessenich55e7d112015-11-15 21:33:39 -07001364 DecorationOperands[DecorationFPRoundingMode].push(OperandFPRoundingMode, "'Floating-Point Rounding Mode'");
1365 DecorationOperands[DecorationFPFastMathMode].push(OperandFPFastMath, "'Fast-Math Mode'");
1366 DecorationOperands[DecorationLinkageAttributes].push(OperandLiteralString, "'Name'");
1367 DecorationOperands[DecorationLinkageAttributes].push(OperandLinkageType, "'Linkage Type'");
1368 DecorationOperands[DecorationFuncParamAttr].push(OperandFuncParamAttr, "'Function Parameter Attribute'");
1369 DecorationOperands[DecorationSpecId].push(OperandLiteralNumber, "'Specialization Constant ID'");
1370 DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'");
1371 DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06001372
1373 OperandClassParams[OperandSource].set(SourceLanguageCeiling, SourceString, 0);
1374 OperandClassParams[OperandExecutionModel].set(ExecutionModelCeiling, ExecutionModelString, ExecutionModelParams);
1375 OperandClassParams[OperandAddressing].set(AddressingModelCeiling, AddressingString, AddressingParams);
1376 OperandClassParams[OperandMemory].set(MemoryModelCeiling, MemoryString, MemoryParams);
1377 OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams);
1378 OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands);
1379 OperandClassParams[OperandStorage].set(StorageClassCeiling, StorageClassString, StorageParams);
1380 OperandClassParams[OperandDimensionality].set(DimensionCeiling, DimensionString, DimensionalityParams);
1381 OperandClassParams[OperandSamplerAddressingMode].set(SamplerAddressingModeCeiling, SamplerAddressingModeString, SamplerAddressingModeParams);
1382 OperandClassParams[OperandSamplerFilterMode].set(SamplerFilterModeCeiling, SamplerFilterModeString, SamplerFilterModeParams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001383 OperandClassParams[OperandSamplerImageFormat].set(ImageFormatCeiling, ImageFormatString, ImageFormatParams);
1384 OperandClassParams[OperandImageChannelOrder].set(ImageChannelOrderCeiling, ImageChannelOrderString, ImageChannelOrderParams);
1385 OperandClassParams[OperandImageChannelDataType].set(ImageChannelDataTypeCeiling, ImageChannelDataTypeString, ImageChannelDataTypeParams);
1386 OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true);
John Kessenich140f3df2015-06-26 16:58:36 -06001387 OperandClassParams[OperandFPFastMath].set(FPFastMathCeiling, FPFastMathString, FPFastMathParams, true);
1388 OperandClassParams[OperandFPRoundingMode].set(FPRoundingModeCeiling, FPRoundingModeString, FPRoundingModeParams);
1389 OperandClassParams[OperandLinkageType].set(LinkageTypeCeiling, LinkageTypeString, LinkageTypeParams);
1390 OperandClassParams[OperandFuncParamAttr].set(FuncParamAttrCeiling, FuncParamAttrString, FuncParamAttrParams);
1391 OperandClassParams[OperandAccessQualifier].set(AccessQualifierCeiling, AccessQualifierString, AccessQualifierParams);
1392 OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams);
1393 OperandClassParams[OperandDecoration].setOperands(DecorationOperands);
1394 OperandClassParams[OperandBuiltIn].set(BuiltInCeiling, BuiltInString, BuiltInParams);
1395 OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true);
1396 OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true);
1397 OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true);
1398 OperandClassParams[OperandMemorySemantics].set(MemorySemanticsCeiling, MemorySemanticsString, MemorySemanticsParams, true);
1399 OperandClassParams[OperandMemoryAccess].set(MemoryAccessCeiling, MemoryAccessString, MemoryAccessParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001400 OperandClassParams[OperandScope].set(ScopeCeiling, ScopeString, ScopeParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001401 OperandClassParams[OperandGroupOperation].set(GroupOperationCeiling, GroupOperationString, GroupOperationParams);
1402 OperandClassParams[OperandKernelEnqueueFlags].set(KernelEnqueueFlagsCeiling, KernelEnqueueFlagsString, KernelEnqueueFlagsParams);
1403 OperandClassParams[OperandKernelProfilingInfo].set(KernelProfilingInfoCeiling, KernelProfilingInfoString, KernelProfilingInfoParams, true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001404 OperandClassParams[OperandCapability].set(CapabilityCeiling, CapabilityString, CapabilityParams);
John Kessenich140f3df2015-06-26 16:58:36 -06001405 OperandClassParams[OperandOpcode].set(OpcodeCeiling, OpcodeString, 0);
1406
John Kessenich55e7d112015-11-15 21:33:39 -07001407 CapabilityParams[CapabilityShader].caps.push_back(CapabilityMatrix);
1408 CapabilityParams[CapabilityGeometry].caps.push_back(CapabilityShader);
1409 CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader);
1410 CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel);
1411 CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001412 CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64);
1413 CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel);
1414 CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic);
1415 CapabilityParams[CapabilityImageMipmap].caps.push_back(CapabilityImageBasic);
1416 CapabilityParams[CapabilityPipes].caps.push_back(CapabilityKernel);
1417 CapabilityParams[CapabilityDeviceEnqueue].caps.push_back(CapabilityKernel);
1418 CapabilityParams[CapabilityLiteralSampler].caps.push_back(CapabilityKernel);
1419 CapabilityParams[CapabilityAtomicStorage].caps.push_back(CapabilityShader);
1420 CapabilityParams[CapabilitySampleRateShading].caps.push_back(CapabilityShader);
1421 CapabilityParams[CapabilityTessellationPointSize].caps.push_back(CapabilityTessellation);
1422 CapabilityParams[CapabilityGeometryPointSize].caps.push_back(CapabilityGeometry);
1423 CapabilityParams[CapabilityImageGatherExtended].caps.push_back(CapabilityShader);
1424 CapabilityParams[CapabilityStorageImageExtendedFormats].caps.push_back(CapabilityShader);
1425 CapabilityParams[CapabilityStorageImageMultisample].caps.push_back(CapabilityShader);
1426 CapabilityParams[CapabilityUniformBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1427 CapabilityParams[CapabilitySampledImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1428 CapabilityParams[CapabilityStorageBufferArrayDynamicIndexing].caps.push_back(CapabilityShader);
1429 CapabilityParams[CapabilityStorageImageArrayDynamicIndexing].caps.push_back(CapabilityShader);
1430 CapabilityParams[CapabilityClipDistance].caps.push_back(CapabilityShader);
1431 CapabilityParams[CapabilityCullDistance].caps.push_back(CapabilityShader);
1432 CapabilityParams[CapabilityGenericPointer].caps.push_back(CapabilityAddresses);
1433 CapabilityParams[CapabilityInt8].caps.push_back(CapabilityKernel);
1434 CapabilityParams[CapabilityInputAttachment].caps.push_back(CapabilityShader);
1435 CapabilityParams[CapabilityMinLod].caps.push_back(CapabilityShader);
1436 CapabilityParams[CapabilitySparseResidency].caps.push_back(CapabilityShader);
1437 CapabilityParams[CapabilitySampled1D].caps.push_back(CapabilityShader);
1438 CapabilityParams[CapabilitySampledRect].caps.push_back(CapabilityShader);
1439 CapabilityParams[CapabilitySampledBuffer].caps.push_back(CapabilityShader);
1440 CapabilityParams[CapabilitySampledCubeArray].caps.push_back(CapabilityShader);
1441 CapabilityParams[CapabilityImageMSArray].caps.push_back(CapabilityShader);
1442 CapabilityParams[CapabilityImage1D].caps.push_back(CapabilitySampled1D);
1443 CapabilityParams[CapabilityImageRect].caps.push_back(CapabilitySampledRect);
1444 CapabilityParams[CapabilityImageBuffer].caps.push_back(CapabilitySampledBuffer);
1445 CapabilityParams[CapabilityImageCubeArray].caps.push_back(CapabilitySampledCubeArray);
1446 CapabilityParams[CapabilityImageQuery].caps.push_back(CapabilityShader);
1447 CapabilityParams[CapabilityDerivativeControl].caps.push_back(CapabilityShader);
1448 CapabilityParams[CapabilityInterpolationFunction].caps.push_back(CapabilityShader);
1449 CapabilityParams[CapabilityTransformFeedback].caps.push_back(CapabilityShader);
1450 CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry);
1451 CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader);
1452 CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001453 CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001454
John Kessenich5e4b1242015-08-06 22:53:06 -06001455 AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses);
1456 AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001457
John Kessenich5e4b1242015-08-06 22:53:06 -06001458 MemoryParams[MemoryModelSimple].caps.push_back(CapabilityShader);
1459 MemoryParams[MemoryModelGLSL450].caps.push_back(CapabilityShader);
1460 MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001461
John Kessenich55e7d112015-11-15 21:33:39 -07001462 MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001463 MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001464
John Kessenich5e4b1242015-08-06 22:53:06 -06001465 ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader);
1466 ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation);
1467 ExecutionModelParams[ExecutionModelTessellationEvaluation].caps.push_back(CapabilityTessellation);
1468 ExecutionModelParams[ExecutionModelGeometry].caps.push_back(CapabilityGeometry);
1469 ExecutionModelParams[ExecutionModelFragment].caps.push_back(CapabilityShader);
1470 ExecutionModelParams[ExecutionModelGLCompute].caps.push_back(CapabilityShader);
1471 ExecutionModelParams[ExecutionModelKernel].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001472
1473 // Storage capabilites
John Kessenich5e4b1242015-08-06 22:53:06 -06001474 StorageParams[StorageClassInput].caps.push_back(CapabilityShader);
1475 StorageParams[StorageClassUniform].caps.push_back(CapabilityShader);
1476 StorageParams[StorageClassOutput].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001477 StorageParams[StorageClassPrivate].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001478 StorageParams[StorageClassGeneric].caps.push_back(CapabilityKernel);
1479 StorageParams[StorageClassAtomicCounter].caps.push_back(CapabilityAtomicStorage);
John Kessenich55e7d112015-11-15 21:33:39 -07001480 StorageParams[StorageClassPushConstant].caps.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001481
1482 // Sampler Filter & Addressing mode capabilities
John Kessenich5e4b1242015-08-06 22:53:06 -06001483 SamplerAddressingModeParams[SamplerAddressingModeNone].caps.push_back(CapabilityKernel);
1484 SamplerAddressingModeParams[SamplerAddressingModeClampToEdge].caps.push_back(CapabilityKernel);
1485 SamplerAddressingModeParams[SamplerAddressingModeClamp].caps.push_back(CapabilityKernel);
1486 SamplerAddressingModeParams[SamplerAddressingModeRepeat].caps.push_back(CapabilityKernel);
1487 SamplerAddressingModeParams[SamplerAddressingModeRepeatMirrored].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001488
John Kessenich5e4b1242015-08-06 22:53:06 -06001489 SamplerFilterModeParams[SamplerFilterModeNearest].caps.push_back(CapabilityKernel);
1490 SamplerFilterModeParams[SamplerFilterModeLinear].caps.push_back(CapabilityKernel);
1491
1492 // image format capabilities
John Kessenich55e7d112015-11-15 21:33:39 -07001493
1494 // ES/Desktop float
1495 ImageFormatParams[ImageFormatRgba32f].caps.push_back(CapabilityShader);
1496 ImageFormatParams[ImageFormatRgba16f].caps.push_back(CapabilityShader);
1497 ImageFormatParams[ImageFormatR32f].caps.push_back(CapabilityShader);
1498 ImageFormatParams[ImageFormatRgba8].caps.push_back(CapabilityShader);
1499 ImageFormatParams[ImageFormatRgba8Snorm].caps.push_back(CapabilityShader);
1500
1501 // Desktop float
1502 ImageFormatParams[ImageFormatRg32f].caps.push_back(CapabilityStorageImageExtendedFormats);
1503 ImageFormatParams[ImageFormatRg16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1504 ImageFormatParams[ImageFormatR11fG11fB10f].caps.push_back(CapabilityStorageImageExtendedFormats);
1505 ImageFormatParams[ImageFormatR16f].caps.push_back(CapabilityStorageImageExtendedFormats);
1506 ImageFormatParams[ImageFormatRgba16].caps.push_back(CapabilityStorageImageExtendedFormats);
1507 ImageFormatParams[ImageFormatRgb10A2].caps.push_back(CapabilityStorageImageExtendedFormats);
1508 ImageFormatParams[ImageFormatRg16].caps.push_back(CapabilityStorageImageExtendedFormats);
1509 ImageFormatParams[ImageFormatRg8].caps.push_back(CapabilityStorageImageExtendedFormats);
1510 ImageFormatParams[ImageFormatR16].caps.push_back(CapabilityStorageImageExtendedFormats);
1511 ImageFormatParams[ImageFormatR8].caps.push_back(CapabilityStorageImageExtendedFormats);
1512 ImageFormatParams[ImageFormatRgba16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1513 ImageFormatParams[ImageFormatRg16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1514 ImageFormatParams[ImageFormatRg8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1515 ImageFormatParams[ImageFormatR16Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1516 ImageFormatParams[ImageFormatR8Snorm].caps.push_back(CapabilityStorageImageExtendedFormats);
1517
1518 // ES/Desktop int
1519 ImageFormatParams[ImageFormatRgba32i].caps.push_back(CapabilityShader);
1520 ImageFormatParams[ImageFormatRgba16i].caps.push_back(CapabilityShader);
1521 ImageFormatParams[ImageFormatRgba8i].caps.push_back(CapabilityShader);
1522 ImageFormatParams[ImageFormatR32i].caps.push_back(CapabilityShader);
1523
1524 // Desktop int
1525 ImageFormatParams[ImageFormatRg32i].caps.push_back(CapabilityStorageImageExtendedFormats);
1526 ImageFormatParams[ImageFormatRg16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1527 ImageFormatParams[ImageFormatRg8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1528 ImageFormatParams[ImageFormatR16i].caps.push_back(CapabilityStorageImageExtendedFormats);
1529 ImageFormatParams[ImageFormatR8i].caps.push_back(CapabilityStorageImageExtendedFormats);
1530
1531 // ES/Desktop uint
1532 ImageFormatParams[ImageFormatRgba32ui].caps.push_back(CapabilityShader);
1533 ImageFormatParams[ImageFormatRgba16ui].caps.push_back(CapabilityShader);
1534 ImageFormatParams[ImageFormatRgba8ui].caps.push_back(CapabilityShader);
1535 ImageFormatParams[ImageFormatR32ui].caps.push_back(CapabilityShader);
1536
1537 // Desktop uint
1538 ImageFormatParams[ImageFormatRgb10a2ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1539 ImageFormatParams[ImageFormatRg32ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1540 ImageFormatParams[ImageFormatRg16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1541 ImageFormatParams[ImageFormatRg8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1542 ImageFormatParams[ImageFormatR16ui].caps.push_back(CapabilityStorageImageExtendedFormats);
1543 ImageFormatParams[ImageFormatR8ui].caps.push_back(CapabilityStorageImageExtendedFormats);
John Kessenich5e4b1242015-08-06 22:53:06 -06001544
1545 // image channel order capabilities
1546 for (int i = 0; i < ImageChannelOrderCeiling; ++i) {
1547 ImageChannelOrderParams[i].caps.push_back(CapabilityKernel);
1548 }
1549
1550 // image channel type capabilities
1551 for (int i = 0; i < ImageChannelDataTypeCeiling; ++i) {
1552 ImageChannelDataTypeParams[i].caps.push_back(CapabilityKernel);
1553 }
1554
1555 // image lookup operands
1556 ImageOperandsParams[ImageOperandsBiasShift].caps.push_back(CapabilityShader);
1557 ImageOperandsParams[ImageOperandsOffsetShift].caps.push_back(CapabilityImageGatherExtended);
John Kessenich55e7d112015-11-15 21:33:39 -07001558 ImageOperandsParams[ImageOperandsMinLodShift].caps.push_back(CapabilityMinLod);
John Kessenich140f3df2015-06-26 16:58:36 -06001559
1560 // fast math flags capabilities
1561 for (int i = 0; i < FPFastMathCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001562 FPFastMathParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001563 }
1564
1565 // fp rounding mode capabilities
1566 for (int i = 0; i < FPRoundingModeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001567 FPRoundingModeParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001568 }
1569
1570 // linkage types
1571 for (int i = 0; i < LinkageTypeCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001572 LinkageTypeParams[i].caps.push_back(CapabilityLinkage);
John Kessenich140f3df2015-06-26 16:58:36 -06001573 }
1574
1575 // function argument types
1576 for (int i = 0; i < FuncParamAttrCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001577 FuncParamAttrParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001578 }
1579
1580 // function argument types
1581 for (int i = 0; i < AccessQualifierCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001582 AccessQualifierParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001583 }
1584
John Kessenich5e4b1242015-08-06 22:53:06 -06001585 ExecutionModeParams[ExecutionModeInvocations].caps.push_back(CapabilityGeometry);
1586 ExecutionModeParams[ExecutionModeSpacingEqual].caps.push_back(CapabilityTessellation);
1587 ExecutionModeParams[ExecutionModeSpacingFractionalEven].caps.push_back(CapabilityTessellation);
1588 ExecutionModeParams[ExecutionModeSpacingFractionalOdd].caps.push_back(CapabilityTessellation);
1589 ExecutionModeParams[ExecutionModeVertexOrderCw].caps.push_back(CapabilityTessellation);
1590 ExecutionModeParams[ExecutionModeVertexOrderCcw].caps.push_back(CapabilityTessellation);
1591 ExecutionModeParams[ExecutionModePixelCenterInteger].caps.push_back(CapabilityShader);
1592 ExecutionModeParams[ExecutionModeOriginUpperLeft].caps.push_back(CapabilityShader);
1593 ExecutionModeParams[ExecutionModeOriginLowerLeft].caps.push_back(CapabilityShader);
1594 ExecutionModeParams[ExecutionModeEarlyFragmentTests].caps.push_back(CapabilityShader);
1595 ExecutionModeParams[ExecutionModePointMode].caps.push_back(CapabilityTessellation);
John Kessenich55e7d112015-11-15 21:33:39 -07001596 ExecutionModeParams[ExecutionModeXfb].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001597 ExecutionModeParams[ExecutionModeDepthReplacing].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001598 ExecutionModeParams[ExecutionModeDepthGreater].caps.push_back(CapabilityShader);
1599 ExecutionModeParams[ExecutionModeDepthLess].caps.push_back(CapabilityShader);
1600 ExecutionModeParams[ExecutionModeDepthUnchanged].caps.push_back(CapabilityShader);
1601 ExecutionModeParams[ExecutionModeLocalSizeHint].caps.push_back(CapabilityKernel);
1602 ExecutionModeParams[ExecutionModeInputPoints].caps.push_back(CapabilityGeometry);
1603 ExecutionModeParams[ExecutionModeInputLines].caps.push_back(CapabilityGeometry);
1604 ExecutionModeParams[ExecutionModeInputLinesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001605 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityGeometry);
1606 ExecutionModeParams[ExecutionModeTriangles].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001607 ExecutionModeParams[ExecutionModeInputTrianglesAdjacency].caps.push_back(CapabilityGeometry);
John Kessenich55e7d112015-11-15 21:33:39 -07001608 ExecutionModeParams[ExecutionModeQuads].caps.push_back(CapabilityTessellation);
1609 ExecutionModeParams[ExecutionModeIsolines].caps.push_back(CapabilityTessellation);
John Kessenich5e4b1242015-08-06 22:53:06 -06001610 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityGeometry);
1611 ExecutionModeParams[ExecutionModeOutputVertices].caps.push_back(CapabilityTessellation);
1612 ExecutionModeParams[ExecutionModeOutputPoints].caps.push_back(CapabilityGeometry);
1613 ExecutionModeParams[ExecutionModeOutputLineStrip].caps.push_back(CapabilityGeometry);
1614 ExecutionModeParams[ExecutionModeOutputTriangleStrip].caps.push_back(CapabilityGeometry);
1615 ExecutionModeParams[ExecutionModeVecTypeHint].caps.push_back(CapabilityKernel);
1616 ExecutionModeParams[ExecutionModeContractionOff].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001617
John Kessenich5e4b1242015-08-06 22:53:06 -06001618 DecorationParams[DecorationRelaxedPrecision].caps.push_back(CapabilityShader);
1619 DecorationParams[DecorationBlock].caps.push_back(CapabilityShader);
1620 DecorationParams[DecorationBufferBlock].caps.push_back(CapabilityShader);
1621 DecorationParams[DecorationRowMajor].caps.push_back(CapabilityMatrix);
1622 DecorationParams[DecorationColMajor].caps.push_back(CapabilityMatrix);
1623 DecorationParams[DecorationGLSLShared].caps.push_back(CapabilityShader);
1624 DecorationParams[DecorationGLSLPacked].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001625 DecorationParams[DecorationNoPerspective].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001626 DecorationParams[DecorationFlat].caps.push_back(CapabilityShader);
1627 DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation);
1628 DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001629 DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001630 DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader);
1631 DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel);
1632 DecorationParams[DecorationUniform].caps.push_back(CapabilityShader);
1633 DecorationParams[DecorationCPacked].caps.push_back(CapabilityKernel);
1634 DecorationParams[DecorationSaturatedConversion].caps.push_back(CapabilityKernel);
John Kessenich55e7d112015-11-15 21:33:39 -07001635 DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams);
John Kessenich5e4b1242015-08-06 22:53:06 -06001636 DecorationParams[DecorationLocation].caps.push_back(CapabilityShader);
1637 DecorationParams[DecorationComponent].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001638 DecorationParams[DecorationOffset].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001639 DecorationParams[DecorationIndex].caps.push_back(CapabilityShader);
1640 DecorationParams[DecorationBinding].caps.push_back(CapabilityShader);
1641 DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001642 DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback);
1643 DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback);
John Kessenich5e4b1242015-08-06 22:53:06 -06001644 DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001645 DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix);
John Kessenich5e4b1242015-08-06 22:53:06 -06001646 DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel);
1647 DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel);
1648 DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel);
1649 DecorationParams[DecorationLinkageAttributes].caps.push_back(CapabilityLinkage);
1650 DecorationParams[DecorationSpecId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001651 DecorationParams[DecorationNoContraction].caps.push_back(CapabilityShader);
1652 DecorationParams[DecorationInputAttachmentIndex].caps.push_back(CapabilityInputAttachment);
1653 DecorationParams[DecorationAlignment].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001654
John Kessenich5e4b1242015-08-06 22:53:06 -06001655 BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader);
1656 BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001657 BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance);
1658 BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance);
John Kessenich55e7d112015-11-15 21:33:39 -07001659
John Kessenich5e4b1242015-08-06 22:53:06 -06001660 BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001661 BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . .";
1662
John Kessenich5e4b1242015-08-06 22:53:06 -06001663 BuiltInParams[BuiltInInstanceId].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001664 BuiltInParams[BuiltInInstanceId].desc = "Instance ID, which takes on values 0, 1, 2, . . . .";
1665
1666 BuiltInParams[BuiltInVertexIndex].caps.push_back(CapabilityShader);
1667 BuiltInParams[BuiltInVertexIndex].desc = "Vertex index, which takes on values base, base+1, base+2, . . . .";
1668
1669 BuiltInParams[BuiltInInstanceIndex].caps.push_back(CapabilityShader);
1670 BuiltInParams[BuiltInInstanceIndex].desc = "Instance index, which takes on values base, base+1, base+2, . . . .";
1671
John Kessenich5e4b1242015-08-06 22:53:06 -06001672 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityGeometry);
1673 BuiltInParams[BuiltInPrimitiveId].caps.push_back(CapabilityTessellation);
1674 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry);
1675 BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation);
1676 BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry);
John Kessenich6c292d32016-02-15 20:58:50 -07001677 BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport);
John Kessenich5e4b1242015-08-06 22:53:06 -06001678 BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation);
1679 BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation);
1680 BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation);
1681 BuiltInParams[BuiltInPatchVertices].caps.push_back(CapabilityTessellation);
1682 BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader);
1683 BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader);
1684 BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader);
John Kessenich6c292d32016-02-15 20:58:50 -07001685 BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading);
1686 BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading);
1687 BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading);
John Kessenich5e4b1242015-08-06 22:53:06 -06001688 BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader);
1689 BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader);
John Kessenich5e4b1242015-08-06 22:53:06 -06001690 BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel);
1691 BuiltInParams[BuiltInGlobalSize].caps.push_back(CapabilityKernel);
1692 BuiltInParams[BuiltInEnqueuedWorkgroupSize].caps.push_back(CapabilityKernel);
1693 BuiltInParams[BuiltInGlobalOffset].caps.push_back(CapabilityKernel);
1694 BuiltInParams[BuiltInGlobalLinearId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001695
John Kessenich5e4b1242015-08-06 22:53:06 -06001696 BuiltInParams[BuiltInSubgroupSize].caps.push_back(CapabilityKernel);
1697 BuiltInParams[BuiltInSubgroupMaxSize].caps.push_back(CapabilityKernel);
1698 BuiltInParams[BuiltInNumSubgroups].caps.push_back(CapabilityKernel);
1699 BuiltInParams[BuiltInNumEnqueuedSubgroups].caps.push_back(CapabilityKernel);
1700 BuiltInParams[BuiltInSubgroupId].caps.push_back(CapabilityKernel);
1701 BuiltInParams[BuiltInSubgroupLocalInvocationId].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001702
John Kessenich55e7d112015-11-15 21:33:39 -07001703 DimensionalityParams[Dim1D].caps.push_back(CapabilitySampled1D);
John Kessenich5e4b1242015-08-06 22:53:06 -06001704 DimensionalityParams[DimCube].caps.push_back(CapabilityShader);
John Kessenich55e7d112015-11-15 21:33:39 -07001705 DimensionalityParams[DimRect].caps.push_back(CapabilitySampledRect);
1706 DimensionalityParams[DimBuffer].caps.push_back(CapabilitySampledBuffer);
1707 DimensionalityParams[DimSubpassData].caps.push_back(CapabilityInputAttachment);
John Kessenich140f3df2015-06-26 16:58:36 -06001708
1709 // Group Operations
1710 for (int i = 0; i < GroupOperationCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001711 GroupOperationParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001712 }
1713
1714 // Enqueue flags
1715 for (int i = 0; i < KernelEnqueueFlagsCeiling; ++i) {
John Kessenich5e4b1242015-08-06 22:53:06 -06001716 KernelEnqueueFlagsParams[i].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001717 }
1718
1719 // Profiling info
John Kessenich5e4b1242015-08-06 22:53:06 -06001720 KernelProfilingInfoParams[0].caps.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001721
1722 // set name of operator, an initial set of <id> style operands, and the description
1723
1724 InstructionDesc[OpSource].operands.push(OperandSource, "");
1725 InstructionDesc[OpSource].operands.push(OperandLiteralNumber, "'Version'");
John Kessenich55e7d112015-11-15 21:33:39 -07001726 InstructionDesc[OpSource].operands.push(OperandId, "'File'", true);
1727 InstructionDesc[OpSource].operands.push(OperandLiteralString, "'Source'", true);
1728
1729 InstructionDesc[OpSourceContinued].operands.push(OperandLiteralString, "'Continued Source'");
John Kessenich140f3df2015-06-26 16:58:36 -06001730
1731 InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString, "'Extension'");
1732
1733 InstructionDesc[OpName].operands.push(OperandId, "'Target'");
1734 InstructionDesc[OpName].operands.push(OperandLiteralString, "'Name'");
1735
1736 InstructionDesc[OpMemberName].operands.push(OperandId, "'Type'");
1737 InstructionDesc[OpMemberName].operands.push(OperandLiteralNumber, "'Member'");
1738 InstructionDesc[OpMemberName].operands.push(OperandLiteralString, "'Name'");
1739
1740 InstructionDesc[OpString].operands.push(OperandLiteralString, "'String'");
1741
John Kessenich140f3df2015-06-26 16:58:36 -06001742 InstructionDesc[OpLine].operands.push(OperandId, "'File'");
1743 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Line'");
1744 InstructionDesc[OpLine].operands.push(OperandLiteralNumber, "'Column'");
1745
1746 InstructionDesc[OpExtension].operands.push(OperandLiteralString, "'Name'");
1747
1748 InstructionDesc[OpExtInstImport].operands.push(OperandLiteralString, "'Name'");
1749
John Kessenich5e4b1242015-08-06 22:53:06 -06001750 InstructionDesc[OpCapability].operands.push(OperandCapability, "'Capability'");
1751
John Kessenich140f3df2015-06-26 16:58:36 -06001752 InstructionDesc[OpMemoryModel].operands.push(OperandAddressing, "");
1753 InstructionDesc[OpMemoryModel].operands.push(OperandMemory, "");
1754
1755 InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel, "");
1756 InstructionDesc[OpEntryPoint].operands.push(OperandId, "'Entry Point'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001757 InstructionDesc[OpEntryPoint].operands.push(OperandLiteralString, "'Name'");
John Kessenich55e7d112015-11-15 21:33:39 -07001758 InstructionDesc[OpEntryPoint].operands.push(OperandVariableIds, "'Interface'");
John Kessenich140f3df2015-06-26 16:58:36 -06001759
1760 InstructionDesc[OpExecutionMode].operands.push(OperandId, "'Entry Point'");
1761 InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode, "'Mode'");
John Kessenich55e7d112015-11-15 21:33:39 -07001762 InstructionDesc[OpExecutionMode].operands.push(OperandOptionalLiteral, "See <<Execution_Mode,Execution Mode>>");
John Kessenich140f3df2015-06-26 16:58:36 -06001763
1764 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Width'");
1765 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber, "'Signedness'");
1766
1767 InstructionDesc[OpTypeFloat].operands.push(OperandLiteralNumber, "'Width'");
1768
John Kessenich5e4b1242015-08-06 22:53:06 -06001769 InstructionDesc[OpTypeVector].operands.push(OperandId, "'Component Type'");
1770 InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber, "'Component Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001771
John Kessenich5e4b1242015-08-06 22:53:06 -06001772 InstructionDesc[OpTypeMatrix].capabilities.push_back(CapabilityMatrix);
1773 InstructionDesc[OpTypeMatrix].operands.push(OperandId, "'Column Type'");
1774 InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber, "'Column Count'");
John Kessenich140f3df2015-06-26 16:58:36 -06001775
John Kessenich5e4b1242015-08-06 22:53:06 -06001776 InstructionDesc[OpTypeImage].operands.push(OperandId, "'Sampled Type'");
1777 InstructionDesc[OpTypeImage].operands.push(OperandDimensionality, "");
1778 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Depth'");
1779 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Arrayed'");
1780 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'MS'");
1781 InstructionDesc[OpTypeImage].operands.push(OperandLiteralNumber, "'Sampled'");
1782 InstructionDesc[OpTypeImage].operands.push(OperandSamplerImageFormat, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001783 InstructionDesc[OpTypeImage].operands.push(OperandAccessQualifier, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001784
John Kessenich5e4b1242015-08-06 22:53:06 -06001785 InstructionDesc[OpTypeSampledImage].operands.push(OperandId, "'Image Type'");
1786
1787 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001788 InstructionDesc[OpTypeArray].operands.push(OperandId, "'Length'");
1789
John Kessenich5e4b1242015-08-06 22:53:06 -06001790 InstructionDesc[OpTypeRuntimeArray].capabilities.push_back(CapabilityShader);
1791 InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId, "'Element Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001792
1793 InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n...");
1794
John Kessenich5e4b1242015-08-06 22:53:06 -06001795 InstructionDesc[OpTypeOpaque].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001796 InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString, "The name of the opaque type.");
1797
1798 InstructionDesc[OpTypePointer].operands.push(OperandStorage, "");
1799 InstructionDesc[OpTypePointer].operands.push(OperandId, "'Type'");
1800
John Kessenich55e7d112015-11-15 21:33:39 -07001801 InstructionDesc[OpTypeForwardPointer].capabilities.push_back(CapabilityAddresses);
1802 InstructionDesc[OpTypeForwardPointer].operands.push(OperandId, "'Pointer Type'");
1803 InstructionDesc[OpTypeForwardPointer].operands.push(OperandStorage, "");
1804
John Kessenich5e4b1242015-08-06 22:53:06 -06001805 InstructionDesc[OpTypeEvent].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06001806
John Kessenich55e7d112015-11-15 21:33:39 -07001807 InstructionDesc[OpTypeDeviceEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001808
John Kessenich5e4b1242015-08-06 22:53:06 -06001809 InstructionDesc[OpTypeReserveId].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001810
John Kessenich55e7d112015-11-15 21:33:39 -07001811 InstructionDesc[OpTypeQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06001812
John Kessenich140f3df2015-06-26 16:58:36 -06001813 InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier, "'Qualifier'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001814 InstructionDesc[OpTypePipe].capabilities.push_back(CapabilityPipes);
John Kessenich140f3df2015-06-26 16:58:36 -06001815
1816 InstructionDesc[OpTypeFunction].operands.push(OperandId, "'Return Type'");
1817 InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds, "'Parameter 0 Type', +\n'Parameter 1 Type', +\n...");
1818
1819 InstructionDesc[OpConstant].operands.push(OperandVariableLiterals, "'Value'");
1820
1821 InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
1822
John Kessenich5e4b1242015-08-06 22:53:06 -06001823 InstructionDesc[OpConstantSampler].capabilities.push_back(CapabilityLiteralSampler);
1824 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerAddressingMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001825 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber, "'Param'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001826 InstructionDesc[OpConstantSampler].operands.push(OperandSamplerFilterMode, "");
John Kessenich140f3df2015-06-26 16:58:36 -06001827
1828 InstructionDesc[OpSpecConstant].operands.push(OperandVariableLiterals, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06001829
1830 InstructionDesc[OpSpecConstantComposite].operands.push(OperandVariableIds, "'Constituents'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001831
1832 InstructionDesc[OpSpecConstantOp].operands.push(OperandLiteralNumber, "'Opcode'");
1833 InstructionDesc[OpSpecConstantOp].operands.push(OperandVariableIds, "'Operands'");
John Kessenich140f3df2015-06-26 16:58:36 -06001834
1835 InstructionDesc[OpVariable].operands.push(OperandStorage, "");
John Kessenich55e7d112015-11-15 21:33:39 -07001836 InstructionDesc[OpVariable].operands.push(OperandId, "'Initializer'", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001837
John Kessenich140f3df2015-06-26 16:58:36 -06001838 InstructionDesc[OpFunction].operands.push(OperandFunction, "");
1839 InstructionDesc[OpFunction].operands.push(OperandId, "'Function Type'");
1840
1841 InstructionDesc[OpFunctionCall].operands.push(OperandId, "'Function'");
1842 InstructionDesc[OpFunctionCall].operands.push(OperandVariableIds, "'Argument 0', +\n'Argument 1', +\n...");
1843
1844 InstructionDesc[OpExtInst].operands.push(OperandId, "'Set'");
1845 InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber, "'Instruction'");
1846 InstructionDesc[OpExtInst].operands.push(OperandVariableIds, "'Operand 1', +\n'Operand 2', +\n...");
1847
1848 InstructionDesc[OpLoad].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07001849 InstructionDesc[OpLoad].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001850
1851 InstructionDesc[OpStore].operands.push(OperandId, "'Pointer'");
1852 InstructionDesc[OpStore].operands.push(OperandId, "'Object'");
John Kessenich55e7d112015-11-15 21:33:39 -07001853 InstructionDesc[OpStore].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001854
John Kessenich5e4b1242015-08-06 22:53:06 -06001855 InstructionDesc[OpPhi].operands.push(OperandVariableIds, "'Variable, Parent, ...'");
John Kessenich140f3df2015-06-26 16:58:36 -06001856
1857 InstructionDesc[OpDecorate].operands.push(OperandId, "'Target'");
1858 InstructionDesc[OpDecorate].operands.push(OperandDecoration, "");
1859 InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1860
John Kessenich5e4b1242015-08-06 22:53:06 -06001861 InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'");
John Kessenich140f3df2015-06-26 16:58:36 -06001862 InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'");
1863 InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, "");
1864 InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
1865
John Kessenich5e4b1242015-08-06 22:53:06 -06001866 InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'");
1867 InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001868
John Kessenich5e4b1242015-08-06 22:53:06 -06001869 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandId, "'Decoration Group'");
1870 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandVariableIdLiteral, "'Targets'");
John Kessenich140f3df2015-06-26 16:58:36 -06001871
1872 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Vector'");
1873 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId, "'Index'");
1874
1875 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Vector'");
1876 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Component'");
1877 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId, "'Index'");
1878
1879 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 1'");
1880 InstructionDesc[OpVectorShuffle].operands.push(OperandId, "'Vector 2'");
1881 InstructionDesc[OpVectorShuffle].operands.push(OperandVariableLiterals, "'Components'");
1882
1883 InstructionDesc[OpCompositeConstruct].operands.push(OperandVariableIds, "'Constituents'");
1884
1885 InstructionDesc[OpCompositeExtract].operands.push(OperandId, "'Composite'");
1886 InstructionDesc[OpCompositeExtract].operands.push(OperandVariableLiterals, "'Indexes'");
1887
1888 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Object'");
1889 InstructionDesc[OpCompositeInsert].operands.push(OperandId, "'Composite'");
1890 InstructionDesc[OpCompositeInsert].operands.push(OperandVariableLiterals, "'Indexes'");
1891
1892 InstructionDesc[OpCopyObject].operands.push(OperandId, "'Operand'");
1893
1894 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Target'");
1895 InstructionDesc[OpCopyMemory].operands.push(OperandId, "'Source'");
John Kessenich55e7d112015-11-15 21:33:39 -07001896 InstructionDesc[OpCopyMemory].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001897
1898 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Target'");
1899 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Source'");
1900 InstructionDesc[OpCopyMemorySized].operands.push(OperandId, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07001901 InstructionDesc[OpCopyMemorySized].operands.push(OperandMemoryAccess, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001902
John Kessenich5e4b1242015-08-06 22:53:06 -06001903 InstructionDesc[OpCopyMemorySized].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06001904
John Kessenich5e4b1242015-08-06 22:53:06 -06001905 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Image'");
1906 InstructionDesc[OpSampledImage].operands.push(OperandId, "'Sampler'");
John Kessenich140f3df2015-06-26 16:58:36 -06001907
John Kessenich55e7d112015-11-15 21:33:39 -07001908 InstructionDesc[OpImage].operands.push(OperandId, "'Sampled Image'");
1909
John Kessenich5e4b1242015-08-06 22:53:06 -06001910 InstructionDesc[OpImageRead].operands.push(OperandId, "'Image'");
1911 InstructionDesc[OpImageRead].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001912 InstructionDesc[OpImageRead].operands.push(OperandImageOperands, "", true);
1913 InstructionDesc[OpImageRead].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001914
John Kessenich5e4b1242015-08-06 22:53:06 -06001915 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Image'");
1916 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Coordinate'");
1917 InstructionDesc[OpImageWrite].operands.push(OperandId, "'Texel'");
John Kessenich55e7d112015-11-15 21:33:39 -07001918 InstructionDesc[OpImageWrite].operands.push(OperandImageOperands, "", true);
1919 InstructionDesc[OpImageWrite].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001920
John Kessenich5e4b1242015-08-06 22:53:06 -06001921 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1922 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001923 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1924 InstructionDesc[OpImageSampleImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001925 InstructionDesc[OpImageSampleImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001926
John Kessenich5e4b1242015-08-06 22:53:06 -06001927 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1928 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001929 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandImageOperands, "", true);
1930 InstructionDesc[OpImageSampleExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001931
John Kessenich5e4b1242015-08-06 22:53:06 -06001932 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1933 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1934 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001935 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1936 InstructionDesc[OpImageSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001937 InstructionDesc[OpImageSampleDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001938
John Kessenich5e4b1242015-08-06 22:53:06 -06001939 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1940 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1941 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001942 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1943 InstructionDesc[OpImageSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001944 InstructionDesc[OpImageSampleDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001945
John Kessenich5e4b1242015-08-06 22:53:06 -06001946 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
1947 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001948 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
1949 InstructionDesc[OpImageSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001950 InstructionDesc[OpImageSampleProjImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001951
John Kessenich5e4b1242015-08-06 22:53:06 -06001952 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
1953 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001954 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
1955 InstructionDesc[OpImageSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001956 InstructionDesc[OpImageSampleProjExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001957
John Kessenich5e4b1242015-08-06 22:53:06 -06001958 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
1959 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
1960 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001961 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
1962 InstructionDesc[OpImageSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001963 InstructionDesc[OpImageSampleProjDrefImplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001964
John Kessenich5e4b1242015-08-06 22:53:06 -06001965 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
1966 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
1967 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001968 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
1969 InstructionDesc[OpImageSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001970 InstructionDesc[OpImageSampleProjDrefExplicitLod].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001971
John Kessenich55e7d112015-11-15 21:33:39 -07001972 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Image'");
John Kessenich5e4b1242015-08-06 22:53:06 -06001973 InstructionDesc[OpImageFetch].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07001974 InstructionDesc[OpImageFetch].operands.push(OperandImageOperands, "", true);
1975 InstructionDesc[OpImageFetch].operands.push(OperandVariableIds, "", true);
John Kessenich140f3df2015-06-26 16:58:36 -06001976
John Kessenich5e4b1242015-08-06 22:53:06 -06001977 InstructionDesc[OpImageGather].operands.push(OperandId, "'Sampled Image'");
1978 InstructionDesc[OpImageGather].operands.push(OperandId, "'Coordinate'");
1979 InstructionDesc[OpImageGather].operands.push(OperandId, "'Component'");
John Kessenich55e7d112015-11-15 21:33:39 -07001980 InstructionDesc[OpImageGather].operands.push(OperandImageOperands, "", true);
1981 InstructionDesc[OpImageGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001982 InstructionDesc[OpImageGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001983
John Kessenich5e4b1242015-08-06 22:53:06 -06001984 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Sampled Image'");
1985 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'Coordinate'");
1986 InstructionDesc[OpImageDrefGather].operands.push(OperandId, "'D~ref~'");
John Kessenich55e7d112015-11-15 21:33:39 -07001987 InstructionDesc[OpImageDrefGather].operands.push(OperandImageOperands, "", true);
1988 InstructionDesc[OpImageDrefGather].operands.push(OperandVariableIds, "", true);
John Kessenich5e4b1242015-08-06 22:53:06 -06001989 InstructionDesc[OpImageDrefGather].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06001990
John Kessenich55e7d112015-11-15 21:33:39 -07001991 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Sampled Image'");
1992 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandId, "'Coordinate'");
1993 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandImageOperands, "", true);
1994 InstructionDesc[OpImageSparseSampleImplicitLod].operands.push(OperandVariableIds, "", true);
1995 InstructionDesc[OpImageSparseSampleImplicitLod].capabilities.push_back(CapabilitySparseResidency);
1996
1997 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Sampled Image'");
1998 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandId, "'Coordinate'");
1999 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandImageOperands, "", true);
2000 InstructionDesc[OpImageSparseSampleExplicitLod].operands.push(OperandVariableIds, "", true);
2001 InstructionDesc[OpImageSparseSampleExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2002
2003 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
2004 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
2005 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
2006 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandImageOperands, "", true);
2007 InstructionDesc[OpImageSparseSampleDrefImplicitLod].operands.push(OperandVariableIds, "", true);
2008 InstructionDesc[OpImageSparseSampleDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
2009
2010 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
2011 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
2012 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
2013 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandImageOperands, "", true);
2014 InstructionDesc[OpImageSparseSampleDrefExplicitLod].operands.push(OperandVariableIds, "", true);
2015 InstructionDesc[OpImageSparseSampleDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2016
2017 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Sampled Image'");
2018 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandId, "'Coordinate'");
2019 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandImageOperands, "", true);
2020 InstructionDesc[OpImageSparseSampleProjImplicitLod].operands.push(OperandVariableIds, "", true);
2021 InstructionDesc[OpImageSparseSampleProjImplicitLod].capabilities.push_back(CapabilitySparseResidency);
2022
2023 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Sampled Image'");
2024 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandId, "'Coordinate'");
2025 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandImageOperands, "", true);
2026 InstructionDesc[OpImageSparseSampleProjExplicitLod].operands.push(OperandVariableIds, "", true);
2027 InstructionDesc[OpImageSparseSampleProjExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2028
2029 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Sampled Image'");
2030 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'Coordinate'");
2031 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandId, "'D~ref~'");
2032 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandImageOperands, "", true);
2033 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].operands.push(OperandVariableIds, "", true);
2034 InstructionDesc[OpImageSparseSampleProjDrefImplicitLod].capabilities.push_back(CapabilitySparseResidency);
2035
2036 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Sampled Image'");
2037 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'Coordinate'");
2038 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandId, "'D~ref~'");
2039 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandImageOperands, "", true);
2040 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].operands.push(OperandVariableIds, "", true);
2041 InstructionDesc[OpImageSparseSampleProjDrefExplicitLod].capabilities.push_back(CapabilitySparseResidency);
2042
2043 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Image'");
2044 InstructionDesc[OpImageSparseFetch].operands.push(OperandId, "'Coordinate'");
2045 InstructionDesc[OpImageSparseFetch].operands.push(OperandImageOperands, "", true);
2046 InstructionDesc[OpImageSparseFetch].operands.push(OperandVariableIds, "", true);
2047 InstructionDesc[OpImageSparseFetch].capabilities.push_back(CapabilitySparseResidency);
2048
2049 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Sampled Image'");
2050 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Coordinate'");
2051 InstructionDesc[OpImageSparseGather].operands.push(OperandId, "'Component'");
2052 InstructionDesc[OpImageSparseGather].operands.push(OperandImageOperands, "", true);
2053 InstructionDesc[OpImageSparseGather].operands.push(OperandVariableIds, "", true);
2054 InstructionDesc[OpImageSparseGather].capabilities.push_back(CapabilitySparseResidency);
2055
2056 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Sampled Image'");
2057 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'Coordinate'");
2058 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandId, "'D~ref~'");
2059 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandImageOperands, "", true);
2060 InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true);
2061 InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency);
2062
John Kessenich6c292d32016-02-15 20:58:50 -07002063 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'");
2064 InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'");
2065 InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true);
2066 InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true);
2067 InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency);
2068
John Kessenich55e7d112015-11-15 21:33:39 -07002069 InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'");
2070 InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency);
2071
John Kessenich5e4b1242015-08-06 22:53:06 -06002072 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Image'");
2073 InstructionDesc[OpImageQuerySizeLod].operands.push(OperandId, "'Level of Detail'");
John Kessenich55e7d112015-11-15 21:33:39 -07002074 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityKernel);
2075 InstructionDesc[OpImageQuerySizeLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002076
John Kessenich5e4b1242015-08-06 22:53:06 -06002077 InstructionDesc[OpImageQuerySize].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002078 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityKernel);
2079 InstructionDesc[OpImageQuerySize].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002080
John Kessenich5e4b1242015-08-06 22:53:06 -06002081 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Image'");
2082 InstructionDesc[OpImageQueryLod].operands.push(OperandId, "'Coordinate'");
John Kessenich55e7d112015-11-15 21:33:39 -07002083 InstructionDesc[OpImageQueryLod].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002084
John Kessenich5e4b1242015-08-06 22:53:06 -06002085 InstructionDesc[OpImageQueryLevels].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002086 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityKernel);
2087 InstructionDesc[OpImageQueryLevels].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002088
John Kessenich5e4b1242015-08-06 22:53:06 -06002089 InstructionDesc[OpImageQuerySamples].operands.push(OperandId, "'Image'");
John Kessenich55e7d112015-11-15 21:33:39 -07002090 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityKernel);
2091 InstructionDesc[OpImageQuerySamples].capabilities.push_back(CapabilityImageQuery);
John Kessenich140f3df2015-06-26 16:58:36 -06002092
John Kessenich5e4b1242015-08-06 22:53:06 -06002093 InstructionDesc[OpImageQueryFormat].operands.push(OperandId, "'Image'");
2094 InstructionDesc[OpImageQueryFormat].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002095
John Kessenich5e4b1242015-08-06 22:53:06 -06002096 InstructionDesc[OpImageQueryOrder].operands.push(OperandId, "'Image'");
2097 InstructionDesc[OpImageQueryOrder].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002098
2099 InstructionDesc[OpAccessChain].operands.push(OperandId, "'Base'");
2100 InstructionDesc[OpAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2101
2102 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandId, "'Base'");
2103 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2104
John Kessenich5e4b1242015-08-06 22:53:06 -06002105 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Base'");
2106 InstructionDesc[OpPtrAccessChain].operands.push(OperandId, "'Element'");
2107 InstructionDesc[OpPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2108 InstructionDesc[OpPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2109
John Kessenich55e7d112015-11-15 21:33:39 -07002110 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Base'");
2111 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandId, "'Element'");
2112 InstructionDesc[OpInBoundsPtrAccessChain].operands.push(OperandVariableIds, "'Indexes'");
2113 InstructionDesc[OpInBoundsPtrAccessChain].capabilities.push_back(CapabilityAddresses);
2114
John Kessenich140f3df2015-06-26 16:58:36 -06002115 InstructionDesc[OpSNegate].operands.push(OperandId, "'Operand'");
2116
2117 InstructionDesc[OpFNegate].operands.push(OperandId, "'Operand'");
2118
2119 InstructionDesc[OpNot].operands.push(OperandId, "'Operand'");
2120
2121 InstructionDesc[OpAny].operands.push(OperandId, "'Vector'");
2122
2123 InstructionDesc[OpAll].operands.push(OperandId, "'Vector'");
2124
2125 InstructionDesc[OpConvertFToU].operands.push(OperandId, "'Float Value'");
2126
2127 InstructionDesc[OpConvertFToS].operands.push(OperandId, "'Float Value'");
2128
2129 InstructionDesc[OpConvertSToF].operands.push(OperandId, "'Signed Value'");
2130
John Kessenich5e4b1242015-08-06 22:53:06 -06002131 InstructionDesc[OpConvertUToF].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002132
John Kessenich5e4b1242015-08-06 22:53:06 -06002133 InstructionDesc[OpUConvert].operands.push(OperandId, "'Unsigned Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002134
2135 InstructionDesc[OpSConvert].operands.push(OperandId, "'Signed Value'");
2136
2137 InstructionDesc[OpFConvert].operands.push(OperandId, "'Float Value'");
2138
2139 InstructionDesc[OpSatConvertSToU].operands.push(OperandId, "'Signed Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002140 InstructionDesc[OpSatConvertSToU].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002141
2142 InstructionDesc[OpSatConvertUToS].operands.push(OperandId, "'Unsigned Value'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002143 InstructionDesc[OpSatConvertUToS].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002144
2145 InstructionDesc[OpConvertPtrToU].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002146 InstructionDesc[OpConvertPtrToU].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002147
John Kessenich5e4b1242015-08-06 22:53:06 -06002148 InstructionDesc[OpConvertUToPtr].operands.push(OperandId, "'Integer Value'");
2149 InstructionDesc[OpConvertUToPtr].capabilities.push_back(CapabilityAddresses);
John Kessenich140f3df2015-06-26 16:58:36 -06002150
John Kessenich5e4b1242015-08-06 22:53:06 -06002151 InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId, "'Pointer'");
2152 InstructionDesc[OpPtrCastToGeneric].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002153
John Kessenich5e4b1242015-08-06 22:53:06 -06002154 InstructionDesc[OpGenericCastToPtr].operands.push(OperandId, "'Pointer'");
2155 InstructionDesc[OpGenericCastToPtr].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002156
John Kessenich5e4b1242015-08-06 22:53:06 -06002157 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId, "'Pointer'");
2158 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage, "'Storage'");
2159 InstructionDesc[OpGenericCastToPtrExplicit].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002160
John Kessenich5e4b1242015-08-06 22:53:06 -06002161 InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId, "'Pointer'");
2162 InstructionDesc[OpGenericPtrMemSemantics].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002163
2164 InstructionDesc[OpBitcast].operands.push(OperandId, "'Operand'");
2165
John Kessenich5e4b1242015-08-06 22:53:06 -06002166 InstructionDesc[OpQuantizeToF16].operands.push(OperandId, "'Value'");
2167
2168 InstructionDesc[OpTranspose].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002169 InstructionDesc[OpTranspose].operands.push(OperandId, "'Matrix'");
2170
2171 InstructionDesc[OpIsNan].operands.push(OperandId, "'x'");
2172
2173 InstructionDesc[OpIsInf].operands.push(OperandId, "'x'");
2174
John Kessenich5e4b1242015-08-06 22:53:06 -06002175 InstructionDesc[OpIsFinite].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002176 InstructionDesc[OpIsFinite].operands.push(OperandId, "'x'");
2177
John Kessenich5e4b1242015-08-06 22:53:06 -06002178 InstructionDesc[OpIsNormal].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002179 InstructionDesc[OpIsNormal].operands.push(OperandId, "'x'");
2180
John Kessenich5e4b1242015-08-06 22:53:06 -06002181 InstructionDesc[OpSignBitSet].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002182 InstructionDesc[OpSignBitSet].operands.push(OperandId, "'x'");
2183
John Kessenich5e4b1242015-08-06 22:53:06 -06002184 InstructionDesc[OpLessOrGreater].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002185 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'x'");
2186 InstructionDesc[OpLessOrGreater].operands.push(OperandId, "'y'");
2187
John Kessenich5e4b1242015-08-06 22:53:06 -06002188 InstructionDesc[OpOrdered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002189 InstructionDesc[OpOrdered].operands.push(OperandId, "'x'");
2190 InstructionDesc[OpOrdered].operands.push(OperandId, "'y'");
2191
John Kessenich5e4b1242015-08-06 22:53:06 -06002192 InstructionDesc[OpUnordered].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002193 InstructionDesc[OpUnordered].operands.push(OperandId, "'x'");
2194 InstructionDesc[OpUnordered].operands.push(OperandId, "'y'");
2195
2196 InstructionDesc[OpArrayLength].operands.push(OperandId, "'Structure'");
2197 InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber, "'Array member'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002198 InstructionDesc[OpArrayLength].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002199
2200 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 1'");
2201 InstructionDesc[OpIAdd].operands.push(OperandId, "'Operand 2'");
2202
2203 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 1'");
2204 InstructionDesc[OpFAdd].operands.push(OperandId, "'Operand 2'");
2205
2206 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 1'");
2207 InstructionDesc[OpISub].operands.push(OperandId, "'Operand 2'");
2208
2209 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 1'");
2210 InstructionDesc[OpFSub].operands.push(OperandId, "'Operand 2'");
2211
2212 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 1'");
2213 InstructionDesc[OpIMul].operands.push(OperandId, "'Operand 2'");
2214
2215 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 1'");
2216 InstructionDesc[OpFMul].operands.push(OperandId, "'Operand 2'");
2217
2218 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 1'");
2219 InstructionDesc[OpUDiv].operands.push(OperandId, "'Operand 2'");
2220
2221 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 1'");
2222 InstructionDesc[OpSDiv].operands.push(OperandId, "'Operand 2'");
2223
2224 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 1'");
2225 InstructionDesc[OpFDiv].operands.push(OperandId, "'Operand 2'");
2226
2227 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 1'");
2228 InstructionDesc[OpUMod].operands.push(OperandId, "'Operand 2'");
2229
2230 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 1'");
2231 InstructionDesc[OpSRem].operands.push(OperandId, "'Operand 2'");
2232
2233 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 1'");
2234 InstructionDesc[OpSMod].operands.push(OperandId, "'Operand 2'");
2235
2236 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 1'");
2237 InstructionDesc[OpFRem].operands.push(OperandId, "'Operand 2'");
2238
2239 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 1'");
2240 InstructionDesc[OpFMod].operands.push(OperandId, "'Operand 2'");
2241
2242 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Vector'");
2243 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId, "'Scalar'");
2244
John Kessenich5e4b1242015-08-06 22:53:06 -06002245 InstructionDesc[OpMatrixTimesScalar].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002246 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Matrix'");
2247 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId, "'Scalar'");
2248
John Kessenich5e4b1242015-08-06 22:53:06 -06002249 InstructionDesc[OpVectorTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002250 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Vector'");
2251 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId, "'Matrix'");
2252
John Kessenich5e4b1242015-08-06 22:53:06 -06002253 InstructionDesc[OpMatrixTimesVector].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002254 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Matrix'");
2255 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId, "'Vector'");
2256
John Kessenich5e4b1242015-08-06 22:53:06 -06002257 InstructionDesc[OpMatrixTimesMatrix].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002258 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'LeftMatrix'");
2259 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId, "'RightMatrix'");
2260
John Kessenich5e4b1242015-08-06 22:53:06 -06002261 InstructionDesc[OpOuterProduct].capabilities.push_back(CapabilityMatrix);
John Kessenich140f3df2015-06-26 16:58:36 -06002262 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 1'");
2263 InstructionDesc[OpOuterProduct].operands.push(OperandId, "'Vector 2'");
2264
2265 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 1'");
2266 InstructionDesc[OpDot].operands.push(OperandId, "'Vector 2'");
2267
John Kessenich55e7d112015-11-15 21:33:39 -07002268 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 1'");
2269 InstructionDesc[OpIAddCarry].operands.push(OperandId, "'Operand 2'");
2270
2271 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 1'");
2272 InstructionDesc[OpISubBorrow].operands.push(OperandId, "'Operand 2'");
2273
2274 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 1'");
2275 InstructionDesc[OpUMulExtended].operands.push(OperandId, "'Operand 2'");
2276
2277 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 1'");
2278 InstructionDesc[OpSMulExtended].operands.push(OperandId, "'Operand 2'");
2279
John Kessenich5e4b1242015-08-06 22:53:06 -06002280 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Base'");
2281 InstructionDesc[OpShiftRightLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002282
John Kessenich5e4b1242015-08-06 22:53:06 -06002283 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Base'");
2284 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002285
John Kessenich5e4b1242015-08-06 22:53:06 -06002286 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Base'");
2287 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId, "'Shift'");
John Kessenich140f3df2015-06-26 16:58:36 -06002288
2289 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 1'");
2290 InstructionDesc[OpLogicalOr].operands.push(OperandId, "'Operand 2'");
2291
John Kessenich140f3df2015-06-26 16:58:36 -06002292 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 1'");
2293 InstructionDesc[OpLogicalAnd].operands.push(OperandId, "'Operand 2'");
2294
John Kessenich5e4b1242015-08-06 22:53:06 -06002295 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 1'");
2296 InstructionDesc[OpLogicalEqual].operands.push(OperandId, "'Operand 2'");
2297
2298 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 1'");
2299 InstructionDesc[OpLogicalNotEqual].operands.push(OperandId, "'Operand 2'");
2300
2301 InstructionDesc[OpLogicalNot].operands.push(OperandId, "'Operand'");
2302
John Kessenich140f3df2015-06-26 16:58:36 -06002303 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 1'");
2304 InstructionDesc[OpBitwiseOr].operands.push(OperandId, "'Operand 2'");
2305
2306 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 1'");
2307 InstructionDesc[OpBitwiseXor].operands.push(OperandId, "'Operand 2'");
2308
2309 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 1'");
2310 InstructionDesc[OpBitwiseAnd].operands.push(OperandId, "'Operand 2'");
2311
John Kessenich5e4b1242015-08-06 22:53:06 -06002312 InstructionDesc[OpBitFieldInsert].capabilities.push_back(CapabilityShader);
2313 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Base'");
2314 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Insert'");
2315 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Offset'");
2316 InstructionDesc[OpBitFieldInsert].operands.push(OperandId, "'Count'");
2317
2318 InstructionDesc[OpBitFieldSExtract].capabilities.push_back(CapabilityShader);
2319 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'");
2320 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'");
2321 InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'");
2322
2323 InstructionDesc[OpBitFieldUExtract].capabilities.push_back(CapabilityShader);
2324 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'");
2325 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'");
2326 InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'");
2327
2328 InstructionDesc[OpBitReverse].capabilities.push_back(CapabilityShader);
2329 InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'");
2330
2331 InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'");
2332
John Kessenich140f3df2015-06-26 16:58:36 -06002333 InstructionDesc[OpSelect].operands.push(OperandId, "'Condition'");
2334 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 1'");
2335 InstructionDesc[OpSelect].operands.push(OperandId, "'Object 2'");
2336
2337 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 1'");
2338 InstructionDesc[OpIEqual].operands.push(OperandId, "'Operand 2'");
2339
2340 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 1'");
2341 InstructionDesc[OpFOrdEqual].operands.push(OperandId, "'Operand 2'");
2342
2343 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 1'");
2344 InstructionDesc[OpFUnordEqual].operands.push(OperandId, "'Operand 2'");
2345
2346 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 1'");
2347 InstructionDesc[OpINotEqual].operands.push(OperandId, "'Operand 2'");
2348
2349 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 1'");
2350 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId, "'Operand 2'");
2351
2352 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 1'");
2353 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId, "'Operand 2'");
2354
2355 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 1'");
2356 InstructionDesc[OpULessThan].operands.push(OperandId, "'Operand 2'");
2357
2358 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 1'");
2359 InstructionDesc[OpSLessThan].operands.push(OperandId, "'Operand 2'");
2360
2361 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 1'");
2362 InstructionDesc[OpFOrdLessThan].operands.push(OperandId, "'Operand 2'");
2363
2364 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 1'");
2365 InstructionDesc[OpFUnordLessThan].operands.push(OperandId, "'Operand 2'");
2366
2367 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 1'");
2368 InstructionDesc[OpUGreaterThan].operands.push(OperandId, "'Operand 2'");
2369
2370 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 1'");
2371 InstructionDesc[OpSGreaterThan].operands.push(OperandId, "'Operand 2'");
2372
2373 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 1'");
2374 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId, "'Operand 2'");
2375
2376 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 1'");
2377 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId, "'Operand 2'");
2378
2379 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 1'");
2380 InstructionDesc[OpULessThanEqual].operands.push(OperandId, "'Operand 2'");
2381
2382 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 1'");
2383 InstructionDesc[OpSLessThanEqual].operands.push(OperandId, "'Operand 2'");
2384
2385 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 1'");
2386 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId, "'Operand 2'");
2387
2388 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 1'");
2389 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId, "'Operand 2'");
2390
2391 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2392 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2393
2394 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2395 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2396
2397 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2398 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2399
2400 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 1'");
2401 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId, "'Operand 2'");
2402
John Kessenich5e4b1242015-08-06 22:53:06 -06002403 InstructionDesc[OpDPdx].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002404 InstructionDesc[OpDPdx].operands.push(OperandId, "'P'");
2405
John Kessenich5e4b1242015-08-06 22:53:06 -06002406 InstructionDesc[OpDPdy].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002407 InstructionDesc[OpDPdy].operands.push(OperandId, "'P'");
2408
John Kessenich5e4b1242015-08-06 22:53:06 -06002409 InstructionDesc[OpFwidth].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002410 InstructionDesc[OpFwidth].operands.push(OperandId, "'P'");
2411
John Kessenich55e7d112015-11-15 21:33:39 -07002412 InstructionDesc[OpDPdxFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002413 InstructionDesc[OpDPdxFine].operands.push(OperandId, "'P'");
2414
John Kessenich55e7d112015-11-15 21:33:39 -07002415 InstructionDesc[OpDPdyFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002416 InstructionDesc[OpDPdyFine].operands.push(OperandId, "'P'");
2417
John Kessenich55e7d112015-11-15 21:33:39 -07002418 InstructionDesc[OpFwidthFine].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002419 InstructionDesc[OpFwidthFine].operands.push(OperandId, "'P'");
2420
John Kessenich55e7d112015-11-15 21:33:39 -07002421 InstructionDesc[OpDPdxCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002422 InstructionDesc[OpDPdxCoarse].operands.push(OperandId, "'P'");
2423
John Kessenich55e7d112015-11-15 21:33:39 -07002424 InstructionDesc[OpDPdyCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002425 InstructionDesc[OpDPdyCoarse].operands.push(OperandId, "'P'");
2426
John Kessenich55e7d112015-11-15 21:33:39 -07002427 InstructionDesc[OpFwidthCoarse].capabilities.push_back(CapabilityDerivativeControl);
John Kessenich140f3df2015-06-26 16:58:36 -06002428 InstructionDesc[OpFwidthCoarse].operands.push(OperandId, "'P'");
2429
John Kessenich5e4b1242015-08-06 22:53:06 -06002430 InstructionDesc[OpEmitVertex].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002431
John Kessenich5e4b1242015-08-06 22:53:06 -06002432 InstructionDesc[OpEndPrimitive].capabilities.push_back(CapabilityGeometry);
John Kessenich140f3df2015-06-26 16:58:36 -06002433
2434 InstructionDesc[OpEmitStreamVertex].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002435 InstructionDesc[OpEmitStreamVertex].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002436
2437 InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId, "'Stream'");
John Kessenich55e7d112015-11-15 21:33:39 -07002438 InstructionDesc[OpEndStreamPrimitive].capabilities.push_back(CapabilityGeometryStreams);
John Kessenich140f3df2015-06-26 16:58:36 -06002439
John Kessenich5e4b1242015-08-06 22:53:06 -06002440 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Execution'");
2441 InstructionDesc[OpControlBarrier].operands.push(OperandScope, "'Memory'");
2442 InstructionDesc[OpControlBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
John Kessenich140f3df2015-06-26 16:58:36 -06002443
John Kessenich5e4b1242015-08-06 22:53:06 -06002444 InstructionDesc[OpMemoryBarrier].operands.push(OperandScope, "'Memory'");
John Kessenich140f3df2015-06-26 16:58:36 -06002445 InstructionDesc[OpMemoryBarrier].operands.push(OperandMemorySemantics, "'Semantics'");
2446
John Kessenich5e4b1242015-08-06 22:53:06 -06002447 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Image'");
2448 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Coordinate'");
2449 InstructionDesc[OpImageTexelPointer].operands.push(OperandId, "'Sample'");
John Kessenich140f3df2015-06-26 16:58:36 -06002450
2451 InstructionDesc[OpAtomicLoad].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002452 InstructionDesc[OpAtomicLoad].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002453 InstructionDesc[OpAtomicLoad].operands.push(OperandMemorySemantics, "'Semantics'");
2454
2455 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002456 InstructionDesc[OpAtomicStore].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002457 InstructionDesc[OpAtomicStore].operands.push(OperandMemorySemantics, "'Semantics'");
2458 InstructionDesc[OpAtomicStore].operands.push(OperandId, "'Value'");
2459
2460 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002461 InstructionDesc[OpAtomicExchange].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002462 InstructionDesc[OpAtomicExchange].operands.push(OperandMemorySemantics, "'Semantics'");
2463 InstructionDesc[OpAtomicExchange].operands.push(OperandId, "'Value'");
2464
2465 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002466 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandScope, "'Scope'");
2467 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Equal'");
2468 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002469 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Value'");
2470 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId, "'Comparator'");
2471
2472 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002473 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandScope, "'Scope'");
2474 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Equal'");
2475 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics, "'Unequal'");
John Kessenich140f3df2015-06-26 16:58:36 -06002476 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Value'");
2477 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId, "'Comparator'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002478 InstructionDesc[OpAtomicCompareExchangeWeak].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002479
2480 InstructionDesc[OpAtomicIIncrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002481 InstructionDesc[OpAtomicIIncrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002482 InstructionDesc[OpAtomicIIncrement].operands.push(OperandMemorySemantics, "'Semantics'");
2483
2484 InstructionDesc[OpAtomicIDecrement].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002485 InstructionDesc[OpAtomicIDecrement].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002486 InstructionDesc[OpAtomicIDecrement].operands.push(OperandMemorySemantics, "'Semantics'");
2487
2488 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002489 InstructionDesc[OpAtomicIAdd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002490 InstructionDesc[OpAtomicIAdd].operands.push(OperandMemorySemantics, "'Semantics'");
2491 InstructionDesc[OpAtomicIAdd].operands.push(OperandId, "'Value'");
2492
2493 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002494 InstructionDesc[OpAtomicISub].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002495 InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics, "'Semantics'");
2496 InstructionDesc[OpAtomicISub].operands.push(OperandId, "'Value'");
2497
2498 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002499 InstructionDesc[OpAtomicUMin].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002500 InstructionDesc[OpAtomicUMin].operands.push(OperandMemorySemantics, "'Semantics'");
2501 InstructionDesc[OpAtomicUMin].operands.push(OperandId, "'Value'");
2502
2503 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002504 InstructionDesc[OpAtomicUMax].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002505 InstructionDesc[OpAtomicUMax].operands.push(OperandMemorySemantics, "'Semantics'");
2506 InstructionDesc[OpAtomicUMax].operands.push(OperandId, "'Value'");
2507
John Kessenich5e4b1242015-08-06 22:53:06 -06002508 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Pointer'");
2509 InstructionDesc[OpAtomicSMin].operands.push(OperandScope, "'Scope'");
2510 InstructionDesc[OpAtomicSMin].operands.push(OperandMemorySemantics, "'Semantics'");
2511 InstructionDesc[OpAtomicSMin].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002512
John Kessenich5e4b1242015-08-06 22:53:06 -06002513 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Pointer'");
2514 InstructionDesc[OpAtomicSMax].operands.push(OperandScope, "'Scope'");
2515 InstructionDesc[OpAtomicSMax].operands.push(OperandMemorySemantics, "'Semantics'");
2516 InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002517
2518 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002519 InstructionDesc[OpAtomicAnd].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002520 InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics, "'Semantics'");
2521 InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Value'");
2522
2523 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002524 InstructionDesc[OpAtomicOr].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002525 InstructionDesc[OpAtomicOr].operands.push(OperandMemorySemantics, "'Semantics'");
2526 InstructionDesc[OpAtomicOr].operands.push(OperandId, "'Value'");
2527
2528 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Pointer'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002529 InstructionDesc[OpAtomicXor].operands.push(OperandScope, "'Scope'");
John Kessenich140f3df2015-06-26 16:58:36 -06002530 InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics, "'Semantics'");
2531 InstructionDesc[OpAtomicXor].operands.push(OperandId, "'Value'");
2532
John Kessenich55e7d112015-11-15 21:33:39 -07002533 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandId, "'Pointer'");
2534 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandScope, "'Scope'");
2535 InstructionDesc[OpAtomicFlagTestAndSet].operands.push(OperandMemorySemantics, "'Semantics'");
2536 InstructionDesc[OpAtomicFlagTestAndSet].capabilities.push_back(CapabilityKernel);
2537
2538 InstructionDesc[OpAtomicFlagClear].operands.push(OperandId, "'Pointer'");
2539 InstructionDesc[OpAtomicFlagClear].operands.push(OperandScope, "'Scope'");
2540 InstructionDesc[OpAtomicFlagClear].operands.push(OperandMemorySemantics, "'Semantics'");
2541 InstructionDesc[OpAtomicFlagClear].capabilities.push_back(CapabilityKernel);
2542
John Kessenich5e4b1242015-08-06 22:53:06 -06002543 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich55e7d112015-11-15 21:33:39 -07002544 InstructionDesc[OpLoopMerge].operands.push(OperandId, "'Continue Target'");
John Kessenich140f3df2015-06-26 16:58:36 -06002545 InstructionDesc[OpLoopMerge].operands.push(OperandLoop, "");
2546
John Kessenich5e4b1242015-08-06 22:53:06 -06002547 InstructionDesc[OpSelectionMerge].operands.push(OperandId, "'Merge Block'");
John Kessenich140f3df2015-06-26 16:58:36 -06002548 InstructionDesc[OpSelectionMerge].operands.push(OperandSelect, "");
2549
2550 InstructionDesc[OpBranch].operands.push(OperandId, "'Target Label'");
2551
2552 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'Condition'");
2553 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'True Label'");
2554 InstructionDesc[OpBranchConditional].operands.push(OperandId, "'False Label'");
2555 InstructionDesc[OpBranchConditional].operands.push(OperandVariableLiterals, "'Branch weights'");
2556
2557 InstructionDesc[OpSwitch].operands.push(OperandId, "'Selector'");
2558 InstructionDesc[OpSwitch].operands.push(OperandId, "'Default'");
2559 InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId, "'Target'");
2560
John Kessenich5e4b1242015-08-06 22:53:06 -06002561 InstructionDesc[OpKill].capabilities.push_back(CapabilityShader);
John Kessenich140f3df2015-06-26 16:58:36 -06002562
2563 InstructionDesc[OpReturnValue].operands.push(OperandId, "'Value'");
2564
John Kessenich5e4b1242015-08-06 22:53:06 -06002565 InstructionDesc[OpLifetimeStart].operands.push(OperandId, "'Pointer'");
2566 InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002567 InstructionDesc[OpLifetimeStart].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002568
John Kessenich5e4b1242015-08-06 22:53:06 -06002569 InstructionDesc[OpLifetimeStop].operands.push(OperandId, "'Pointer'");
2570 InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber, "'Size'");
John Kessenich55e7d112015-11-15 21:33:39 -07002571 InstructionDesc[OpLifetimeStop].capabilities.push_back(CapabilityKernel);
John Kessenich140f3df2015-06-26 16:58:36 -06002572
John Kessenich55e7d112015-11-15 21:33:39 -07002573 InstructionDesc[OpGroupAsyncCopy].capabilities.push_back(CapabilityKernel);
2574 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandScope, "'Execution'");
2575 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Destination'");
2576 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Source'");
2577 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Num Elements'");
2578 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Stride'");
2579 InstructionDesc[OpGroupAsyncCopy].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002580
John Kessenich55e7d112015-11-15 21:33:39 -07002581 InstructionDesc[OpGroupWaitEvents].capabilities.push_back(CapabilityKernel);
2582 InstructionDesc[OpGroupWaitEvents].operands.push(OperandScope, "'Execution'");
2583 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Num Events'");
2584 InstructionDesc[OpGroupWaitEvents].operands.push(OperandId, "'Events List'");
John Kessenich140f3df2015-06-26 16:58:36 -06002585
John Kessenich5e4b1242015-08-06 22:53:06 -06002586 InstructionDesc[OpGroupAll].capabilities.push_back(CapabilityGroups);
2587 InstructionDesc[OpGroupAll].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002588 InstructionDesc[OpGroupAll].operands.push(OperandId, "'Predicate'");
2589
John Kessenich5e4b1242015-08-06 22:53:06 -06002590 InstructionDesc[OpGroupAny].capabilities.push_back(CapabilityGroups);
2591 InstructionDesc[OpGroupAny].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002592 InstructionDesc[OpGroupAny].operands.push(OperandId, "'Predicate'");
2593
John Kessenich5e4b1242015-08-06 22:53:06 -06002594 InstructionDesc[OpGroupBroadcast].capabilities.push_back(CapabilityGroups);
2595 InstructionDesc[OpGroupBroadcast].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002596 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'Value'");
2597 InstructionDesc[OpGroupBroadcast].operands.push(OperandId, "'LocalId'");
2598
John Kessenich5e4b1242015-08-06 22:53:06 -06002599 InstructionDesc[OpGroupIAdd].capabilities.push_back(CapabilityGroups);
2600 InstructionDesc[OpGroupIAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002601 InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation, "'Operation'");
2602 InstructionDesc[OpGroupIAdd].operands.push(OperandId, "'X'");
2603
John Kessenich5e4b1242015-08-06 22:53:06 -06002604 InstructionDesc[OpGroupFAdd].capabilities.push_back(CapabilityGroups);
2605 InstructionDesc[OpGroupFAdd].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002606 InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation, "'Operation'");
2607 InstructionDesc[OpGroupFAdd].operands.push(OperandId, "'X'");
2608
John Kessenich5e4b1242015-08-06 22:53:06 -06002609 InstructionDesc[OpGroupUMin].capabilities.push_back(CapabilityGroups);
2610 InstructionDesc[OpGroupUMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002611 InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation, "'Operation'");
2612 InstructionDesc[OpGroupUMin].operands.push(OperandId, "'X'");
2613
John Kessenich5e4b1242015-08-06 22:53:06 -06002614 InstructionDesc[OpGroupSMin].capabilities.push_back(CapabilityGroups);
2615 InstructionDesc[OpGroupSMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002616 InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation, "'Operation'");
2617 InstructionDesc[OpGroupSMin].operands.push(OperandId, "X");
2618
John Kessenich5e4b1242015-08-06 22:53:06 -06002619 InstructionDesc[OpGroupFMin].capabilities.push_back(CapabilityGroups);
2620 InstructionDesc[OpGroupFMin].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002621 InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation, "'Operation'");
2622 InstructionDesc[OpGroupFMin].operands.push(OperandId, "X");
2623
John Kessenich5e4b1242015-08-06 22:53:06 -06002624 InstructionDesc[OpGroupUMax].capabilities.push_back(CapabilityGroups);
2625 InstructionDesc[OpGroupUMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002626 InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation, "'Operation'");
2627 InstructionDesc[OpGroupUMax].operands.push(OperandId, "X");
2628
John Kessenich5e4b1242015-08-06 22:53:06 -06002629 InstructionDesc[OpGroupSMax].capabilities.push_back(CapabilityGroups);
2630 InstructionDesc[OpGroupSMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002631 InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation, "'Operation'");
2632 InstructionDesc[OpGroupSMax].operands.push(OperandId, "X");
2633
John Kessenich5e4b1242015-08-06 22:53:06 -06002634 InstructionDesc[OpGroupFMax].capabilities.push_back(CapabilityGroups);
2635 InstructionDesc[OpGroupFMax].operands.push(OperandScope, "'Execution'");
John Kessenich140f3df2015-06-26 16:58:36 -06002636 InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation, "'Operation'");
2637 InstructionDesc[OpGroupFMax].operands.push(OperandId, "X");
2638
John Kessenich5e4b1242015-08-06 22:53:06 -06002639 InstructionDesc[OpReadPipe].capabilities.push_back(CapabilityPipes);
2640 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pipe'");
2641 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002642 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Size'");
2643 InstructionDesc[OpReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002644
John Kessenich5e4b1242015-08-06 22:53:06 -06002645 InstructionDesc[OpWritePipe].capabilities.push_back(CapabilityPipes);
2646 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pipe'");
2647 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002648 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Size'");
2649 InstructionDesc[OpWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002650
John Kessenich5e4b1242015-08-06 22:53:06 -06002651 InstructionDesc[OpReservedReadPipe].capabilities.push_back(CapabilityPipes);
2652 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pipe'");
2653 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Reserve Id'");
2654 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Index'");
2655 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002656 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Size'");
2657 InstructionDesc[OpReservedReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002658
John Kessenich5e4b1242015-08-06 22:53:06 -06002659 InstructionDesc[OpReservedWritePipe].capabilities.push_back(CapabilityPipes);
2660 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pipe'");
2661 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Reserve Id'");
2662 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Index'");
2663 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Pointer'");
John Kessenich55e7d112015-11-15 21:33:39 -07002664 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Size'");
2665 InstructionDesc[OpReservedWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002666
John Kessenich5e4b1242015-08-06 22:53:06 -06002667 InstructionDesc[OpReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2668 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2669 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002670 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2671 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002672
John Kessenich5e4b1242015-08-06 22:53:06 -06002673 InstructionDesc[OpReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2674 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2675 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002676 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2677 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002678
John Kessenich5e4b1242015-08-06 22:53:06 -06002679 InstructionDesc[OpCommitReadPipe].capabilities.push_back(CapabilityPipes);
2680 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Pipe'");
2681 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002682 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2683 InstructionDesc[OpCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002684
John Kessenich5e4b1242015-08-06 22:53:06 -06002685 InstructionDesc[OpCommitWritePipe].capabilities.push_back(CapabilityPipes);
2686 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Pipe'");
2687 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002688 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2689 InstructionDesc[OpCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002690
John Kessenich5e4b1242015-08-06 22:53:06 -06002691 InstructionDesc[OpIsValidReserveId].capabilities.push_back(CapabilityPipes);
2692 InstructionDesc[OpIsValidReserveId].operands.push(OperandId, "'Reserve Id'");
John Kessenich140f3df2015-06-26 16:58:36 -06002693
John Kessenich5e4b1242015-08-06 22:53:06 -06002694 InstructionDesc[OpGetNumPipePackets].capabilities.push_back(CapabilityPipes);
2695 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002696 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Size'");
2697 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002698
John Kessenich5e4b1242015-08-06 22:53:06 -06002699 InstructionDesc[OpGetMaxPipePackets].capabilities.push_back(CapabilityPipes);
2700 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Pipe'");
John Kessenich55e7d112015-11-15 21:33:39 -07002701 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Size'");
2702 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002703
John Kessenich5e4b1242015-08-06 22:53:06 -06002704 InstructionDesc[OpGroupReserveReadPipePackets].capabilities.push_back(CapabilityPipes);
2705 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandScope, "'Execution'");
2706 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Pipe'");
2707 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002708 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Size'");
2709 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002710
John Kessenich5e4b1242015-08-06 22:53:06 -06002711 InstructionDesc[OpGroupReserveWritePipePackets].capabilities.push_back(CapabilityPipes);
2712 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandScope, "'Execution'");
2713 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Pipe'");
2714 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Num Packets'");
John Kessenich55e7d112015-11-15 21:33:39 -07002715 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Size'");
2716 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002717
John Kessenich5e4b1242015-08-06 22:53:06 -06002718 InstructionDesc[OpGroupCommitReadPipe].capabilities.push_back(CapabilityPipes);
2719 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandScope, "'Execution'");
2720 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Pipe'");
2721 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002722 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Size'");
2723 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002724
John Kessenich5e4b1242015-08-06 22:53:06 -06002725 InstructionDesc[OpGroupCommitWritePipe].capabilities.push_back(CapabilityPipes);
2726 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandScope, "'Execution'");
2727 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Pipe'");
2728 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Reserve Id'");
John Kessenich55e7d112015-11-15 21:33:39 -07002729 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Size'");
2730 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId, "'Packet Alignment'");
John Kessenich140f3df2015-06-26 16:58:36 -06002731
John Kessenich5e4b1242015-08-06 22:53:06 -06002732 InstructionDesc[OpBuildNDRange].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002733 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkSize'");
2734 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'LocalWorkSize'");
2735 InstructionDesc[OpBuildNDRange].operands.push(OperandId, "'GlobalWorkOffset'");
2736
John Kessenich5e4b1242015-08-06 22:53:06 -06002737 InstructionDesc[OpGetDefaultQueue].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002738
John Kessenich5e4b1242015-08-06 22:53:06 -06002739 InstructionDesc[OpCaptureEventProfilingInfo].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002740
John Kessenich5e4b1242015-08-06 22:53:06 -06002741 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Event'");
2742 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Profiling Info'");
2743 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId, "'Value'");
John Kessenich140f3df2015-06-26 16:58:36 -06002744
John Kessenich5e4b1242015-08-06 22:53:06 -06002745 InstructionDesc[OpSetUserEventStatus].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002746
John Kessenich5e4b1242015-08-06 22:53:06 -06002747 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Event'");
2748 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId, "'Status'");
John Kessenich140f3df2015-06-26 16:58:36 -06002749
John Kessenich5e4b1242015-08-06 22:53:06 -06002750 InstructionDesc[OpIsValidEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2751 InstructionDesc[OpIsValidEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002752
John Kessenich5e4b1242015-08-06 22:53:06 -06002753 InstructionDesc[OpCreateUserEvent].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002754
John Kessenich5e4b1242015-08-06 22:53:06 -06002755 InstructionDesc[OpRetainEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2756 InstructionDesc[OpRetainEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002757
John Kessenich5e4b1242015-08-06 22:53:06 -06002758 InstructionDesc[OpReleaseEvent].capabilities.push_back(CapabilityDeviceEnqueue);
2759 InstructionDesc[OpReleaseEvent].operands.push(OperandId, "'Event'");
John Kessenich140f3df2015-06-26 16:58:36 -06002760
John Kessenich5e4b1242015-08-06 22:53:06 -06002761 InstructionDesc[OpGetKernelWorkGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002762 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002763 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param'");
2764 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Size'");
2765 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002766
John Kessenich5e4b1242015-08-06 22:53:06 -06002767 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002768 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002769 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param'");
2770 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Size'");
2771 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002772
John Kessenich5e4b1242015-08-06 22:53:06 -06002773 InstructionDesc[OpGetKernelNDrangeSubGroupCount].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002774 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'ND Range'");
2775 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002776 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param'");
2777 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Size'");
2778 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002779
John Kessenich5e4b1242015-08-06 22:53:06 -06002780 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].capabilities.push_back(CapabilityDeviceEnqueue);
John Kessenich140f3df2015-06-26 16:58:36 -06002781 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'ND Range'");
2782 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Invoke'");
John Kessenich5e4b1242015-08-06 22:53:06 -06002783 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param'");
2784 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Size'");
2785 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId, "'Param Align'");
John Kessenich140f3df2015-06-26 16:58:36 -06002786
John Kessenich5e4b1242015-08-06 22:53:06 -06002787 InstructionDesc[OpEnqueueKernel].capabilities.push_back(CapabilityDeviceEnqueue);
2788 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Queue'");
2789 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Flags'");
John Kessenich140f3df2015-06-26 16:58:36 -06002790 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'ND Range'");
2791 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Num Events'");
2792 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Wait Events'");
2793 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Ret Event'");
2794 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Invoke'");
2795 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param'");
2796 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Size'");
2797 InstructionDesc[OpEnqueueKernel].operands.push(OperandId, "'Param Align'");
2798 InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds, "'Local Size'");
2799
John Kessenich5e4b1242015-08-06 22:53:06 -06002800 InstructionDesc[OpEnqueueMarker].capabilities.push_back(CapabilityDeviceEnqueue);
2801 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Queue'");
John Kessenich140f3df2015-06-26 16:58:36 -06002802 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'");
2803 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'");
2804 InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'");
Rex Xu9d93a232016-05-05 12:30:44 +08002805
Rex Xu51596642016-09-21 18:56:12 +08002806 InstructionDesc[OpSubgroupBallotKHR].operands.push(OperandId, "'Predicate'");
2807
2808 InstructionDesc[OpSubgroupFirstInvocationKHR].operands.push(OperandId, "'Value'");
2809
Ashwin Kolhec720f3e2017-01-18 14:16:49 -08002810 InstructionDesc[OpSubgroupAnyKHR].capabilities.push_back(CapabilitySubgroupVoteKHR);
2811 InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandScope, "'Execution'");
2812 InstructionDesc[OpSubgroupAnyKHR].operands.push(OperandId, "'Predicate'");
2813
2814 InstructionDesc[OpSubgroupAllKHR].capabilities.push_back(CapabilitySubgroupVoteKHR);
2815 InstructionDesc[OpSubgroupAllKHR].operands.push(OperandScope, "'Execution'");
2816 InstructionDesc[OpSubgroupAllKHR].operands.push(OperandId, "'Predicate'");
2817
2818 InstructionDesc[OpSubgroupAllEqualKHR].capabilities.push_back(CapabilitySubgroupVoteKHR);
2819 InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandScope, "'Execution'");
2820 InstructionDesc[OpSubgroupAllEqualKHR].operands.push(OperandId, "'Predicate'");
2821
chaocf200da82016-12-20 12:44:35 -08002822 InstructionDesc[OpSubgroupReadInvocationKHR].capabilities.push_back(CapabilityGroups);
2823 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Value'");
2824 InstructionDesc[OpSubgroupReadInvocationKHR].operands.push(OperandId, "'Index'");
2825
Rex Xu9d93a232016-05-05 12:30:44 +08002826#ifdef AMD_EXTENSIONS
2827 InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2828 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2829 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2830 InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
2831
2832 InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
2833 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
2834 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2835 InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'");
2836
2837 InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2838 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2839 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2840 InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'");
2841
2842 InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2843 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2844 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2845 InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X");
2846
2847 InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
2848 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
2849 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2850 InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X");
2851
2852 InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2853 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2854 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2855 InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X");
2856
2857 InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2858 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2859 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2860 InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X");
2861
2862 InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
2863 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
2864 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
2865 InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X");
2866#endif
John Kessenich140f3df2015-06-26 16:58:36 -06002867}
2868
2869}; // end spv namespace