blob: d6fe37ba28b42ad15dedce874b2f29a1bd086891 [file] [log] [blame]
John Kessenichacba7722015-03-04 03:48:38 +00001//
2//Copyright (C) 2014 LunarG, Inc.
3//
4//All rights reserved.
5//
6//Redistribution and use in source and binary forms, with or without
7//modification, are permitted provided that the following conditions
8//are met:
9//
10// Redistributions of source code must retain the above copyright
11// notice, this list of conditions and the following disclaimer.
12//
13// Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following
15// disclaimer in the documentation and/or other materials provided
16// with the distribution.
17//
18// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
19// contributors may be used to endorse or promote products derived
20// from this software without specific prior written permission.
21//
22//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33//POSSIBILITY OF SUCH DAMAGE.
34
35//
36// Author: John Kessenich, LunarG
37//
38
39//
40// Programmatically fill in instruction/operand information.
41//
42
43#include "spirv.h"
44
45#include "doc.h"
46
47#include <stdio.h>
48#include <string.h>
49#include <algorithm>
50
51#define LINE_BREAK " +\n"
52#define GAP " +\n +\n"
53#define NOTE GAP "*Note:* "
54
55namespace spv {
56
57// The set of objects that hold all the instruction/operand
58// parameterization information.
59InstructionParameters InstructionDesc[spv::OpCount];
60
61// Set up all the parameterizing descriptions of the opcodes, operands, etc.
62void Parameterize()
63{
64 // Exceptions to having a result <id> and a resulting type <id>.
65 // (Everything is initialized to have both).
66
67 InstructionDesc[OpNop] .setResultAndType(false, false);
68 InstructionDesc[OpSource] .setResultAndType(false, false);
69 InstructionDesc[OpSourceExtension].setResultAndType(false, false);
70 InstructionDesc[OpExtension] .setResultAndType(false, false);
71 InstructionDesc[OpExtInstImport] .setResultAndType(true, false);
72 InstructionDesc[OpMemoryModel] .setResultAndType(false, false);
73 InstructionDesc[OpEntryPoint] .setResultAndType(false, false);
74 InstructionDesc[OpExecutionMode] .setResultAndType(false, false);
75
76 InstructionDesc[OpTypeVoid] .setResultAndType(true, false);
77 InstructionDesc[OpTypeBool] .setResultAndType(true, false);
78 InstructionDesc[OpTypeInt] .setResultAndType(true, false);
79 InstructionDesc[OpTypeFloat] .setResultAndType(true, false);
80 InstructionDesc[OpTypeVector] .setResultAndType(true, false);
81 InstructionDesc[OpTypeMatrix] .setResultAndType(true, false);
82 InstructionDesc[OpTypeSampler] .setResultAndType(true, false);
83 InstructionDesc[OpTypeFilter] .setResultAndType(true, false);
84 InstructionDesc[OpTypeArray] .setResultAndType(true, false);
85 InstructionDesc[OpTypeRuntimeArray].setResultAndType(true, false);
86 InstructionDesc[OpTypeStruct] .setResultAndType(true, false);
87 InstructionDesc[OpTypeOpaque] .setResultAndType(true, false);
88 InstructionDesc[OpTypePointer] .setResultAndType(true, false);
89 InstructionDesc[OpTypeFunction] .setResultAndType(true, false);
90
91 InstructionDesc[OpTypeEvent] .setResultAndType(true, false);
92 InstructionDesc[OpTypeDeviceEvent] .setResultAndType(true, false);
93 InstructionDesc[OpTypeReserveId] .setResultAndType(true, false);
94 InstructionDesc[OpTypeQueue] .setResultAndType(true, false);
95 InstructionDesc[OpTypePipe] .setResultAndType(true, false);
96 InstructionDesc[OpFunctionEnd] .setResultAndType(false, false);
97 InstructionDesc[OpStore] .setResultAndType(false, false);
98 InstructionDesc[OpDecorationGroup] .setResultAndType(true, false);
99 InstructionDesc[OpDecorate] .setResultAndType(false, false);
100 InstructionDesc[OpMemberDecorate] .setResultAndType(false, false);
101 InstructionDesc[OpGroupDecorate] .setResultAndType(false, false);
102 InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false);
103 InstructionDesc[OpName] .setResultAndType(false, false);
104 InstructionDesc[OpMemberName] .setResultAndType(false, false);
105 InstructionDesc[OpString] .setResultAndType(true, false);
106 InstructionDesc[OpLine] .setResultAndType(false, false);
107
108 InstructionDesc[OpCopyMemory] .setResultAndType(false, false);
109 InstructionDesc[OpCopyMemorySized].setResultAndType(false, false);
110
111 InstructionDesc[OpEmitVertex] .setResultAndType(false, false);
112 InstructionDesc[OpEndPrimitive] .setResultAndType(false, false);
113 InstructionDesc[OpEmitStreamVertex] .setResultAndType(false, false);
114 InstructionDesc[OpEndStreamPrimitive].setResultAndType(false, false);
115
116 InstructionDesc[OpControlBarrier].setResultAndType(false, false);
117 InstructionDesc[OpMemoryBarrier] .setResultAndType(false, false);
118
119 InstructionDesc[OpAtomicInit].setResultAndType(false, false);
120 InstructionDesc[OpAtomicStore].setResultAndType(false, false);
121
122 InstructionDesc[OpLoopMerge] .setResultAndType(false, false);
123 InstructionDesc[OpSelectionMerge] .setResultAndType(false, false);
124 InstructionDesc[OpLabel] .setResultAndType(true, false);
125 InstructionDesc[OpBranch] .setResultAndType(false, false);
126 InstructionDesc[OpBranchConditional].setResultAndType(false, false);
127 InstructionDesc[OpSwitch] .setResultAndType(false, false);
128 InstructionDesc[OpKill] .setResultAndType(false, false);
129 InstructionDesc[OpReturn] .setResultAndType(false, false);
130 InstructionDesc[OpReturnValue] .setResultAndType(false, false);
131 InstructionDesc[OpUnreachable] .setResultAndType(false, false);
132
133 InstructionDesc[OpLifetimeStart] .setResultAndType(false, false);
134 InstructionDesc[OpLifetimeStop] .setResultAndType(false, false);
135
136 InstructionDesc[OpCompileFlag] .setResultAndType(false, false);
137 InstructionDesc[OpCommitReadPipe] .setResultAndType(false, false);
138 InstructionDesc[OpCommitWritePipe].setResultAndType(false, false);
139 InstructionDesc[OpGroupCommitWritePipe].setResultAndType(false, false);
140 InstructionDesc[OpGroupCommitReadPipe].setResultAndType(false, false);
141 InstructionDesc[OpCaptureEventProfilingInfo].setResultAndType(false, false);
142 InstructionDesc[OpSetUserEventStatus].setResultAndType(false, false);
143 InstructionDesc[OpRetainEvent].setResultAndType(false, false);
144 InstructionDesc[OpReleaseEvent].setResultAndType(false, false);
145
146 // set name of operator, an initial set of <id> style operands, and the description
147
148 #define SET_OPNAME(index) InstructionDesc[index].opName = #index;
149
150 SET_OPNAME(OpNop);
151 SET_OPNAME(OpSource);
152 SET_OPNAME(OpSourceExtension);
153 SET_OPNAME(OpExtension);
154 SET_OPNAME(OpExtInstImport);
155 SET_OPNAME(OpMemoryModel);
156 SET_OPNAME(OpEntryPoint);
157 SET_OPNAME(OpExecutionMode);
158
159 SET_OPNAME(OpTypeVoid);
160 SET_OPNAME(OpTypeInt);
161 SET_OPNAME(OpTypeBool);
162 SET_OPNAME(OpTypeFloat);
163 SET_OPNAME(OpTypeVector);
164 SET_OPNAME(OpTypeMatrix);
165 SET_OPNAME(OpTypeSampler);
166 SET_OPNAME(OpTypeFilter);
167 SET_OPNAME(OpTypeArray);
168 SET_OPNAME(OpTypeRuntimeArray);
169 SET_OPNAME(OpTypeStruct);
170 SET_OPNAME(OpTypeOpaque);
171 SET_OPNAME(OpTypePointer);
172 SET_OPNAME(OpTypeFunction);
173
174 SET_OPNAME(OpTypeEvent);
175 SET_OPNAME(OpTypeDeviceEvent);
176 SET_OPNAME(OpTypeReserveId);
177 SET_OPNAME(OpTypeQueue);
178 SET_OPNAME(OpTypePipe);
179
180 SET_OPNAME(OpConstantTrue);
181 SET_OPNAME(OpConstantFalse);
182 SET_OPNAME(OpConstant);
183 SET_OPNAME(OpConstantComposite);
184 SET_OPNAME(OpConstantNullPointer);
185 SET_OPNAME(OpConstantNullObject);
186 SET_OPNAME(OpConstantSampler);
187
188 SET_OPNAME(OpSpecConstantTrue);
189 SET_OPNAME(OpSpecConstantFalse);
190 SET_OPNAME(OpSpecConstant);
191 SET_OPNAME(OpSpecConstantComposite);
192
193 SET_OPNAME(OpVariable);
194 SET_OPNAME(OpVariableArray);
195
196 SET_OPNAME(OpFunction);
197 SET_OPNAME(OpFunctionParameter);
198 SET_OPNAME(OpFunctionEnd);
199 SET_OPNAME(OpFunctionCall);
200
201 SET_OPNAME(OpExtInst);
202
203 SET_OPNAME(OpUndef);
204 SET_OPNAME(OpLoad);
205 SET_OPNAME(OpStore);
206 SET_OPNAME(OpPhi);
207
208 SET_OPNAME(OpDecorationGroup);
209 SET_OPNAME(OpDecorate);
210 SET_OPNAME(OpMemberDecorate);
211 SET_OPNAME(OpGroupDecorate);
212 SET_OPNAME(OpGroupMemberDecorate);
213 SET_OPNAME(OpName);
214 SET_OPNAME(OpMemberName);
215 SET_OPNAME(OpString);
216 SET_OPNAME(OpLine);
217
218 SET_OPNAME(OpVectorExtractDynamic);
219 SET_OPNAME(OpVectorInsertDynamic);
220 SET_OPNAME(OpVectorShuffle);
221
222 SET_OPNAME(OpCompositeConstruct);
223 SET_OPNAME(OpCompositeExtract);
224 SET_OPNAME(OpCompositeInsert);
225
226 SET_OPNAME(OpCopyObject);
227 SET_OPNAME(OpCopyMemory);
228 SET_OPNAME(OpCopyMemorySized);
229
230 SET_OPNAME(OpSampler);
231
232 SET_OPNAME(OpTextureSample);
233 SET_OPNAME(OpTextureSampleDref);
234 SET_OPNAME(OpTextureSampleLod);
235 SET_OPNAME(OpTextureSampleProj);
236 SET_OPNAME(OpTextureSampleGrad);
237 SET_OPNAME(OpTextureSampleOffset);
238 SET_OPNAME(OpTextureSampleProjLod);
239 SET_OPNAME(OpTextureSampleProjGrad);
240 SET_OPNAME(OpTextureSampleLodOffset);
241 SET_OPNAME(OpTextureSampleProjOffset);
242 SET_OPNAME(OpTextureSampleGradOffset);
243 SET_OPNAME(OpTextureSampleProjLodOffset);
244 SET_OPNAME(OpTextureSampleProjGradOffset);
245 SET_OPNAME(OpTextureFetchTexel);
246 SET_OPNAME(OpTextureFetchTexelOffset);
247 SET_OPNAME(OpTextureFetchSample);
248 SET_OPNAME(OpTextureFetchBuffer);
249 SET_OPNAME(OpTextureGather);
250 SET_OPNAME(OpTextureGatherOffset);
251 SET_OPNAME(OpTextureGatherOffsets);
252 SET_OPNAME(OpTextureQuerySizeLod);
253 SET_OPNAME(OpTextureQuerySize);
254 SET_OPNAME(OpTextureQueryLod);
255 SET_OPNAME(OpTextureQueryLevels);
256 SET_OPNAME(OpTextureQuerySamples);
257
258 SET_OPNAME(OpAccessChain);
259 SET_OPNAME(OpInBoundsAccessChain);
260
261 SET_OPNAME(OpSNegate);
262 SET_OPNAME(OpFNegate);
263 SET_OPNAME(OpNot);
264 SET_OPNAME(OpAny);
265 SET_OPNAME(OpAll);
266
267 SET_OPNAME(OpConvertFToU);
268 SET_OPNAME(OpConvertFToS);
269 SET_OPNAME(OpConvertSToF);
270 SET_OPNAME(OpConvertUToF);
271 SET_OPNAME(OpFConvert);
272 SET_OPNAME(OpSConvert);
273 SET_OPNAME(OpUConvert);
274 SET_OPNAME(OpConvertPtrToU);
275 SET_OPNAME(OpConvertUToPtr);
276 SET_OPNAME(OpPtrCastToGeneric);
277 SET_OPNAME(OpGenericCastToPtr);
278 SET_OPNAME(OpGenericCastToPtrExplicit);
279 SET_OPNAME(OpGenericPtrMemSemantics);
280 SET_OPNAME(OpBitcast);
281 SET_OPNAME(OpTranspose);
282
283 SET_OPNAME(OpIsNan);
284 SET_OPNAME(OpIsInf);
285 SET_OPNAME(OpIsFinite);
286 SET_OPNAME(OpIsNormal);
287 SET_OPNAME(OpSignBitSet);
288 SET_OPNAME(OpLessOrGreater);
289 SET_OPNAME(OpOrdered);
290 SET_OPNAME(OpUnordered);
291
292 SET_OPNAME(OpArrayLength);
293
294 SET_OPNAME(OpIAdd);
295 SET_OPNAME(OpFAdd);
296 SET_OPNAME(OpISub);
297 SET_OPNAME(OpFSub);
298 SET_OPNAME(OpIMul);
299 SET_OPNAME(OpFMul);
300 SET_OPNAME(OpUDiv);
301 SET_OPNAME(OpSDiv);
302 SET_OPNAME(OpFDiv);
303 SET_OPNAME(OpUMod);
304 SET_OPNAME(OpSRem);
305 SET_OPNAME(OpSMod);
306 SET_OPNAME(OpFRem);
307 SET_OPNAME(OpFMod);
308
309 SET_OPNAME(OpVectorTimesScalar);
310 SET_OPNAME(OpMatrixTimesScalar);
311 SET_OPNAME(OpVectorTimesMatrix);
312 SET_OPNAME(OpMatrixTimesVector);
313 SET_OPNAME(OpMatrixTimesMatrix);
314 SET_OPNAME(OpOuterProduct);
315 SET_OPNAME(OpDot);
316
317 SET_OPNAME(OpShiftRightLogical);
318 SET_OPNAME(OpShiftRightArithmetic);
319 SET_OPNAME(OpShiftLeftLogical);
320 SET_OPNAME(OpLogicalOr);
321 SET_OPNAME(OpLogicalXor);
322 SET_OPNAME(OpLogicalAnd);
323
324 SET_OPNAME(OpBitwiseOr);
325 SET_OPNAME(OpBitwiseXor);
326 SET_OPNAME(OpBitwiseAnd);
327
328 SET_OPNAME(OpSelect);
329
330 SET_OPNAME(OpIEqual);
331 SET_OPNAME(OpFOrdEqual);
332 SET_OPNAME(OpFUnordEqual);
333 SET_OPNAME(OpINotEqual);
334 SET_OPNAME(OpFOrdNotEqual);
335 SET_OPNAME(OpFUnordNotEqual);
336 SET_OPNAME(OpULessThan);
337 SET_OPNAME(OpSLessThan);
338 SET_OPNAME(OpFOrdLessThan);
339 SET_OPNAME(OpFUnordLessThan);
340 SET_OPNAME(OpUGreaterThan);
341 SET_OPNAME(OpSGreaterThan);
342 SET_OPNAME(OpFOrdGreaterThan);
343 SET_OPNAME(OpFUnordGreaterThan);
344 SET_OPNAME(OpULessThanEqual);
345 SET_OPNAME(OpSLessThanEqual);
346 SET_OPNAME(OpFOrdLessThanEqual);
347 SET_OPNAME(OpFUnordLessThanEqual);
348 SET_OPNAME(OpUGreaterThanEqual);
349 SET_OPNAME(OpSGreaterThanEqual);
350 SET_OPNAME(OpFOrdGreaterThanEqual);
351 SET_OPNAME(OpFUnordGreaterThanEqual);
352
353 SET_OPNAME(OpDPdx);
354 SET_OPNAME(OpDPdy);
355 SET_OPNAME(OpFwidth);
356 SET_OPNAME(OpDPdxFine);
357 SET_OPNAME(OpDPdyFine);
358 SET_OPNAME(OpFwidthFine);
359 SET_OPNAME(OpDPdxCoarse);
360 SET_OPNAME(OpDPdyCoarse);
361 SET_OPNAME(OpFwidthCoarse);
362 SET_OPNAME(OpEmitVertex);
363 SET_OPNAME(OpEndPrimitive);
364 SET_OPNAME(OpEmitStreamVertex);
365 SET_OPNAME(OpEndStreamPrimitive);
366 SET_OPNAME(OpControlBarrier);
367 SET_OPNAME(OpMemoryBarrier);
368
369 SET_OPNAME(OpImagePointer);
370
371 SET_OPNAME(OpAtomicInit);
372 SET_OPNAME(OpAtomicLoad);
373 SET_OPNAME(OpAtomicStore);
374 SET_OPNAME(OpAtomicExchange);
375 SET_OPNAME(OpAtomicCompareExchange);
376 SET_OPNAME(OpAtomicCompareExchangeWeak);
377 SET_OPNAME(OpAtomicIIncrement);
378 SET_OPNAME(OpAtomicIDecrement);
379 SET_OPNAME(OpAtomicIAdd);
380 SET_OPNAME(OpAtomicISub);
381 SET_OPNAME(OpAtomicUMin);
382 SET_OPNAME(OpAtomicUMax);
383 SET_OPNAME(OpAtomicAnd);
384 SET_OPNAME(OpAtomicOr);
385 SET_OPNAME(OpAtomicXor);
386
387 SET_OPNAME(OpLoopMerge);
388 SET_OPNAME(OpSelectionMerge);
389 SET_OPNAME(OpLabel);
390 SET_OPNAME(OpBranch);
391 SET_OPNAME(OpBranchConditional);
392 SET_OPNAME(OpSwitch);
393 SET_OPNAME(OpKill);
394 SET_OPNAME(OpReturn);
395 SET_OPNAME(OpReturnValue);
396 SET_OPNAME(OpUnreachable);
397
398 SET_OPNAME(OpLifetimeStart);
399 SET_OPNAME(OpLifetimeStop);
400 SET_OPNAME(OpCompileFlag);
401
402 SET_OPNAME(OpAsyncGroupCopy);
403 SET_OPNAME(OpWaitGroupEvents);
404
405 SET_OPNAME(OpGroupAll);
406 SET_OPNAME(OpGroupAny);
407 SET_OPNAME(OpGroupBroadcast);
408 SET_OPNAME(OpGroupIAdd);
409 SET_OPNAME(OpGroupFAdd);
410 SET_OPNAME(OpGroupFMin);
411 SET_OPNAME(OpGroupUMin);
412 SET_OPNAME(OpGroupSMin);
413 SET_OPNAME(OpGroupFMax);
414 SET_OPNAME(OpGroupUMax);
415 SET_OPNAME(OpGroupSMax);
416
417 SET_OPNAME(OpReadPipe);
418 SET_OPNAME(OpWritePipe);
419 SET_OPNAME(OpReservedReadPipe);
420 SET_OPNAME(OpReservedWritePipe);
421 SET_OPNAME(OpReserveReadPipePackets);
422 SET_OPNAME(OpReserveWritePipePackets);
423 SET_OPNAME(OpCommitReadPipe);
424 SET_OPNAME(OpCommitWritePipe);
425 SET_OPNAME(OpIsValidReserveId);
426 SET_OPNAME(OpGetNumPipePackets);
427 SET_OPNAME(OpGetMaxPipePackets);
428 SET_OPNAME(OpGroupReserveReadPipePackets);
429 SET_OPNAME(OpGroupReserveWritePipePackets);
430 SET_OPNAME(OpGroupCommitReadPipe);
431 SET_OPNAME(OpGroupCommitWritePipe);
432
433 // Device-side enqueueing of kernels
434 SET_OPNAME(OpBuildNDRange);
435 SET_OPNAME(OpGetDefaultQueue);
436 SET_OPNAME(OpCaptureEventProfilingInfo);
437 SET_OPNAME(OpSetUserEventStatus);
438 SET_OPNAME(OpIsValidEvent);
439 SET_OPNAME(OpCreateUserEvent);
440 SET_OPNAME(OpRetainEvent);
441 SET_OPNAME(OpReleaseEvent);
442 SET_OPNAME(OpGetKernelWorkGroupSize);
443 SET_OPNAME(OpGetKernelPreferredWorkGroupSizeMultiple);
444 SET_OPNAME(OpGetKernelNDrangeMaxSubGroupSize);
445 SET_OPNAME(OpGetKernelNDrangeSubGroupCount);
446 SET_OPNAME(OpEnqueueKernel);
447 SET_OPNAME(OpEnqueueMarker);
448
449 InstructionDesc[OpSource].operands.push(OperandSource);
450 InstructionDesc[OpSource].operands.push(OperandLiteralNumber);
451 InstructionDesc[OpSourceExtension].operands.push(OperandLiteralString);
452 InstructionDesc[OpName].operands.push(OperandId);
453 InstructionDesc[OpName].operands.push(OperandLiteralString);
454 InstructionDesc[OpMemberName].operands.push(OperandId);
455 InstructionDesc[OpMemberName].operands.push(OperandLiteralNumber);
456 InstructionDesc[OpMemberName].operands.push(OperandLiteralString);
457 InstructionDesc[OpString].operands.push(OperandLiteralString);
458 InstructionDesc[OpLine].operands.push(OperandId);
459 InstructionDesc[OpLine].operands.push(OperandId);
460 InstructionDesc[OpLine].operands.push(OperandLiteralNumber);
461 InstructionDesc[OpLine].operands.push(OperandLiteralNumber);
462 InstructionDesc[OpExtension].operands.push(OperandLiteralString);
463 InstructionDesc[OpExtInstImport].operands.push(OperandLiteralString);
464 InstructionDesc[OpMemoryModel].operands.push(OperandAddressing);
465 InstructionDesc[OpMemoryModel].operands.push(OperandMemory);
466 InstructionDesc[OpEntryPoint].operands.push(OperandExecutionModel);
467 InstructionDesc[OpEntryPoint].operands.push(OperandId);
468 InstructionDesc[OpExecutionMode].operands.push(OperandId);
469 InstructionDesc[OpExecutionMode].operands.push(OperandExecutionMode);
470 InstructionDesc[OpExecutionMode].operands.push(OperandVariableLiterals);
471 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber);
472 InstructionDesc[OpTypeInt].operands.push(OperandLiteralNumber);
473 InstructionDesc[OpTypeFloat].operands.push(OperandLiteralNumber);
474 InstructionDesc[OpTypeVector].operands.push(OperandId);
475 InstructionDesc[OpTypeVector].operands.push(OperandLiteralNumber);
476 InstructionDesc[OpTypeMatrix].operands.push(OperandId);
477 InstructionDesc[OpTypeMatrix].operands.push(OperandLiteralNumber);
478 InstructionDesc[OpTypeSampler].operands.push(OperandId);
479 InstructionDesc[OpTypeSampler].operands.push(OperandDimensionality);
480 InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber);
481 InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber);
482 InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber);
483 InstructionDesc[OpTypeSampler].operands.push(OperandLiteralNumber);
484 InstructionDesc[OpTypeSampler].operands.push(OperandOptionalId);
485 InstructionDesc[OpTypeArray].operands.push(OperandId);
486 InstructionDesc[OpTypeArray].operands.push(OperandId);
487 InstructionDesc[OpTypeRuntimeArray].operands.push(OperandId);
488 InstructionDesc[OpTypeStruct].operands.push(OperandVariableIds);
489 InstructionDesc[OpTypeOpaque].operands.push(OperandLiteralString);
490 InstructionDesc[OpTypePointer].operands.push(OperandStorage);
491 InstructionDesc[OpTypePointer].operands.push(OperandId);
492 InstructionDesc[OpTypePipe].operands.push(OperandId);
493 InstructionDesc[OpTypePipe].operands.push(OperandAccessQualifier);
494 InstructionDesc[OpTypeFunction].operands.push(OperandId);
495 InstructionDesc[OpTypeFunction].operands.push(OperandVariableIds);
496 InstructionDesc[OpConstant].operands.push(OperandVariableLiterals);
497 InstructionDesc[OpConstantComposite].operands.push(OperandVariableIds);
498 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber);
499 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber);
500 InstructionDesc[OpConstantSampler].operands.push(OperandLiteralNumber);
501 InstructionDesc[OpSpecConstant].operands.push(OperandVariableLiterals);
502 InstructionDesc[OpSpecConstantComposite].operands.push(OperandVariableIds);
503 InstructionDesc[OpVariable].operands.push(OperandStorage);
504 InstructionDesc[OpVariable].operands.push(OperandOptionalId);
505 InstructionDesc[OpVariableArray].operands.push(OperandStorage);
506 InstructionDesc[OpVariableArray].operands.push(OperandId);
507 InstructionDesc[OpFunction].operands.push(OperandFunction);
508 InstructionDesc[OpFunction].operands.push(OperandId);
509 InstructionDesc[OpFunctionCall].operands.push(OperandId);
510 InstructionDesc[OpFunctionCall].operands.push(OperandVariableIds);
511 InstructionDesc[OpExtInst].operands.push(OperandId);
512 InstructionDesc[OpExtInst].operands.push(OperandLiteralNumber);
513 InstructionDesc[OpExtInst].operands.push(OperandVariableIds);
514 InstructionDesc[OpLoad].operands.push(OperandId);
515 InstructionDesc[OpLoad].operands.push(OperandVariableLiterals);
516 InstructionDesc[OpStore].operands.push(OperandId);
517 InstructionDesc[OpStore].operands.push(OperandId);
518 InstructionDesc[OpStore].operands.push(OperandVariableLiterals);
519 InstructionDesc[OpPhi].operands.push(OperandVariableIds);
520 InstructionDesc[OpDecorate].operands.push(OperandId);
521 InstructionDesc[OpDecorate].operands.push(OperandDecoration);
522 InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals);
523 InstructionDesc[OpMemberDecorate].operands.push(OperandId);
524 InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber);
525 InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration);
526 InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals);
527 InstructionDesc[OpGroupDecorate].operands.push(OperandId);
528 InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds);
529 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandId);
530 InstructionDesc[OpGroupMemberDecorate].operands.push(OperandVariableIds);
531 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId);
532 InstructionDesc[OpVectorExtractDynamic].operands.push(OperandId);
533 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId);
534 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId);
535 InstructionDesc[OpVectorInsertDynamic].operands.push(OperandId);
536 InstructionDesc[OpVectorShuffle].operands.push(OperandId);
537 InstructionDesc[OpVectorShuffle].operands.push(OperandId);
538 InstructionDesc[OpVectorShuffle].operands.push(OperandVariableLiterals);
539 InstructionDesc[OpCompositeConstruct].operands.push(OperandVariableIds);
540 InstructionDesc[OpCompositeExtract].operands.push(OperandId);
541 InstructionDesc[OpCompositeExtract].operands.push(OperandVariableLiterals);
542 InstructionDesc[OpCompositeInsert].operands.push(OperandId);
543 InstructionDesc[OpCompositeInsert].operands.push(OperandId);
544 InstructionDesc[OpCompositeInsert].operands.push(OperandVariableLiterals);
545 InstructionDesc[OpCopyObject].operands.push(OperandId);
546 InstructionDesc[OpCopyMemory].operands.push(OperandId);
547 InstructionDesc[OpCopyMemory].operands.push(OperandId);
548 InstructionDesc[OpCopyMemory].operands.push(OperandVariableLiterals);
549 InstructionDesc[OpCopyMemorySized].operands.push(OperandId);
550 InstructionDesc[OpCopyMemorySized].operands.push(OperandId);
551 InstructionDesc[OpCopyMemorySized].operands.push(OperandId);
552 InstructionDesc[OpCopyMemorySized].operands.push(OperandVariableLiterals);
553 InstructionDesc[OpSampler].operands.push(OperandId);
554 InstructionDesc[OpSampler].operands.push(OperandId);
555 InstructionDesc[OpTextureSample].operands.push(OperandId);
556 InstructionDesc[OpTextureSample].operands.push(OperandId);
557 InstructionDesc[OpTextureSample].operands.push(OperandOptionalId);
558 InstructionDesc[OpTextureSampleDref].operands.push(OperandId);
559 InstructionDesc[OpTextureSampleDref].operands.push(OperandId);
560 InstructionDesc[OpTextureSampleDref].operands.push(OperandId);
561 InstructionDesc[OpTextureSampleLod].operands.push(OperandId);
562 InstructionDesc[OpTextureSampleLod].operands.push(OperandId);
563 InstructionDesc[OpTextureSampleLod].operands.push(OperandId);
564 InstructionDesc[OpTextureSampleProj].operands.push(OperandId);
565 InstructionDesc[OpTextureSampleProj].operands.push(OperandId);
566 InstructionDesc[OpTextureSampleProj].operands.push(OperandOptionalId);
567 InstructionDesc[OpTextureSampleGrad].operands.push(OperandId);
568 InstructionDesc[OpTextureSampleGrad].operands.push(OperandId);
569 InstructionDesc[OpTextureSampleGrad].operands.push(OperandId);
570 InstructionDesc[OpTextureSampleGrad].operands.push(OperandId);
571 InstructionDesc[OpTextureSampleOffset].operands.push(OperandId);
572 InstructionDesc[OpTextureSampleOffset].operands.push(OperandId);
573 InstructionDesc[OpTextureSampleOffset].operands.push(OperandId);
574 InstructionDesc[OpTextureSampleOffset].operands.push(OperandOptionalId);
575 InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId);
576 InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId);
577 InstructionDesc[OpTextureSampleProjLod].operands.push(OperandId);
578 InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId);
579 InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId);
580 InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId);
581 InstructionDesc[OpTextureSampleProjGrad].operands.push(OperandId);
582 InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId);
583 InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId);
584 InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId);
585 InstructionDesc[OpTextureSampleLodOffset].operands.push(OperandId);
586 InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId);
587 InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId);
588 InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandId);
589 InstructionDesc[OpTextureSampleProjOffset].operands.push(OperandOptionalId);
590 InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId);
591 InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId);
592 InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId);
593 InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId);
594 InstructionDesc[OpTextureSampleGradOffset].operands.push(OperandId);
595 InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId);
596 InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId);
597 InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId);
598 InstructionDesc[OpTextureSampleProjLodOffset].operands.push(OperandId);
599 InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId);
600 InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId);
601 InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId);
602 InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId);
603 InstructionDesc[OpTextureSampleProjGradOffset].operands.push(OperandId);
604 InstructionDesc[OpTextureFetchTexel].operands.push(OperandId);
605 InstructionDesc[OpTextureFetchTexel].operands.push(OperandId);
606 InstructionDesc[OpTextureFetchTexel].operands.push(OperandId);
607 InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId);
608 InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId);
609 InstructionDesc[OpTextureFetchTexelOffset].operands.push(OperandId);
610 InstructionDesc[OpTextureFetchSample].operands.push(OperandId);
611 InstructionDesc[OpTextureFetchSample].operands.push(OperandId);
612 InstructionDesc[OpTextureFetchSample].operands.push(OperandId);
613 InstructionDesc[OpTextureFetchBuffer].operands.push(OperandId);
614 InstructionDesc[OpTextureFetchBuffer].operands.push(OperandId);
615 InstructionDesc[OpTextureGather].operands.push(OperandId);
616 InstructionDesc[OpTextureGather].operands.push(OperandId);
617 InstructionDesc[OpTextureGather].operands.push(OperandId);
618 InstructionDesc[OpTextureGatherOffset].operands.push(OperandId);
619 InstructionDesc[OpTextureGatherOffset].operands.push(OperandId);
620 InstructionDesc[OpTextureGatherOffset].operands.push(OperandId);
621 InstructionDesc[OpTextureGatherOffset].operands.push(OperandId);
622 InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId);
623 InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId);
624 InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId);
625 InstructionDesc[OpTextureGatherOffsets].operands.push(OperandId);
626 InstructionDesc[OpTextureQuerySizeLod].operands.push(OperandId);
627 InstructionDesc[OpTextureQuerySizeLod].operands.push(OperandId);
628 InstructionDesc[OpTextureQuerySize].operands.push(OperandId);
629 InstructionDesc[OpTextureQueryLod].operands.push(OperandId);
630 InstructionDesc[OpTextureQueryLod].operands.push(OperandId);
631 InstructionDesc[OpTextureQueryLevels].operands.push(OperandId);
632 InstructionDesc[OpTextureQuerySamples].operands.push(OperandId);
633 InstructionDesc[OpAccessChain].operands.push(OperandId);
634 InstructionDesc[OpAccessChain].operands.push(OperandVariableIds);
635 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandId);
636 InstructionDesc[OpInBoundsAccessChain].operands.push(OperandVariableIds);
637 InstructionDesc[OpSNegate].operands.push(OperandId);
638 InstructionDesc[OpFNegate].operands.push(OperandId);
639 InstructionDesc[OpNot].operands.push(OperandId);
640 InstructionDesc[OpAny].operands.push(OperandId);
641 InstructionDesc[OpAll].operands.push(OperandId);
642 InstructionDesc[OpConvertFToU].operands.push(OperandId);
643 InstructionDesc[OpConvertFToS].operands.push(OperandId);
644 InstructionDesc[OpConvertSToF].operands.push(OperandId);
645 InstructionDesc[OpConvertUToF].operands.push(OperandId);
646 InstructionDesc[OpUConvert].operands.push(OperandId);
647 InstructionDesc[OpSConvert].operands.push(OperandId);
648 InstructionDesc[OpFConvert].operands.push(OperandId);
649 InstructionDesc[OpConvertPtrToU].operands.push(OperandId);
650 InstructionDesc[OpConvertUToPtr].operands.push(OperandId);
651 InstructionDesc[OpPtrCastToGeneric].operands.push(OperandId);
652 InstructionDesc[OpGenericCastToPtr].operands.push(OperandId);
653 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandId);
654 InstructionDesc[OpGenericCastToPtrExplicit].operands.push(OperandStorage);
655 InstructionDesc[OpGenericPtrMemSemantics].operands.push(OperandId);
656 InstructionDesc[OpBitcast].operands.push(OperandId);
657 InstructionDesc[OpTranspose].operands.push(OperandId);
658 InstructionDesc[OpIsNan].operands.push(OperandId);
659 InstructionDesc[OpIsInf].operands.push(OperandId);
660 InstructionDesc[OpIsFinite].operands.push(OperandId);
661 InstructionDesc[OpIsNormal].operands.push(OperandId);
662 InstructionDesc[OpSignBitSet].operands.push(OperandId);
663 InstructionDesc[OpLessOrGreater].operands.push(OperandId);
664 InstructionDesc[OpLessOrGreater].operands.push(OperandId);
665 InstructionDesc[OpOrdered].operands.push(OperandId);
666 InstructionDesc[OpOrdered].operands.push(OperandId);
667 InstructionDesc[OpUnordered].operands.push(OperandId);
668 InstructionDesc[OpUnordered].operands.push(OperandId);
669 InstructionDesc[OpArrayLength].operands.push(OperandId);
670 InstructionDesc[OpArrayLength].operands.push(OperandLiteralNumber);
671 InstructionDesc[OpIAdd].operands.push(OperandId);
672 InstructionDesc[OpIAdd].operands.push(OperandId);
673 InstructionDesc[OpFAdd].operands.push(OperandId);
674 InstructionDesc[OpFAdd].operands.push(OperandId);
675 InstructionDesc[OpISub].operands.push(OperandId);
676 InstructionDesc[OpISub].operands.push(OperandId);
677 InstructionDesc[OpFSub].operands.push(OperandId);
678 InstructionDesc[OpFSub].operands.push(OperandId);
679 InstructionDesc[OpIMul].operands.push(OperandId);
680 InstructionDesc[OpIMul].operands.push(OperandId);
681 InstructionDesc[OpFMul].operands.push(OperandId);
682 InstructionDesc[OpFMul].operands.push(OperandId);
683 InstructionDesc[OpUDiv].operands.push(OperandId);
684 InstructionDesc[OpUDiv].operands.push(OperandId);
685 InstructionDesc[OpSDiv].operands.push(OperandId);
686 InstructionDesc[OpSDiv].operands.push(OperandId);
687 InstructionDesc[OpFDiv].operands.push(OperandId);
688 InstructionDesc[OpFDiv].operands.push(OperandId);
689 InstructionDesc[OpUMod].operands.push(OperandId);
690 InstructionDesc[OpUMod].operands.push(OperandId);
691 InstructionDesc[OpSRem].operands.push(OperandId);
692 InstructionDesc[OpSRem].operands.push(OperandId);
693 InstructionDesc[OpSMod].operands.push(OperandId);
694 InstructionDesc[OpSMod].operands.push(OperandId);
695 InstructionDesc[OpFRem].operands.push(OperandId);
696 InstructionDesc[OpFRem].operands.push(OperandId);
697 InstructionDesc[OpFMod].operands.push(OperandId);
698 InstructionDesc[OpFMod].operands.push(OperandId);
699 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId);
700 InstructionDesc[OpVectorTimesScalar].operands.push(OperandId);
701 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId);
702 InstructionDesc[OpMatrixTimesScalar].operands.push(OperandId);
703 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId);
704 InstructionDesc[OpVectorTimesMatrix].operands.push(OperandId);
705 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId);
706 InstructionDesc[OpMatrixTimesVector].operands.push(OperandId);
707 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId);
708 InstructionDesc[OpMatrixTimesMatrix].operands.push(OperandId);
709 InstructionDesc[OpOuterProduct].operands.push(OperandId);
710 InstructionDesc[OpOuterProduct].operands.push(OperandId);
711 InstructionDesc[OpDot].operands.push(OperandId);
712 InstructionDesc[OpDot].operands.push(OperandId);
713 InstructionDesc[OpShiftRightLogical].operands.push(OperandId);
714 InstructionDesc[OpShiftRightLogical].operands.push(OperandId);
715 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId);
716 InstructionDesc[OpShiftRightArithmetic].operands.push(OperandId);
717 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId);
718 InstructionDesc[OpShiftLeftLogical].operands.push(OperandId);
719 InstructionDesc[OpLogicalOr].operands.push(OperandId);
720 InstructionDesc[OpLogicalOr].operands.push(OperandId);
721 InstructionDesc[OpLogicalXor].operands.push(OperandId);
722 InstructionDesc[OpLogicalXor].operands.push(OperandId);
723 InstructionDesc[OpLogicalAnd].operands.push(OperandId);
724 InstructionDesc[OpLogicalAnd].operands.push(OperandId);
725 InstructionDesc[OpBitwiseOr].operands.push(OperandId);
726 InstructionDesc[OpBitwiseOr].operands.push(OperandId);
727 InstructionDesc[OpBitwiseXor].operands.push(OperandId);
728 InstructionDesc[OpBitwiseXor].operands.push(OperandId);
729 InstructionDesc[OpBitwiseAnd].operands.push(OperandId);
730 InstructionDesc[OpBitwiseAnd].operands.push(OperandId);
731 InstructionDesc[OpSelect].operands.push(OperandId);
732 InstructionDesc[OpSelect].operands.push(OperandId);
733 InstructionDesc[OpSelect].operands.push(OperandId);
734 InstructionDesc[OpIEqual].operands.push(OperandId);
735 InstructionDesc[OpIEqual].operands.push(OperandId);
736 InstructionDesc[OpFOrdEqual].operands.push(OperandId);
737 InstructionDesc[OpFOrdEqual].operands.push(OperandId);
738 InstructionDesc[OpFUnordEqual].operands.push(OperandId);
739 InstructionDesc[OpFUnordEqual].operands.push(OperandId);
740 InstructionDesc[OpINotEqual].operands.push(OperandId);
741 InstructionDesc[OpINotEqual].operands.push(OperandId);
742 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId);
743 InstructionDesc[OpFOrdNotEqual].operands.push(OperandId);
744 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId);
745 InstructionDesc[OpFUnordNotEqual].operands.push(OperandId);
746 InstructionDesc[OpULessThan].operands.push(OperandId);
747 InstructionDesc[OpULessThan].operands.push(OperandId);
748 InstructionDesc[OpSLessThan].operands.push(OperandId);
749 InstructionDesc[OpSLessThan].operands.push(OperandId);
750 InstructionDesc[OpFOrdLessThan].operands.push(OperandId);
751 InstructionDesc[OpFOrdLessThan].operands.push(OperandId);
752 InstructionDesc[OpFUnordLessThan].operands.push(OperandId);
753 InstructionDesc[OpFUnordLessThan].operands.push(OperandId);
754 InstructionDesc[OpUGreaterThan].operands.push(OperandId);
755 InstructionDesc[OpUGreaterThan].operands.push(OperandId);
756 InstructionDesc[OpSGreaterThan].operands.push(OperandId);
757 InstructionDesc[OpSGreaterThan].operands.push(OperandId);
758 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId);
759 InstructionDesc[OpFOrdGreaterThan].operands.push(OperandId);
760 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId);
761 InstructionDesc[OpFUnordGreaterThan].operands.push(OperandId);
762 InstructionDesc[OpULessThanEqual].operands.push(OperandId);
763 InstructionDesc[OpULessThanEqual].operands.push(OperandId);
764 InstructionDesc[OpSLessThanEqual].operands.push(OperandId);
765 InstructionDesc[OpSLessThanEqual].operands.push(OperandId);
766 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId);
767 InstructionDesc[OpFOrdLessThanEqual].operands.push(OperandId);
768 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId);
769 InstructionDesc[OpFUnordLessThanEqual].operands.push(OperandId);
770 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId);
771 InstructionDesc[OpUGreaterThanEqual].operands.push(OperandId);
772 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId);
773 InstructionDesc[OpSGreaterThanEqual].operands.push(OperandId);
774 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId);
775 InstructionDesc[OpFOrdGreaterThanEqual].operands.push(OperandId);
776 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId);
777 InstructionDesc[OpFUnordGreaterThanEqual].operands.push(OperandId);
778 InstructionDesc[OpDPdx].operands.push(OperandId);
779 InstructionDesc[OpDPdy].operands.push(OperandId);
780 InstructionDesc[OpFwidth].operands.push(OperandId);
781 InstructionDesc[OpDPdxFine].operands.push(OperandId);
782 InstructionDesc[OpDPdyFine].operands.push(OperandId);
783 InstructionDesc[OpFwidthFine].operands.push(OperandId);
784 InstructionDesc[OpDPdxCoarse].operands.push(OperandId);
785 InstructionDesc[OpDPdyCoarse].operands.push(OperandId);
786 InstructionDesc[OpFwidthCoarse].operands.push(OperandId);
787 InstructionDesc[OpEmitStreamVertex].operands.push(OperandId);
788 InstructionDesc[OpEndStreamPrimitive].operands.push(OperandId);
789 InstructionDesc[OpControlBarrier].operands.push(OperandExecutionScope);
790 InstructionDesc[OpMemoryBarrier].operands.push(OperandExecutionScope);
791 InstructionDesc[OpMemoryBarrier].operands.push(OperandMemorySemantics);
792 InstructionDesc[OpImagePointer].operands.push(OperandId);
793 InstructionDesc[OpImagePointer].operands.push(OperandId);
794 InstructionDesc[OpImagePointer].operands.push(OperandId);
795 InstructionDesc[OpAtomicInit].operands.push(OperandId);
796 InstructionDesc[OpAtomicInit].operands.push(OperandId);
797 InstructionDesc[OpAtomicLoad].operands.push(OperandId);
798 InstructionDesc[OpAtomicLoad].operands.push(OperandExecutionScope);
799 InstructionDesc[OpAtomicLoad].operands.push(OperandMemorySemantics);
800 InstructionDesc[OpAtomicStore].operands.push(OperandId);
801 InstructionDesc[OpAtomicStore].operands.push(OperandExecutionScope);
802 InstructionDesc[OpAtomicStore].operands.push(OperandMemorySemantics);
803 InstructionDesc[OpAtomicStore].operands.push(OperandId);
804 InstructionDesc[OpAtomicExchange].operands.push(OperandId);
805 InstructionDesc[OpAtomicExchange].operands.push(OperandExecutionScope);
806 InstructionDesc[OpAtomicExchange].operands.push(OperandMemorySemantics);
807 InstructionDesc[OpAtomicExchange].operands.push(OperandId);
808 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId);
809 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandExecutionScope);
810 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandMemorySemantics);
811 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId);
812 InstructionDesc[OpAtomicCompareExchange].operands.push(OperandId);
813 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId);
814 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandExecutionScope);
815 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandMemorySemantics);
816 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId);
817 InstructionDesc[OpAtomicCompareExchangeWeak].operands.push(OperandId);
818 InstructionDesc[OpAtomicIIncrement].operands.push(OperandId);
819 InstructionDesc[OpAtomicIIncrement].operands.push(OperandExecutionScope);
820 InstructionDesc[OpAtomicIIncrement].operands.push(OperandMemorySemantics);
821 InstructionDesc[OpAtomicIDecrement].operands.push(OperandId);
822 InstructionDesc[OpAtomicIDecrement].operands.push(OperandExecutionScope);
823 InstructionDesc[OpAtomicIDecrement].operands.push(OperandMemorySemantics);
824 InstructionDesc[OpAtomicIAdd].operands.push(OperandId);
825 InstructionDesc[OpAtomicIAdd].operands.push(OperandExecutionScope);
826 InstructionDesc[OpAtomicIAdd].operands.push(OperandMemorySemantics);
827 InstructionDesc[OpAtomicIAdd].operands.push(OperandId);
828 InstructionDesc[OpAtomicISub].operands.push(OperandId);
829 InstructionDesc[OpAtomicISub].operands.push(OperandExecutionScope);
830 InstructionDesc[OpAtomicISub].operands.push(OperandMemorySemantics);
831 InstructionDesc[OpAtomicISub].operands.push(OperandId);
832 InstructionDesc[OpAtomicUMin].operands.push(OperandId);
833 InstructionDesc[OpAtomicUMin].operands.push(OperandExecutionScope);
834 InstructionDesc[OpAtomicUMin].operands.push(OperandMemorySemantics);
835 InstructionDesc[OpAtomicUMin].operands.push(OperandId);
836 InstructionDesc[OpAtomicUMax].operands.push(OperandId);
837 InstructionDesc[OpAtomicUMax].operands.push(OperandExecutionScope);
838 InstructionDesc[OpAtomicUMax].operands.push(OperandMemorySemantics);
839 InstructionDesc[OpAtomicUMax].operands.push(OperandId);
840 InstructionDesc[OpAtomicAnd].operands.push(OperandId);
841 InstructionDesc[OpAtomicAnd].operands.push(OperandExecutionScope);
842 InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics);
843 InstructionDesc[OpAtomicAnd].operands.push(OperandId);
844 InstructionDesc[OpAtomicOr].operands.push(OperandId);
845 InstructionDesc[OpAtomicOr].operands.push(OperandExecutionScope);
846 InstructionDesc[OpAtomicOr].operands.push(OperandMemorySemantics);
847 InstructionDesc[OpAtomicOr].operands.push(OperandId);
848 InstructionDesc[OpAtomicXor].operands.push(OperandId);
849 InstructionDesc[OpAtomicXor].operands.push(OperandExecutionScope);
850 InstructionDesc[OpAtomicXor].operands.push(OperandMemorySemantics);
851 InstructionDesc[OpAtomicXor].operands.push(OperandId);
852 InstructionDesc[OpLoopMerge].operands.push(OperandId);
853 InstructionDesc[OpLoopMerge].operands.push(OperandLoop);
854 InstructionDesc[OpSelectionMerge].operands.push(OperandId);
855 InstructionDesc[OpSelectionMerge].operands.push(OperandSelect);
856 InstructionDesc[OpBranch].operands.push(OperandId);
857 InstructionDesc[OpBranchConditional].operands.push(OperandId);
858 InstructionDesc[OpBranchConditional].operands.push(OperandId);
859 InstructionDesc[OpBranchConditional].operands.push(OperandId);
860 InstructionDesc[OpBranchConditional].operands.push(OperandVariableLiterals);
861 InstructionDesc[OpSwitch].operands.push(OperandId);
862 InstructionDesc[OpSwitch].operands.push(OperandId);
863 InstructionDesc[OpSwitch].operands.push(OperandVariableLiteralId);
864 InstructionDesc[OpReturnValue].operands.push(OperandId);
865 InstructionDesc[OpLifetimeStart].operands.push(OperandId);
866 InstructionDesc[OpLifetimeStart].operands.push(OperandLiteralNumber);
867 InstructionDesc[OpLifetimeStop].operands.push(OperandId);
868 InstructionDesc[OpLifetimeStop].operands.push(OperandLiteralNumber);
869 InstructionDesc[OpCompileFlag].operands.push(OperandLiteralString);
870 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandExecutionScope);
871 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId);
872 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId);
873 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId);
874 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId);
875 InstructionDesc[OpAsyncGroupCopy].operands.push(OperandId);
876 InstructionDesc[OpWaitGroupEvents].operands.push(OperandExecutionScope);
877 InstructionDesc[OpWaitGroupEvents].operands.push(OperandId);
878 InstructionDesc[OpWaitGroupEvents].operands.push(OperandId);
879 InstructionDesc[OpGroupAll].operands.push(OperandExecutionScope);
880 InstructionDesc[OpGroupAll].operands.push(OperandId);
881 InstructionDesc[OpGroupAny].operands.push(OperandExecutionScope);
882 InstructionDesc[OpGroupAny].operands.push(OperandId);
883 InstructionDesc[OpGroupBroadcast].operands.push(OperandExecutionScope);
884 InstructionDesc[OpGroupBroadcast].operands.push(OperandId);
885 InstructionDesc[OpGroupBroadcast].operands.push(OperandId);
886 InstructionDesc[OpGroupIAdd].operands.push(OperandExecutionScope);
887 InstructionDesc[OpGroupIAdd].operands.push(OperandGroupOperation);
888 InstructionDesc[OpGroupIAdd].operands.push(OperandId);
889 InstructionDesc[OpGroupFAdd].operands.push(OperandExecutionScope);
890 InstructionDesc[OpGroupFAdd].operands.push(OperandGroupOperation);
891 InstructionDesc[OpGroupFAdd].operands.push(OperandId);
892 InstructionDesc[OpGroupUMin].operands.push(OperandExecutionScope);
893 InstructionDesc[OpGroupUMin].operands.push(OperandGroupOperation);
894 InstructionDesc[OpGroupUMin].operands.push(OperandId);
895 InstructionDesc[OpGroupSMin].operands.push(OperandExecutionScope);
896 InstructionDesc[OpGroupSMin].operands.push(OperandGroupOperation);
897 InstructionDesc[OpGroupSMin].operands.push(OperandId);
898 InstructionDesc[OpGroupFMin].operands.push(OperandExecutionScope);
899 InstructionDesc[OpGroupFMin].operands.push(OperandGroupOperation);
900 InstructionDesc[OpGroupFMin].operands.push(OperandId);
901 InstructionDesc[OpGroupUMax].operands.push(OperandExecutionScope);
902 InstructionDesc[OpGroupUMax].operands.push(OperandGroupOperation);
903 InstructionDesc[OpGroupUMax].operands.push(OperandId);
904 InstructionDesc[OpGroupSMax].operands.push(OperandExecutionScope);
905 InstructionDesc[OpGroupSMax].operands.push(OperandGroupOperation);
906 InstructionDesc[OpGroupSMax].operands.push(OperandId);
907 InstructionDesc[OpGroupFMax].operands.push(OperandExecutionScope);
908 InstructionDesc[OpGroupFMax].operands.push(OperandGroupOperation);
909 InstructionDesc[OpGroupFMax].operands.push(OperandId);
910 InstructionDesc[OpReadPipe].operands.push(OperandId);
911 InstructionDesc[OpReadPipe].operands.push(OperandId);
912 InstructionDesc[OpWritePipe].operands.push(OperandId);
913 InstructionDesc[OpWritePipe].operands.push(OperandId);
914 InstructionDesc[OpReservedReadPipe].operands.push(OperandId);
915 InstructionDesc[OpReservedReadPipe].operands.push(OperandId);
916 InstructionDesc[OpReservedReadPipe].operands.push(OperandId);
917 InstructionDesc[OpReservedReadPipe].operands.push(OperandId);
918 InstructionDesc[OpReservedWritePipe].operands.push(OperandId);
919 InstructionDesc[OpReservedWritePipe].operands.push(OperandId);
920 InstructionDesc[OpReservedWritePipe].operands.push(OperandId);
921 InstructionDesc[OpReservedWritePipe].operands.push(OperandId);
922 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId);
923 InstructionDesc[OpReserveReadPipePackets].operands.push(OperandId);
924 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId);
925 InstructionDesc[OpReserveWritePipePackets].operands.push(OperandId);
926 InstructionDesc[OpCommitReadPipe].operands.push(OperandId);
927 InstructionDesc[OpCommitReadPipe].operands.push(OperandId);
928 InstructionDesc[OpCommitWritePipe].operands.push(OperandId);
929 InstructionDesc[OpCommitWritePipe].operands.push(OperandId);
930 InstructionDesc[OpIsValidReserveId].operands.push(OperandId);
931 InstructionDesc[OpGetNumPipePackets].operands.push(OperandId);
932 InstructionDesc[OpGetMaxPipePackets].operands.push(OperandId);
933 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandExecutionScope);
934 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId);
935 InstructionDesc[OpGroupReserveReadPipePackets].operands.push(OperandId);
936 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandExecutionScope);
937 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId);
938 InstructionDesc[OpGroupReserveWritePipePackets].operands.push(OperandId);
939 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandExecutionScope);
940 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId);
941 InstructionDesc[OpGroupCommitReadPipe].operands.push(OperandId);
942 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandExecutionScope);
943 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId);
944 InstructionDesc[OpGroupCommitWritePipe].operands.push(OperandId);
945 InstructionDesc[OpBuildNDRange].operands.push(OperandId);
946 InstructionDesc[OpBuildNDRange].operands.push(OperandId);
947 InstructionDesc[OpBuildNDRange].operands.push(OperandId);
948 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId);
949 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandKernelProfilingInfo);
950 InstructionDesc[OpCaptureEventProfilingInfo].operands.push(OperandId);
951 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId);
952 InstructionDesc[OpSetUserEventStatus].operands.push(OperandId);
953 InstructionDesc[OpIsValidEvent].operands.push(OperandId);
954 InstructionDesc[OpRetainEvent].operands.push(OperandId);
955 InstructionDesc[OpReleaseEvent].operands.push(OperandId);
956 InstructionDesc[OpGetKernelWorkGroupSize].operands.push(OperandId);
957 InstructionDesc[OpGetKernelPreferredWorkGroupSizeMultiple].operands.push(OperandId);
958 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId);
959 InstructionDesc[OpGetKernelNDrangeSubGroupCount].operands.push(OperandId);
960 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId);
961 InstructionDesc[OpGetKernelNDrangeMaxSubGroupSize].operands.push(OperandId);
962 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
963 InstructionDesc[OpEnqueueKernel].operands.push(OperandKernelEnqueueFlags);
964 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
965 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
966 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
967 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
968 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
969 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
970 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
971 InstructionDesc[OpEnqueueKernel].operands.push(OperandId);
972 InstructionDesc[OpEnqueueKernel].operands.push(OperandVariableIds);
973 InstructionDesc[OpEnqueueMarker].operands.push(OperandId);
974 InstructionDesc[OpEnqueueMarker].operands.push(OperandId);
975 InstructionDesc[OpEnqueueMarker].operands.push(OperandId);
976 InstructionDesc[OpEnqueueMarker].operands.push(OperandId);
977}
978
979//
980// A whole set of functions that translate enums to English.
981//
982
983const char* CapabilityString(int cap)
984{
985 switch (cap) {
986 case CapMatrix: return "Matrix";
987 case CapShader: return "Shader";
988 case CapGeom: return "Geom";
989 case CapTess: return "Tess";
990 case CapAddr: return "Addr";
991 case CapLink: return "Link";
992 case CapKernel: return "Kernel";
993
994 default: return "unknown";
995
996 }
997}
998
999const char* SourceString(int source)
1000{
1001 switch (source) {
1002 case LangESSL: return "ESSL";
1003 case LangGLSL: return "GLSL";
1004 case LangOpenCL: return "OpenCL";
1005
1006 default: return "unknown";
1007 }
1008}
1009
1010const char* ExecutionModelString(int model)
1011{
1012 switch (model) {
1013 case ModelVertex: return "Vertex";
1014 case ModelTessellationControl: return "TessellationControl";
1015 case ModelTessellationEvaluation: return "TessellationEvaluation";
1016 case ModelGeometry: return "Geometry";
1017 case ModelFragment: return "Fragment";
1018 case ModelGLCompute: return "GLCompute";
1019 case ModelKernel: return "Kernel";
1020
1021 default: return "BadModel";
1022 }
1023}
1024
1025const char* AddressingString(int addr)
1026{
1027 switch (addr) {
1028 case AddressingLogical: return "Logical";
1029 case AddressingPhysical32: return "Physical32";
1030 case AddressingPhysical64: return "Physical64";
1031
1032 default: return "BadAddressModel";
1033 }
1034}
1035
1036const char* AddressingDesc(int addr)
1037{
1038 switch (addr) {
1039 case AddressingLogical: return "No variables that are pointers or other physical pointers. No arithmetic or casting on pointers.";
1040 case AddressingPhysical32: return "";
1041 case AddressingPhysical64: return "";
1042
1043 default: return "BadAddressModel";
1044 }
1045}
1046
1047const char* MemoryString(int mem)
1048{
1049 switch (mem) {
1050 case MemorySimple: return "Simple";
1051 case MemoryGLSL450: return "GLSL450";
1052 case MemoryOCL12: return "OpenCL1.2";
1053 case MemoryOCL20: return "OpenCL2.0";
1054 case MemoryOCL21: return "OpenCL2.1";
1055 default: return "BadMemoryModel";
1056 }
1057}
1058
1059const char* ExecutionModeString(int mode)
1060{
1061 switch (mode) {
1062 case ExecutionInvocations: return "Invocations";
1063 case ExecutionSpacingEqual: return "SpacingEqual";
1064 case ExecutionSpacingFractionalEven: return "SpacingFractionalEven";
1065 case ExecutionSpacingFractionalOdd: return "SpacingFractionalOdd";
1066 case ExecutionVertexOrderCw: return "VertexOrderCw";
1067 case ExecutionVertexOrderCcw: return "VertexOrderCcw";
1068 case ExecutionPixelCenterInteger: return "PixelCenterInteger";
1069 case ExecutionOriginUpperLeft: return "OriginUpperLeft";
1070 case ExecutionEarlyFragmentTests: return "EarlyFragmentTests";
1071 case ExecutionPointMode: return "PointMode";
1072 case ExecutionLocalSize: return "LocalSize";
1073 case ExecutionLocalSizeHint: return "LocalSizeHint";
1074 case ExecutionVecTypeHint: return "VecTypeHint";
1075 case ExecutionContractionOff: return "ContractionOff";
1076 case ExecutionXfb: return "Xfb";
1077 case ExecutionDepthReplacing: return "DepthReplacing";
1078 case ExecutionDepthAny: return "DepthAny";
1079 case ExecutionDepthGreater: return "DepthGreater";
1080 case ExecutionDepthLess: return "DepthLess";
1081 case ExecutionDepthUnchanged: return "DepthUnchanged";
1082
1083 case ExecutionInputPoints: return "InputPoints";
1084 case ExecutionInputLines: return "InputLines";
1085 case ExecutionInputLinesAdjacency: return "InputLinesAdjacency";
1086 case ExecutionInputTriangles: return "InputTriangles";
1087 case ExecutionInputTrianglesAdjacency: return "InputTrianglesAdjacency";
1088 case ExecutionInputQuads: return "InputQuads";
1089 case ExecutionInputIsolines: return "InputIsolines";
1090
1091 case ExecutionOutputVertices: return "OutputVertices";
1092 case ExecutionOutputPoints: return "OutputPoints";
1093 case ExecutionOutputLineStrip: return "OutputLineStrip";
1094 case ExecutionOutputTriangleStrip: return "OutputTriangleStrip";
1095
1096 default: return "BadMode";
1097 }
1098}
1099
1100const char* StorageClassString(int StorageClass)
1101{
1102 switch (StorageClass) {
1103 //case StorageLowertime: return "Lowertime"; // TODO: finish removing when sure they are gone.
1104 case StorageConstantUniform: return "UniformConstant";
1105 case StorageUniform: return "Uniform";
1106 case StorageInput: return "Input";
1107 case StorageOutput: return "Output";
1108 case StorageWorkgroupLocal: return "WorkgroupLocal";
1109 case StoragePrivateGlobal: return "PrivateGlobal";
1110 case StorageWorkgroupGlobal: return "WorkgroupGlobal";
1111 case StorageFunction: return "Function";
1112 case StoragePrivate: return "Private";
1113 case StorageAtomicCounter: return "AtomicCounter";
1114 case StorageGeneric: return "Generic";
1115
1116 default: return 0;
1117 }
1118}
1119
1120const char* DecorationString(int decoration)
1121{
1122 switch (decoration) {
1123 case DecPrecisionLow: return "PrecisionLow";
1124 case DecPrecisionMedium: return "PrecisionMedium";
1125 case DecPrecisionHigh: return "PrecisionHigh";
1126 case DecBlock: return "Block";
1127 case DecBufferBlock: return "BufferBlock";
1128 case DecRowMajor: return "RowMajor";
1129 case DecColMajor: return "ColMajor";
1130 case DecGLSLShared: return "GLSLShared";
1131 case DecGLSLStd140: return "GLSLStd140";
1132 case DecGLSLStd430: return "GLSLStd430";
1133 case DecGLSLPacked: return "GLSLPacked";
1134 case DecSmooth: return "Smooth";
1135 case DecNoperspective: return "Noperspective";
1136 case DecFlat: return "Flat";
1137 case DecPatch: return "Patch";
1138 case DecCentroid: return "Centroid";
1139 case DecSample: return "Sample";
1140 case DecInvariant: return "Invariant";
1141 case DecRestrict: return "Restrict";
1142 case DecAliased: return "Aliased";
1143 case DecVolatile: return "Volatile";
1144 case DecConstant: return "Constant";
1145 case DecCoherent: return "Coherent";
1146 case DecNonwritable: return "Nonwritable";
1147 case DecNonreadable: return "Nonreadable";
1148 case DecUniform: return "Uniform";
1149 case DecNoStaticUse: return "NoStaticUse";
1150 case DecCPacked: return "CPacked";
1151 case DecFuncParamAttr: return "FuncParamAttr";
1152 case DecFPSaturatedConv: return "FPSaturatedConversion";
1153 case DecFPRoundingMode: return "FP Rounding Mode";
1154 case DecFPFastMathMode: return "FP Fast Math Mode";
1155 case DecLinkageType: return "Linkage Type";
1156 case DecStream: return "Stream";
1157 case DecLocation: return "Location";
1158 case DecComponent: return "Component";
1159 case DecIndex: return "Index";
1160 case DecBinding: return "Binding";
1161 case DecDescriptorSet: return "DescriptorSet";
1162 case DecOffset: return "Offset";
1163 case DecAlignment: return "Alignment";
1164 case DecXfbBuffer: return "XfbBuffer";
1165 case DecStride: return "Stride";
1166 case DecBuiltIn: return "Built-In";
1167 case DecSpecId: return "SpecId";
1168
1169 default: return "BadDecoration";
1170 }
1171}
1172
1173const char* BuiltInString(int builtIn)
1174{
1175 switch (builtIn) {
1176 case BuiltInPosition: return "Position";
1177 case BuiltInPointSize: return "PointSize";
1178 case BuiltInClipVertex: return "ClipVertex";
1179 case BuiltInClipDistance: return "ClipDistance";
1180 case BuiltInCullDistance: return "CullDistance";
1181 case BuiltInVertexId: return "VertexId";
1182 case BuiltInInstanceId: return "InstanceId";
1183 case BuiltInPrimitiveId: return "PrimitiveId";
1184 case BuiltInInvocationId: return "InvocationId";
1185 case BuiltInLayer: return "Layer";
1186 case BuiltInViewportIndex: return "ViewportIndex";
1187 case BuiltInTessLevelOuter: return "TessLevelOuter";
1188 case BuiltInTessLevelInner: return "TessLevelInner";
1189 case BuiltInTessCoord: return "TessCoord";
1190 case BuiltInPatchVertices: return "PatchVertices";
1191 case BuiltInFragCoord: return "FragCoord";
1192 case BuiltInPointCoord: return "PointCoord";
1193 case BuiltInFrontFacing: return "FrontFacing";
1194 case BuiltInSampleId: return "SampleId";
1195 case BuiltInSamplePosition: return "SamplePosition";
1196 case BuiltInSampleMask: return "SampleMask";
1197 case BuiltInFragColor: return "FragColor";
1198 case BuiltInFragDepth: return "FragDepth";
1199 case BuiltInHelperInvocation: return "HelperInvocation";
1200 case BuiltInNumWorkgroups: return "NumWorkgroups";
1201 case BuiltInWorkgroupSize: return "WorkgroupSize";
1202 case BuiltInWorkgroupId: return "WorkgroupId";
1203 case BuiltInLocalInvocationId: return "LocalInvocationId";
1204 case BuiltInGlobalInvocationId: return "GlobalInvocationId";
1205 case BuiltInLocalInvocationIndex: return "LocalInvocationIndex";
1206 case BuiltInWorkDim: return "WorkDim";
1207 case BuiltInGlobalSize: return "GlobalSize";
1208 case BuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize";
1209 case BuiltInGlobalOffset: return "GlobalOffset";
1210 case BuiltInGlobalLinearId: return "GlobalLinearId";
1211 case BuiltInWorkgroupLinearId: return "WorkgroupLinearId";
1212 case BuiltInSubgroupSize: return "SubgroupSize";
1213 case BuiltInSubgroupMaxSize: return "SubgroupMaxSize";
1214 case BuiltInNumSubgroups: return "NumSubgroups";
1215 case BuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups";
1216 case BuiltInSubgroupId: return "SubgroupId";
1217 case BuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
1218 default: return "BadBuiltIn";
1219 }
1220}
1221
1222const char* DimensionString(int dim)
1223{
1224 switch (dim) {
1225 case Dim1D: return "1D";
1226 case Dim2D: return "2D";
1227 case Dim3D: return "3D";
1228 case DimCube: return "Cube";
1229 case DimRect: return "Rect";
1230 case DimBuffer: return "Buffer";
1231
1232 default: return "BadDimensionality";
1233 }
1234}
1235
1236const char* SamplerAddressingModeString(int mode)
1237{
1238 switch (mode) {
1239 case SamplerAddressingNone: return "None";
1240 case SamplerAddressingClampToEdge: return "ClampEdge";
1241 case SamplerAddressingClamp: return "Clamp";
1242 case SamplerAddressingRepeat: return "Repeat";
1243 case SamplerAddressingRepeatMirrored: return "RepeatMirrored";
1244
1245 default: return "BadSamplerAddrMode";
1246 }
1247}
1248
1249const char* SamplerFilterModeString(int mode)
1250{
1251 switch (mode) {
1252 case SamplerFilterNearest: return "Nearest";
1253 case SamplerFilterLinear: return "Linear";
1254
1255 default: return "BadSamplerFilterMode";
1256 }
1257}
1258
1259const char* FPFastMathString(int mode)
1260{
1261 switch (mode) {
1262 case FPFastMathNNan: return "NotNaN";
1263 case FPFastMathNInf: return "NotInf";
1264 case FPFastMathNSZ: return "NSZ";
1265 case FPFastMathARcp: return "AllowRecip";
1266 case FPFastMathFast: return "Fast";
1267
1268 default: return "BadFastMathMode";
1269 }
1270}
1271
1272const char* FPRoundingModeString(int mode)
1273{
1274 switch (mode) {
1275 case FPRoundRTE: return "RTE";
1276 case FPRoundRTZ: return "RTZ";
1277 case FPRoundRTP: return "RTP";
1278 case FPRoundRTN: return "RTN";
1279
1280 default: return "BadFPRoundingMode";
1281 }
1282}
1283
1284
1285const char* LinkageTypeString(int type)
1286{
1287 switch (type) {
1288 case LinkageExport: return "Export";
1289 case LinkageImport: return "Import";
1290
1291 default: return "BadLinkageType";
1292 }
1293}
1294
1295const char* FuncParamAttrString(int attr)
1296{
1297 switch (attr) {
1298 case FuncParamAttrZext: return "Zext";
1299 case FuncParamAttrSext: return "Sext";
1300 case FuncParamAttrByval: return "ByVal";
1301 case FuncParamAttrSret: return "Sret";
1302 case FuncParamAttrNoAlias: return "NoAlias";
1303 case FuncParamAttrNoCapture: return "NoCapture";
1304 case FuncParamAttrSVM: return "SVM";
1305 case FuncParamAttrNoWrite: return "NoWrite";
1306 case FuncParamAttrNoReadWrite: return "NoReadWrite";
1307
1308 default: return "BadFunctionParameterAttribute";
1309 }
1310}
1311
1312const char* AccessQualifierString(int attr)
1313{
1314 switch (attr) {
1315 case AccessQualReadOnly: return "ReadOnly";
1316 case AccessQualWriteOnly: return "WriteOnly";
1317 case AccessQualReadWrite: return "ReadWrite";
1318
1319 default: return "BadAccessQualifier";
1320 }
1321}
1322
1323const char* SelectControlString(int cont)
1324{
1325 switch (cont) {
1326 case SelectControlNone: return "NoControl";
1327 case SelectControlFlatten: return "Flatten";
1328 case SelectControlDontFlatten: return "DontFlatten";
1329
1330 default: return "BadSelectControl";
1331 }
1332}
1333
1334const char* FunctionControlString(int cont)
1335{
1336 switch (cont) {
1337 case FunctionControlNone: return "NoControl";
1338 case FunctionControlInline: return "InLine";
1339 case FunctionControlDontInline: return "DontInline";
1340 case FunctionControlPure: return "Pure";
1341 case FunctionControlConst: return "Const";
1342
1343 default: return "Bad-select-control";
1344 }
1345}
1346
1347const char* LoopControlString(int cont)
1348{
1349 switch (cont) {
1350 case LoopControlNone: return "NoControl";
1351 case LoopControlUnroll: return "Unroll";
1352 case LoopControlDontUnroll: return "DontUnroll";
1353
1354 default: return "Bad-loop-control";
1355 }
1356}
1357
1358const char* MemorySemanticsString(int mem)
1359{
1360 switch (mem) {
1361 case MemorySemanticsRelaxed: return "Relaxed";
1362 case MemorySemanticsSequentiallyConsistent: return "Sequentially-Consistent";
1363 case MemorySemanticsAcquire: return "Acquire";
1364 case MemorySemanticsRelease: return "Release";
1365
1366 case MemorySemanticsUniform: return "Uniform-memory";
1367 case MemorySemanticsSubgroup: return "Subgroup-memory";
1368 case MemorySemanticsWorkgroupLocal: return "Workgroup-local-memory";
1369 case MemorySemanticsWorkgroupGlobal: return "Workgroup-global-memory";
1370 case MemorySemanticsAtomicCounter: return "Atomic-counter-memory";
1371 case MemorySemanticsImage: return "Image-memory";
1372
1373 default: return "Bad-memory-semantic";
1374 }
1375}
1376
1377const char* MemoryAccessString(int mem)
1378{
1379 switch (mem) {
1380 case MemoryAccessVolatile: return "Volatile";
1381 case MemoryAccessAligned: return "Aligned";
1382
1383 default: return "Bad-memory-access";
1384 }
1385}
1386
1387const char* ExecutionScopeString(int mem)
1388{
1389 switch (mem) {
1390 case ExecutionScopeCrossDevice: return "CrossDevice";
1391 case ExecutionScopeDevice: return "Device";
1392 case ExecutionScopeWorkgroup: return "Workgroup";
1393 case ExecutionScopeSubgroup: return "Subgroup";
1394
1395 default: return "Bad-execution-scope";
1396 }
1397}
1398
1399const char* GroupOperationString(int gop) {
1400
1401 switch (gop)
1402 {
1403 case GroupOpReduce: return "Reduce";
1404 case GroupOpInclusiveScan: return "InclusiveScan";
1405 case GroupOpExclusiveScan: return "ExclusiveScan";
1406
1407 default: return "Bad-execution-scope";
1408 }
1409}
1410
1411const char* KernelEnqueueFlagsString(int flag) {
1412 switch (flag)
1413 {
1414 case spv::EnqFlagNoWait: return "NoWait";
1415 case spv::EnqFlagWaitKernel: return "WaitKernel";
1416 case spv::EnqFlagWaitWaitWorgGroup: return "WaitWorkGroup";
1417
1418 default: return "Bad-enqueue-flag";
1419 }
1420}
1421
1422const char* KernelProfilingInfoString(int info) {
1423 switch (info)
1424 {
1425 case spv::ProfInfoCmdExecTime: return "CmdExecTime";
1426 default: return "Bad-profiling-info";
1427 }
1428}
1429
1430const char* GetOperandDesc(OperandClass operand)
1431{
1432 switch (operand) {
1433 case OperandId: return "<id>";
1434 case OperandOptionalId: return "Optional <id>";
1435 case OperandVariableIds: return "<id>, <id>, ...";
1436 case OperandVariableLiterals: return "literal, literal, ...";
1437 case OperandVariableLiteralId: return "literal, label <id>, +\nliteral, label <id>, +\n...";
1438 case OperandLiteralNumber: return "Literal Number";
1439 case OperandLiteralString: return "Literal String";
1440 case OperandSource: return "Source Language";
1441 case OperandExecutionModel: return "Execution Model";
1442 case OperandAddressing: return "Addressing Model";
1443 case OperandMemory: return "Memory Model";
1444 case OperandExecutionMode: return "Execution Mode";
1445 case OperandStorage: return "Storage Class";
1446 case OperandDimensionality: return "Dim";
1447 case OperandDecoration: return "Decoration";
1448 case OperandBuiltIn: return "Built-In";
1449 case OperandSelect: return "Selection Control";
1450 case OperandLoop: return "Loop Control";
1451 case OperandFunction: return "Function Control Mask";
1452 case OperandSamplerAddressingMode: return "Sampler Addressing Mode";
1453 case OperandSamplerFilterMode: return "Sampler Filter Mode";
1454 case OperandFPFastMath: return "FP Fast Math Mode";
1455 case OperandFPRoundingMode: return "FP Rounding Mode";
1456 case OperandLinkageType: return "Linkage Type";
1457 case OperandFuncParamAttr: return "Function Parameter Attribute";
1458 case OperandAccessQualifier: return "Access Qualifier";
1459 case OperandMemorySemantics: return "Memory Semantics";
1460 case OperandMemoryAccess: return "Memory Access";
1461 case OperandExecutionScope: return "Execution Scope";
1462 case OperandGroupOperation: return "Group Operation";
1463 case OperandKernelEnqueueFlags: return "Kernel Enqueue Flags";
1464 case OperandKernelProfilingInfo: return "Kernel Profiling Info";
1465 default: return "Unknown";
1466 }
1467}
1468
1469}; // end spv namespace