Coverage Report

Created: 2026-06-10 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/glslang/glslang/MachineIndependent/intermOut.cpp
Line
Count
Source
1
//
2
// Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
3
// Copyright (C) 2012-2016 LunarG, Inc.
4
// Copyright (C) 2017, 2022-2024 Arm Limited.
5
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
6
//
7
// All rights reserved.
8
//
9
// Redistribution and use in source and binary forms, with or without
10
// modification, are permitted provided that the following conditions
11
// are met:
12
//
13
//    Redistributions of source code must retain the above copyright
14
//    notice, this list of conditions and the following disclaimer.
15
//
16
//    Redistributions in binary form must reproduce the above
17
//    copyright notice, this list of conditions and the following
18
//    disclaimer in the documentation and/or other materials provided
19
//    with the distribution.
20
//
21
//    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
22
//    contributors may be used to endorse or promote products derived
23
//    from this software without specific prior written permission.
24
//
25
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
// POSSIBILITY OF SUCH DAMAGE.
37
//
38
39
#include "localintermediate.h"
40
#include "../Include/InfoSink.h"
41
42
#ifdef _MSC_VER
43
#include <cfloat>
44
#else
45
#include <cmath>
46
#endif
47
#include <cstdint>
48
49
50
namespace glslang {
51
52
//
53
// Two purposes:
54
// 1.  Show an example of how to iterate tree.  Functions can
55
//     also directly call Traverse() on children themselves to
56
//     have finer grained control over the process than shown here.
57
//     See the last function for how to get started.
58
// 2.  Print out a text based description of the tree.
59
//
60
61
//
62
// Use this class to carry along data from node to node in
63
// the traversal
64
//
65
class TOutputTraverser : public TIntermTraverser {
66
public:
67
0
    TOutputTraverser(TInfoSink& i) : infoSink(i), extraOutput(NoExtraOutput) { }
68
69
    enum EExtraOutput {
70
        NoExtraOutput,
71
        BinaryDoubleOutput
72
    };
73
0
    void setDoubleOutput(EExtraOutput extra) { extraOutput = extra; }
74
75
    virtual bool visitBinary(TVisit, TIntermBinary* node);
76
    virtual bool visitUnary(TVisit, TIntermUnary* node);
77
    virtual bool visitAggregate(TVisit, TIntermAggregate* node);
78
    virtual bool visitSelection(TVisit, TIntermSelection* node);
79
    virtual void visitConstantUnion(TIntermConstantUnion* node);
80
    virtual void visitSymbol(TIntermSymbol* node);
81
    virtual bool visitLoop(TVisit, TIntermLoop* node);
82
    virtual bool visitBranch(TVisit, TIntermBranch* node);
83
    virtual bool visitSwitch(TVisit, TIntermSwitch* node);
84
    virtual bool visitVariableDecl(TVisit, TIntermVariableDecl* node);
85
86
    TInfoSink& infoSink;
87
protected:
88
    TOutputTraverser(TOutputTraverser&);
89
    TOutputTraverser& operator=(TOutputTraverser&);
90
91
    EExtraOutput extraOutput;
92
};
93
94
//
95
// Helper functions for printing, not part of traversing.
96
//
97
98
static void OutputTreeText(TInfoSink& infoSink, const TIntermNode* node, const int depth)
99
0
{
100
0
    int i;
101
102
0
    infoSink.debug << node->getLoc().string << ":";
103
0
    if (node->getLoc().line)
104
0
        infoSink.debug << node->getLoc().line;
105
0
    else
106
0
        infoSink.debug << "? ";
107
108
0
    for (i = 0; i < depth; ++i)
109
0
        infoSink.debug << "  ";
110
0
}
111
112
//
113
// The rest of the file are the traversal functions.  The last one
114
// is the one that starts the traversal.
115
//
116
// Return true from interior nodes to have the external traversal
117
// continue on to children.  If you process children yourself,
118
// return false.
119
//
120
121
bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
122
0
{
123
0
    TInfoSink& out = infoSink;
124
125
0
    OutputTreeText(out, node, depth);
126
127
0
    switch (node->getOp()) {
128
0
    case EOpAssign:                   out.debug << "move second child to first child";           break;
129
0
    case EOpAddAssign:                out.debug << "add second child into first child";          break;
130
0
    case EOpSubAssign:                out.debug << "subtract second child into first child";     break;
131
0
    case EOpMulAssign:                out.debug << "multiply second child into first child";     break;
132
0
    case EOpVectorTimesMatrixAssign:  out.debug << "matrix mult second child into first child";  break;
133
0
    case EOpVectorTimesScalarAssign:  out.debug << "vector scale second child into first child"; break;
134
0
    case EOpMatrixTimesScalarAssign:  out.debug << "matrix scale second child into first child"; break;
135
0
    case EOpMatrixTimesMatrixAssign:  out.debug << "matrix mult second child into first child";  break;
136
0
    case EOpDivAssign:                out.debug << "divide second child into first child";       break;
137
0
    case EOpModAssign:                out.debug << "mod second child into first child";          break;
138
0
    case EOpAndAssign:                out.debug << "and second child into first child";          break;
139
0
    case EOpInclusiveOrAssign:        out.debug << "or second child into first child";           break;
140
0
    case EOpExclusiveOrAssign:        out.debug << "exclusive or second child into first child"; break;
141
0
    case EOpLeftShiftAssign:          out.debug << "left shift second child into first child";   break;
142
0
    case EOpRightShiftAssign:         out.debug << "right shift second child into first child";  break;
143
144
0
    case EOpIndexDirect:   out.debug << "direct index";   break;
145
0
    case EOpIndexIndirect: out.debug << "indirect index"; break;
146
0
    case EOpIndexDirectStruct:
147
0
        {
148
0
            bool reference = node->getLeft()->getType().isReference();
149
0
            const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct();
150
0
            out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName();
151
0
            out.debug << ": direct index for structure";      break;
152
0
        }
153
0
    case EOpVectorSwizzle: out.debug << "vector swizzle"; break;
154
0
    case EOpMatrixSwizzle: out.debug << "matrix swizzle"; break;
155
156
0
    case EOpAdd:    out.debug << "add";                     break;
157
0
    case EOpSub:    out.debug << "subtract";                break;
158
0
    case EOpMul:    out.debug << "component-wise multiply"; break;
159
0
    case EOpDiv:    out.debug << "divide";                  break;
160
0
    case EOpMod:    out.debug << "mod";                     break;
161
0
    case EOpRightShift:  out.debug << "right-shift";  break;
162
0
    case EOpLeftShift:   out.debug << "left-shift";   break;
163
0
    case EOpAnd:         out.debug << "bitwise and";  break;
164
0
    case EOpInclusiveOr: out.debug << "inclusive-or"; break;
165
0
    case EOpExclusiveOr: out.debug << "exclusive-or"; break;
166
0
    case EOpEqual:            out.debug << "Compare Equal";                 break;
167
0
    case EOpNotEqual:         out.debug << "Compare Not Equal";             break;
168
0
    case EOpLessThan:         out.debug << "Compare Less Than";             break;
169
0
    case EOpGreaterThan:      out.debug << "Compare Greater Than";          break;
170
0
    case EOpLessThanEqual:    out.debug << "Compare Less Than or Equal";    break;
171
0
    case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break;
172
0
    case EOpVectorEqual:      out.debug << "Equal";                         break;
173
0
    case EOpVectorNotEqual:   out.debug << "NotEqual";                      break;
174
175
0
    case EOpVectorTimesScalar: out.debug << "vector-scale";          break;
176
0
    case EOpVectorTimesMatrix: out.debug << "vector-times-matrix";   break;
177
0
    case EOpMatrixTimesVector: out.debug << "matrix-times-vector";   break;
178
0
    case EOpMatrixTimesScalar: out.debug << "matrix-scale";          break;
179
0
    case EOpMatrixTimesMatrix: out.debug << "matrix-multiply";       break;
180
181
0
    case EOpLogicalOr:  out.debug << "logical-or";   break;
182
0
    case EOpLogicalXor: out.debug << "logical-xor"; break;
183
0
    case EOpLogicalAnd: out.debug << "logical-and"; break;
184
185
0
    case EOpAbsDifference:          out.debug << "absoluteDifference";    break;
186
0
    case EOpAddSaturate:            out.debug << "addSaturate";           break;
187
0
    case EOpSubSaturate:            out.debug << "subtractSaturate";      break;
188
0
    case EOpAverage:                out.debug << "average";               break;
189
0
    case EOpAverageRounded:         out.debug << "averageRounded";        break;
190
0
    case EOpMul32x16:               out.debug << "multiply32x16";         break;
191
192
0
    default: out.debug << "<unknown op>";
193
0
    }
194
195
0
    out.debug << " (" << node->getCompleteString() << ")";
196
197
0
    out.debug << "\n";
198
199
0
    return true;
200
0
}
201
202
bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
203
0
{
204
0
    TInfoSink& out = infoSink;
205
206
0
    OutputTreeText(out, node, depth);
207
208
0
    if (IsOpNumericConv(node->getAsOperator()->getOp())) {
209
0
        out.debug << "Convert " << TType::getBasicString(node->getOperand()->getType().getBasicType()) << " to " << TType::getBasicString(node->getType().getBasicType());
210
0
        out.debug << " (" << node->getCompleteString() << ")";
211
0
        out.debug << "\n";
212
0
        return true;
213
0
    }
214
215
0
    switch (node->getOp()) {
216
0
    case EOpNegative:       out.debug << "Negate value";         break;
217
0
    case EOpVectorLogicalNot:
218
0
    case EOpLogicalNot:     out.debug << "Negate conditional";   break;
219
0
    case EOpBitwiseNot:     out.debug << "Bitwise not";          break;
220
221
0
    case EOpPostIncrement:  out.debug << "Post-Increment";       break;
222
0
    case EOpPostDecrement:  out.debug << "Post-Decrement";       break;
223
0
    case EOpPreIncrement:   out.debug << "Pre-Increment";        break;
224
0
    case EOpPreDecrement:   out.debug << "Pre-Decrement";        break;
225
0
    case EOpCopyObject:     out.debug << "copy object";          break;
226
227
0
    case EOpConvUint64ToPtr:  out.debug << "Convert uint64_t to pointer";   break;
228
0
    case EOpConvPtrToUint64:  out.debug << "Convert pointer to uint64_t";   break;
229
230
0
    case EOpConvUint64ToAccStruct: out.debug << "Convert uint64_t to acceleration structure"; break;
231
0
    case EOpConvUvec2ToAccStruct:  out.debug << "Convert uvec2 to acceleration strucuture "; break;
232
233
0
    case EOpRadians:        out.debug << "radians";              break;
234
0
    case EOpDegrees:        out.debug << "degrees";              break;
235
0
    case EOpSin:            out.debug << "sine";                 break;
236
0
    case EOpCos:            out.debug << "cosine";               break;
237
0
    case EOpTan:            out.debug << "tangent";              break;
238
0
    case EOpAsin:           out.debug << "arc sine";             break;
239
0
    case EOpAcos:           out.debug << "arc cosine";           break;
240
0
    case EOpAtan:           out.debug << "arc tangent";          break;
241
0
    case EOpSinh:           out.debug << "hyp. sine";            break;
242
0
    case EOpCosh:           out.debug << "hyp. cosine";          break;
243
0
    case EOpTanh:           out.debug << "hyp. tangent";         break;
244
0
    case EOpAsinh:          out.debug << "arc hyp. sine";        break;
245
0
    case EOpAcosh:          out.debug << "arc hyp. cosine";      break;
246
0
    case EOpAtanh:          out.debug << "arc hyp. tangent";     break;
247
248
0
    case EOpExp:            out.debug << "exp";                  break;
249
0
    case EOpLog:            out.debug << "log";                  break;
250
0
    case EOpExp2:           out.debug << "exp2";                 break;
251
0
    case EOpLog2:           out.debug << "log2";                 break;
252
0
    case EOpSqrt:           out.debug << "sqrt";                 break;
253
0
    case EOpInverseSqrt:    out.debug << "inverse sqrt";         break;
254
255
0
    case EOpAbs:            out.debug << "Absolute value";       break;
256
0
    case EOpSign:           out.debug << "Sign";                 break;
257
0
    case EOpFloor:          out.debug << "Floor";                break;
258
0
    case EOpTrunc:          out.debug << "trunc";                break;
259
0
    case EOpRound:          out.debug << "round";                break;
260
0
    case EOpRoundEven:      out.debug << "roundEven";            break;
261
0
    case EOpCeil:           out.debug << "Ceiling";              break;
262
0
    case EOpFract:          out.debug << "Fraction";             break;
263
264
0
    case EOpIsNan:          out.debug << "isnan";                break;
265
0
    case EOpIsInf:          out.debug << "isinf";                break;
266
267
0
    case EOpFloatBitsToInt: out.debug << "floatBitsToInt";       break;
268
0
    case EOpFloatBitsToUint:out.debug << "floatBitsToUint";      break;
269
0
    case EOpIntBitsToFloat: out.debug << "intBitsToFloat";       break;
270
0
    case EOpUintBitsToFloat:out.debug << "uintBitsToFloat";      break;
271
0
    case EOpDoubleBitsToInt64:  out.debug << "doubleBitsToInt64";  break;
272
0
    case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break;
273
0
    case EOpInt64BitsToDouble:  out.debug << "int64BitsToDouble";  break;
274
0
    case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break;
275
0
    case EOpFloat16BitsToInt16:  out.debug << "float16BitsToInt16";  break;
276
0
    case EOpFloat16BitsToUint16: out.debug << "float16BitsToUint16"; break;
277
0
    case EOpInt16BitsToFloat16:  out.debug << "int16BitsToFloat16";  break;
278
0
    case EOpUint16BitsToFloat16: out.debug << "uint16BitsToFloat16"; break;
279
280
0
    case EOpPackSnorm2x16:  out.debug << "packSnorm2x16";        break;
281
0
    case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16";      break;
282
0
    case EOpPackUnorm2x16:  out.debug << "packUnorm2x16";        break;
283
0
    case EOpUnpackUnorm2x16:out.debug << "unpackUnorm2x16";      break;
284
0
    case EOpPackHalf2x16:   out.debug << "packHalf2x16";         break;
285
0
    case EOpUnpackHalf2x16: out.debug << "unpackHalf2x16";       break;
286
0
    case EOpPack16:           out.debug << "pack16";                 break;
287
0
    case EOpPack32:           out.debug << "pack32";                 break;
288
0
    case EOpPack64:           out.debug << "pack64";                 break;
289
0
    case EOpUnpack32:         out.debug << "unpack32";               break;
290
0
    case EOpUnpack16:         out.debug << "unpack16";               break;
291
0
    case EOpUnpack8:          out.debug << "unpack8";               break;
292
293
0
    case EOpPackSnorm4x8:     out.debug << "PackSnorm4x8";       break;
294
0
    case EOpUnpackSnorm4x8:   out.debug << "UnpackSnorm4x8";     break;
295
0
    case EOpPackUnorm4x8:     out.debug << "PackUnorm4x8";       break;
296
0
    case EOpUnpackUnorm4x8:   out.debug << "UnpackUnorm4x8";     break;
297
0
    case EOpPackDouble2x32:   out.debug << "PackDouble2x32";     break;
298
0
    case EOpUnpackDouble2x32: out.debug << "UnpackDouble2x32";   break;
299
300
0
    case EOpPackInt2x32:      out.debug << "packInt2x32";        break;
301
0
    case EOpUnpackInt2x32:    out.debug << "unpackInt2x32";      break;
302
0
    case EOpPackUint2x32:     out.debug << "packUint2x32";       break;
303
0
    case EOpUnpackUint2x32:   out.debug << "unpackUint2x32";     break;
304
305
0
    case EOpPackInt2x16:      out.debug << "packInt2x16";        break;
306
0
    case EOpUnpackInt2x16:    out.debug << "unpackInt2x16";      break;
307
0
    case EOpPackUint2x16:     out.debug << "packUint2x16";       break;
308
0
    case EOpUnpackUint2x16:   out.debug << "unpackUint2x16";     break;
309
310
0
    case EOpPackInt4x16:      out.debug << "packInt4x16";        break;
311
0
    case EOpUnpackInt4x16:    out.debug << "unpackInt4x16";      break;
312
0
    case EOpPackUint4x16:     out.debug << "packUint4x16";       break;
313
0
    case EOpUnpackUint4x16:   out.debug << "unpackUint4x16";     break;
314
0
    case EOpPackFloat2x16:    out.debug << "packFloat2x16";      break;
315
0
    case EOpUnpackFloat2x16:  out.debug << "unpackFloat2x16";    break;
316
317
0
    case EOpLength:         out.debug << "length";               break;
318
0
    case EOpNormalize:      out.debug << "normalize";            break;
319
0
    case EOpDPdx:           out.debug << "dPdx";                 break;
320
0
    case EOpDPdy:           out.debug << "dPdy";                 break;
321
0
    case EOpFwidth:         out.debug << "fwidth";               break;
322
0
    case EOpDPdxFine:       out.debug << "dPdxFine";             break;
323
0
    case EOpDPdyFine:       out.debug << "dPdyFine";             break;
324
0
    case EOpFwidthFine:     out.debug << "fwidthFine";           break;
325
0
    case EOpDPdxCoarse:     out.debug << "dPdxCoarse";           break;
326
0
    case EOpDPdyCoarse:     out.debug << "dPdyCoarse";           break;
327
0
    case EOpFwidthCoarse:   out.debug << "fwidthCoarse";         break;
328
329
0
    case EOpInterpolateAtCentroid: out.debug << "interpolateAtCentroid";  break;
330
331
0
    case EOpDeterminant:    out.debug << "determinant";          break;
332
0
    case EOpMatrixInverse:  out.debug << "inverse";              break;
333
0
    case EOpTranspose:      out.debug << "transpose";            break;
334
335
0
    case EOpAny:            out.debug << "any";                  break;
336
0
    case EOpAll:            out.debug << "all";                  break;
337
338
0
    case EOpArrayLength:    out.debug << "array length";         break;
339
340
0
    case EOpEmitStreamVertex:   out.debug << "EmitStreamVertex";   break;
341
0
    case EOpEndStreamPrimitive: out.debug << "EndStreamPrimitive"; break;
342
343
0
    case EOpAtomicCounterIncrement: out.debug << "AtomicCounterIncrement";break;
344
0
    case EOpAtomicCounterDecrement: out.debug << "AtomicCounterDecrement";break;
345
0
    case EOpAtomicCounter:          out.debug << "AtomicCounter";         break;
346
347
0
    case EOpTextureQuerySize:       out.debug << "textureSize";           break;
348
0
    case EOpTextureQueryLod:        out.debug << "textureQueryLod";       break;
349
0
    case EOpTextureQueryLevels:     out.debug << "textureQueryLevels";    break;
350
0
    case EOpTextureQuerySamples:    out.debug << "textureSamples";        break;
351
0
    case EOpImageQuerySize:         out.debug << "imageQuerySize";        break;
352
0
    case EOpImageQuerySamples:      out.debug << "imageQuerySamples";     break;
353
0
    case EOpImageLoad:              out.debug << "imageLoad";             break;
354
355
0
    case EOpBitFieldReverse:        out.debug << "bitFieldReverse";       break;
356
0
    case EOpBitCount:               out.debug << "bitCount";              break;
357
0
    case EOpFindLSB:                out.debug << "findLSB";               break;
358
0
    case EOpFindMSB:                out.debug << "findMSB";               break;
359
360
0
    case EOpCountLeadingZeros:      out.debug << "countLeadingZeros";     break;
361
0
    case EOpCountTrailingZeros:     out.debug << "countTrailingZeros";    break;
362
363
0
    case EOpNoise:                  out.debug << "noise";                 break;
364
365
0
    case EOpBallot:                 out.debug << "ballot";                break;
366
0
    case EOpReadFirstInvocation:    out.debug << "readFirstInvocation";   break;
367
368
0
    case EOpAnyInvocation:          out.debug << "anyInvocation";         break;
369
0
    case EOpAllInvocations:         out.debug << "allInvocations";        break;
370
0
    case EOpAllInvocationsEqual:    out.debug << "allInvocationsEqual";   break;
371
372
0
    case EOpSubgroupElect:                   out.debug << "subgroupElect";                   break;
373
0
    case EOpSubgroupAll:                     out.debug << "subgroupAll";                     break;
374
0
    case EOpSubgroupAny:                     out.debug << "subgroupAny";                     break;
375
0
    case EOpSubgroupAllEqual:                out.debug << "subgroupAllEqual";                break;
376
0
    case EOpSubgroupBroadcast:               out.debug << "subgroupBroadcast";               break;
377
0
    case EOpSubgroupBroadcastFirst:          out.debug << "subgroupBroadcastFirst";          break;
378
0
    case EOpSubgroupBallot:                  out.debug << "subgroupBallot";                  break;
379
0
    case EOpSubgroupInverseBallot:           out.debug << "subgroupInverseBallot";           break;
380
0
    case EOpSubgroupBallotBitExtract:        out.debug << "subgroupBallotBitExtract";        break;
381
0
    case EOpSubgroupBallotBitCount:          out.debug << "subgroupBallotBitCount";          break;
382
0
    case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break;
383
0
    case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break;
384
0
    case EOpSubgroupBallotFindLSB:           out.debug << "subgroupBallotFindLSB";           break;
385
0
    case EOpSubgroupBallotFindMSB:           out.debug << "subgroupBallotFindMSB";           break;
386
0
    case EOpSubgroupShuffle:                 out.debug << "subgroupShuffle";                 break;
387
0
    case EOpSubgroupShuffleXor:              out.debug << "subgroupShuffleXor";              break;
388
0
    case EOpSubgroupShuffleUp:               out.debug << "subgroupShuffleUp";               break;
389
0
    case EOpSubgroupShuffleDown:             out.debug << "subgroupShuffleDown";             break;
390
0
    case EOpSubgroupRotate:                  out.debug << "subgroupRotate";                  break;
391
0
    case EOpSubgroupClusteredRotate:         out.debug << "subgroupClusteredRotate";         break;
392
0
    case EOpSubgroupAdd:                     out.debug << "subgroupAdd";                     break;
393
0
    case EOpSubgroupMul:                     out.debug << "subgroupMul";                     break;
394
0
    case EOpSubgroupMin:                     out.debug << "subgroupMin";                     break;
395
0
    case EOpSubgroupMax:                     out.debug << "subgroupMax";                     break;
396
0
    case EOpSubgroupAnd:                     out.debug << "subgroupAnd";                     break;
397
0
    case EOpSubgroupOr:                      out.debug << "subgroupOr";                      break;
398
0
    case EOpSubgroupXor:                     out.debug << "subgroupXor";                     break;
399
0
    case EOpSubgroupInclusiveAdd:            out.debug << "subgroupInclusiveAdd";            break;
400
0
    case EOpSubgroupInclusiveMul:            out.debug << "subgroupInclusiveMul";            break;
401
0
    case EOpSubgroupInclusiveMin:            out.debug << "subgroupInclusiveMin";            break;
402
0
    case EOpSubgroupInclusiveMax:            out.debug << "subgroupInclusiveMax";            break;
403
0
    case EOpSubgroupInclusiveAnd:            out.debug << "subgroupInclusiveAnd";            break;
404
0
    case EOpSubgroupInclusiveOr:             out.debug << "subgroupInclusiveOr";             break;
405
0
    case EOpSubgroupInclusiveXor:            out.debug << "subgroupInclusiveXor";            break;
406
0
    case EOpSubgroupExclusiveAdd:            out.debug << "subgroupExclusiveAdd";            break;
407
0
    case EOpSubgroupExclusiveMul:            out.debug << "subgroupExclusiveMul";            break;
408
0
    case EOpSubgroupExclusiveMin:            out.debug << "subgroupExclusiveMin";            break;
409
0
    case EOpSubgroupExclusiveMax:            out.debug << "subgroupExclusiveMax";            break;
410
0
    case EOpSubgroupExclusiveAnd:            out.debug << "subgroupExclusiveAnd";            break;
411
0
    case EOpSubgroupExclusiveOr:             out.debug << "subgroupExclusiveOr";             break;
412
0
    case EOpSubgroupExclusiveXor:            out.debug << "subgroupExclusiveXor";            break;
413
0
    case EOpSubgroupClusteredAdd:            out.debug << "subgroupClusteredAdd";            break;
414
0
    case EOpSubgroupClusteredMul:            out.debug << "subgroupClusteredMul";            break;
415
0
    case EOpSubgroupClusteredMin:            out.debug << "subgroupClusteredMin";            break;
416
0
    case EOpSubgroupClusteredMax:            out.debug << "subgroupClusteredMax";            break;
417
0
    case EOpSubgroupClusteredAnd:            out.debug << "subgroupClusteredAnd";            break;
418
0
    case EOpSubgroupClusteredOr:             out.debug << "subgroupClusteredOr";             break;
419
0
    case EOpSubgroupClusteredXor:            out.debug << "subgroupClusteredXor";            break;
420
0
    case EOpSubgroupQuadBroadcast:           out.debug << "subgroupQuadBroadcast";           break;
421
0
    case EOpSubgroupQuadSwapHorizontal:      out.debug << "subgroupQuadSwapHorizontal";      break;
422
0
    case EOpSubgroupQuadSwapVertical:        out.debug << "subgroupQuadSwapVertical";        break;
423
0
    case EOpSubgroupQuadSwapDiagonal:        out.debug << "subgroupQuadSwapDiagonal";        break;
424
0
    case EOpSubgroupQuadAll:                 out.debug << "subgroupQuadAll";                 break;
425
0
    case EOpSubgroupQuadAny:                 out.debug << "subgroupQuadAny";                 break;
426
427
0
    case EOpSubgroupPartition:                          out.debug << "subgroupPartitionNV";                          break;
428
0
    case EOpSubgroupPartitionedAdd:                     out.debug << "subgroupPartitionedAddNV";                     break;
429
0
    case EOpSubgroupPartitionedMul:                     out.debug << "subgroupPartitionedMulNV";                     break;
430
0
    case EOpSubgroupPartitionedMin:                     out.debug << "subgroupPartitionedMinNV";                     break;
431
0
    case EOpSubgroupPartitionedMax:                     out.debug << "subgroupPartitionedMaxNV";                     break;
432
0
    case EOpSubgroupPartitionedAnd:                     out.debug << "subgroupPartitionedAndNV";                     break;
433
0
    case EOpSubgroupPartitionedOr:                      out.debug << "subgroupPartitionedOrNV";                      break;
434
0
    case EOpSubgroupPartitionedXor:                     out.debug << "subgroupPartitionedXorNV";                     break;
435
0
    case EOpSubgroupPartitionedInclusiveAdd:            out.debug << "subgroupPartitionedInclusiveAddNV";            break;
436
0
    case EOpSubgroupPartitionedInclusiveMul:            out.debug << "subgroupPartitionedInclusiveMulNV";            break;
437
0
    case EOpSubgroupPartitionedInclusiveMin:            out.debug << "subgroupPartitionedInclusiveMinNV";            break;
438
0
    case EOpSubgroupPartitionedInclusiveMax:            out.debug << "subgroupPartitionedInclusiveMaxNV";            break;
439
0
    case EOpSubgroupPartitionedInclusiveAnd:            out.debug << "subgroupPartitionedInclusiveAndNV";            break;
440
0
    case EOpSubgroupPartitionedInclusiveOr:             out.debug << "subgroupPartitionedInclusiveOrNV";             break;
441
0
    case EOpSubgroupPartitionedInclusiveXor:            out.debug << "subgroupPartitionedInclusiveXorNV";            break;
442
0
    case EOpSubgroupPartitionedExclusiveAdd:            out.debug << "subgroupPartitionedExclusiveAddNV";            break;
443
0
    case EOpSubgroupPartitionedExclusiveMul:            out.debug << "subgroupPartitionedExclusiveMulNV";            break;
444
0
    case EOpSubgroupPartitionedExclusiveMin:            out.debug << "subgroupPartitionedExclusiveMinNV";            break;
445
0
    case EOpSubgroupPartitionedExclusiveMax:            out.debug << "subgroupPartitionedExclusiveMaxNV";            break;
446
0
    case EOpSubgroupPartitionedExclusiveAnd:            out.debug << "subgroupPartitionedExclusiveAndNV";            break;
447
0
    case EOpSubgroupPartitionedExclusiveOr:             out.debug << "subgroupPartitionedExclusiveOrNV";             break;
448
0
    case EOpSubgroupPartitionedExclusiveXor:            out.debug << "subgroupPartitionedExclusiveXorNV";            break;
449
450
0
    case EOpClip:                   out.debug << "clip";                  break;
451
0
    case EOpIsFinite:               out.debug << "isfinite";              break;
452
0
    case EOpLog10:                  out.debug << "log10";                 break;
453
0
    case EOpRcp:                    out.debug << "rcp";                   break;
454
0
    case EOpSaturate:               out.debug << "saturate";              break;
455
456
0
    case EOpSparseTexelsResident:   out.debug << "sparseTexelsResident";  break;
457
458
0
    case EOpMinInvocations:             out.debug << "minInvocations";              break;
459
0
    case EOpMaxInvocations:             out.debug << "maxInvocations";              break;
460
0
    case EOpAddInvocations:             out.debug << "addInvocations";              break;
461
0
    case EOpMinInvocationsNonUniform:   out.debug << "minInvocationsNonUniform";    break;
462
0
    case EOpMaxInvocationsNonUniform:   out.debug << "maxInvocationsNonUniform";    break;
463
0
    case EOpAddInvocationsNonUniform:   out.debug << "addInvocationsNonUniform";    break;
464
465
0
    case EOpMinInvocationsInclusiveScan:            out.debug << "minInvocationsInclusiveScan";             break;
466
0
    case EOpMaxInvocationsInclusiveScan:            out.debug << "maxInvocationsInclusiveScan";             break;
467
0
    case EOpAddInvocationsInclusiveScan:            out.debug << "addInvocationsInclusiveScan";             break;
468
0
    case EOpMinInvocationsInclusiveScanNonUniform:  out.debug << "minInvocationsInclusiveScanNonUniform";   break;
469
0
    case EOpMaxInvocationsInclusiveScanNonUniform:  out.debug << "maxInvocationsInclusiveScanNonUniform";   break;
470
0
    case EOpAddInvocationsInclusiveScanNonUniform:  out.debug << "addInvocationsInclusiveScanNonUniform";   break;
471
472
0
    case EOpMinInvocationsExclusiveScan:            out.debug << "minInvocationsExclusiveScan";             break;
473
0
    case EOpMaxInvocationsExclusiveScan:            out.debug << "maxInvocationsExclusiveScan";             break;
474
0
    case EOpAddInvocationsExclusiveScan:            out.debug << "addInvocationsExclusiveScan";             break;
475
0
    case EOpMinInvocationsExclusiveScanNonUniform:  out.debug << "minInvocationsExclusiveScanNonUniform";   break;
476
0
    case EOpMaxInvocationsExclusiveScanNonUniform:  out.debug << "maxInvocationsExclusiveScanNonUniform";   break;
477
0
    case EOpAddInvocationsExclusiveScanNonUniform:  out.debug << "addInvocationsExclusiveScanNonUniform";   break;
478
479
0
    case EOpMbcnt:                  out.debug << "mbcnt";                       break;
480
481
0
    case EOpFragmentMaskFetch:      out.debug << "fragmentMaskFetchAMD";        break;
482
0
    case EOpFragmentFetch:          out.debug << "fragmentFetchAMD";            break;
483
484
0
    case EOpCubeFaceIndex:          out.debug << "cubeFaceIndex";               break;
485
0
    case EOpCubeFaceCoord:          out.debug << "cubeFaceCoord";               break;
486
487
0
    case EOpSubpassLoad:   out.debug << "subpassLoad";   break;
488
0
    case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
489
490
0
    case EOpColorAttachmentReadEXT:   out.debug << "colorAttachmentReadEXT";   break;
491
492
0
    case EOpConstructReference: out.debug << "Construct reference type"; break;
493
494
0
    case EOpDeclare: out.debug << "Declare"; break;
495
496
0
    case EOpSpirvInst: out.debug << "spirv_instruction"; break;
497
498
0
    case EOpCreateTensorLayoutNV:           out.debug << "createTensorLayoutNV"; break;
499
0
    case EOpTensorLayoutSetBlockSizeNV:     out.debug << "setTensorLayoutBlockSizeNV"; break;
500
0
    case EOpTensorLayoutSetDimensionNV:     out.debug << "setTensorLayoutDimensionNV"; break;
501
0
    case EOpTensorLayoutSetStrideNV:        out.debug << "setTensorLayoutStrideNV"; break;
502
0
    case EOpTensorLayoutSliceNV:            out.debug << "sliceTensorLayoutNV"; break;
503
0
    case EOpTensorLayoutSetClampValueNV:    out.debug << "setTensorLayoutClampValueNV"; break;
504
0
    case EOpCreateTensorViewNV:             out.debug << "createTensorViewNV"; break;
505
0
    case EOpTensorViewSetDimensionNV:       out.debug << "setTensorViewDimensionsNV"; break;
506
0
    case EOpTensorViewSetStrideNV:          out.debug << "setTensorViewStrideNV"; break;
507
0
    case EOpTensorViewSetClipNV:            out.debug << "setTensorViewClipNV"; break;
508
509
0
    default: out.debug.message(EPrefixError, "Bad unary op");
510
0
    }
511
512
0
    out.debug << " (" << node->getCompleteString() << ")";
513
514
0
    out.debug << "\n";
515
516
0
    return true;
517
0
}
518
519
bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
520
0
{
521
0
    TInfoSink& out = infoSink;
522
523
0
    if (node->getOp() == EOpNull) {
524
0
        out.debug.message(EPrefixError, "node is still EOpNull!");
525
0
        return true;
526
0
    }
527
528
0
    OutputTreeText(out, node, depth);
529
530
0
    switch (node->getOp()) {
531
0
    case EOpSequence:      out.debug << "Sequence\n";       return true;
532
0
    case EOpScope:         out.debug << "Scope\n";       return true;
533
0
    case EOpLinkerObjects: out.debug << "Linker Objects\n"; return true;
534
0
    case EOpComma:         out.debug << "Comma";            break;
535
0
    case EOpFunction:      out.debug << "Function Definition: " << node->getName(); break;
536
0
    case EOpFunctionCall:  out.debug << "Function Call: "       << node->getName(); break;
537
0
    case EOpParameters:    out.debug << "Function Parameters: ";                    break;
538
539
0
    case EOpConstructFloat: out.debug << "Construct float"; break;
540
0
    case EOpConstructDouble:out.debug << "Construct double"; break;
541
542
0
    case EOpConstructVec2:  out.debug << "Construct vec2";  break;
543
0
    case EOpConstructVec3:  out.debug << "Construct vec3";  break;
544
0
    case EOpConstructVec4:  out.debug << "Construct vec4";  break;
545
0
    case EOpConstructDVec2: out.debug << "Construct dvec2";  break;
546
0
    case EOpConstructDVec3: out.debug << "Construct dvec3";  break;
547
0
    case EOpConstructDVec4: out.debug << "Construct dvec4";  break;
548
0
    case EOpConstructBool:  out.debug << "Construct bool";  break;
549
0
    case EOpConstructBVec2: out.debug << "Construct bvec2"; break;
550
0
    case EOpConstructBVec3: out.debug << "Construct bvec3"; break;
551
0
    case EOpConstructBVec4: out.debug << "Construct bvec4"; break;
552
0
    case EOpConstructInt8:   out.debug << "Construct int8_t";   break;
553
0
    case EOpConstructI8Vec2: out.debug << "Construct i8vec2"; break;
554
0
    case EOpConstructI8Vec3: out.debug << "Construct i8vec3"; break;
555
0
    case EOpConstructI8Vec4: out.debug << "Construct i8vec4"; break;
556
0
    case EOpConstructInt:   out.debug << "Construct int";   break;
557
0
    case EOpConstructIVec2: out.debug << "Construct ivec2"; break;
558
0
    case EOpConstructIVec3: out.debug << "Construct ivec3"; break;
559
0
    case EOpConstructIVec4: out.debug << "Construct ivec4"; break;
560
0
    case EOpConstructUint8:    out.debug << "Construct uint8_t";    break;
561
0
    case EOpConstructU8Vec2:   out.debug << "Construct u8vec2";   break;
562
0
    case EOpConstructU8Vec3:   out.debug << "Construct u8vec3";   break;
563
0
    case EOpConstructU8Vec4:   out.debug << "Construct u8vec4";   break;
564
0
    case EOpConstructUint:    out.debug << "Construct uint";    break;
565
0
    case EOpConstructUVec2:   out.debug << "Construct uvec2";   break;
566
0
    case EOpConstructUVec3:   out.debug << "Construct uvec3";   break;
567
0
    case EOpConstructUVec4:   out.debug << "Construct uvec4";   break;
568
0
    case EOpConstructInt64:   out.debug << "Construct int64"; break;
569
0
    case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break;
570
0
    case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break;
571
0
    case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break;
572
0
    case EOpConstructUint64:  out.debug << "Construct uint64"; break;
573
0
    case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break;
574
0
    case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break;
575
0
    case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break;
576
0
    case EOpConstructInt16:   out.debug << "Construct int16_t"; break;
577
0
    case EOpConstructI16Vec2: out.debug << "Construct i16vec2"; break;
578
0
    case EOpConstructI16Vec3: out.debug << "Construct i16vec3"; break;
579
0
    case EOpConstructI16Vec4: out.debug << "Construct i16vec4"; break;
580
0
    case EOpConstructUint16:  out.debug << "Construct uint16_t"; break;
581
0
    case EOpConstructU16Vec2: out.debug << "Construct u16vec2"; break;
582
0
    case EOpConstructU16Vec3: out.debug << "Construct u16vec3"; break;
583
0
    case EOpConstructU16Vec4: out.debug << "Construct u16vec4"; break;
584
0
    case EOpConstructMat2x2:  out.debug << "Construct mat2";    break;
585
0
    case EOpConstructMat2x3:  out.debug << "Construct mat2x3";  break;
586
0
    case EOpConstructMat2x4:  out.debug << "Construct mat2x4";  break;
587
0
    case EOpConstructMat3x2:  out.debug << "Construct mat3x2";  break;
588
0
    case EOpConstructMat3x3:  out.debug << "Construct mat3";    break;
589
0
    case EOpConstructMat3x4:  out.debug << "Construct mat3x4";  break;
590
0
    case EOpConstructMat4x2:  out.debug << "Construct mat4x2";  break;
591
0
    case EOpConstructMat4x3:  out.debug << "Construct mat4x3";  break;
592
0
    case EOpConstructMat4x4:  out.debug << "Construct mat4";    break;
593
0
    case EOpConstructDMat2x2: out.debug << "Construct dmat2";   break;
594
0
    case EOpConstructDMat2x3: out.debug << "Construct dmat2x3"; break;
595
0
    case EOpConstructDMat2x4: out.debug << "Construct dmat2x4"; break;
596
0
    case EOpConstructDMat3x2: out.debug << "Construct dmat3x2"; break;
597
0
    case EOpConstructDMat3x3: out.debug << "Construct dmat3";   break;
598
0
    case EOpConstructDMat3x4: out.debug << "Construct dmat3x4"; break;
599
0
    case EOpConstructDMat4x2: out.debug << "Construct dmat4x2"; break;
600
0
    case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break;
601
0
    case EOpConstructDMat4x4: out.debug << "Construct dmat4";   break;
602
0
    case EOpConstructIMat2x2: out.debug << "Construct imat2";   break;
603
0
    case EOpConstructIMat2x3: out.debug << "Construct imat2x3"; break;
604
0
    case EOpConstructIMat2x4: out.debug << "Construct imat2x4"; break;
605
0
    case EOpConstructIMat3x2: out.debug << "Construct imat3x2"; break;
606
0
    case EOpConstructIMat3x3: out.debug << "Construct imat3";   break;
607
0
    case EOpConstructIMat3x4: out.debug << "Construct imat3x4"; break;
608
0
    case EOpConstructIMat4x2: out.debug << "Construct imat4x2"; break;
609
0
    case EOpConstructIMat4x3: out.debug << "Construct imat4x3"; break;
610
0
    case EOpConstructIMat4x4: out.debug << "Construct imat4";   break;
611
0
    case EOpConstructUMat2x2: out.debug << "Construct umat2";   break;
612
0
    case EOpConstructUMat2x3: out.debug << "Construct umat2x3"; break;
613
0
    case EOpConstructUMat2x4: out.debug << "Construct umat2x4"; break;
614
0
    case EOpConstructUMat3x2: out.debug << "Construct umat3x2"; break;
615
0
    case EOpConstructUMat3x3: out.debug << "Construct umat3";   break;
616
0
    case EOpConstructUMat3x4: out.debug << "Construct umat3x4"; break;
617
0
    case EOpConstructUMat4x2: out.debug << "Construct umat4x2"; break;
618
0
    case EOpConstructUMat4x3: out.debug << "Construct umat4x3"; break;
619
0
    case EOpConstructUMat4x4: out.debug << "Construct umat4";   break;
620
0
    case EOpConstructBMat2x2: out.debug << "Construct bmat2";   break;
621
0
    case EOpConstructBMat2x3: out.debug << "Construct bmat2x3"; break;
622
0
    case EOpConstructBMat2x4: out.debug << "Construct bmat2x4"; break;
623
0
    case EOpConstructBMat3x2: out.debug << "Construct bmat3x2"; break;
624
0
    case EOpConstructBMat3x3: out.debug << "Construct bmat3";   break;
625
0
    case EOpConstructBMat3x4: out.debug << "Construct bmat3x4"; break;
626
0
    case EOpConstructBMat4x2: out.debug << "Construct bmat4x2"; break;
627
0
    case EOpConstructBMat4x3: out.debug << "Construct bmat4x3"; break;
628
0
    case EOpConstructBMat4x4: out.debug << "Construct bmat4";   break;
629
0
    case EOpConstructBFloat16:  out.debug << "Construct bfloat16_t"; break;
630
0
    case EOpConstructBF16Vec2:  out.debug << "Construct bf16vec2";   break;
631
0
    case EOpConstructBF16Vec3:  out.debug << "Construct bf16vec3";   break;
632
0
    case EOpConstructBF16Vec4:  out.debug << "Construct bf16vec4";   break;
633
0
    case EOpConstructFloatE5M2:  out.debug << "Construct floate5m2_t"; break;
634
0
    case EOpConstructFloatE5M2Vec2:  out.debug << "Construct fe5m2vec2";   break;
635
0
    case EOpConstructFloatE5M2Vec3:  out.debug << "Construct fe5m2vec3";   break;
636
0
    case EOpConstructFloatE5M2Vec4:  out.debug << "Construct fe5m2vec4";   break;
637
0
    case EOpConstructFloatE4M3:  out.debug << "Construct floate4m3_t"; break;
638
0
    case EOpConstructFloatE4M3Vec2:  out.debug << "Construct fe4m3vec2";   break;
639
0
    case EOpConstructFloatE4M3Vec3:  out.debug << "Construct fe4m3vec3";   break;
640
0
    case EOpConstructFloatE4M3Vec4:  out.debug << "Construct fe4m3vec4";   break;
641
0
    case EOpConstructFloat16:   out.debug << "Construct float16_t"; break;
642
0
    case EOpConstructF16Vec2:   out.debug << "Construct f16vec2";   break;
643
0
    case EOpConstructF16Vec3:   out.debug << "Construct f16vec3";   break;
644
0
    case EOpConstructF16Vec4:   out.debug << "Construct f16vec4";   break;
645
0
    case EOpConstructF16Mat2x2: out.debug << "Construct f16mat2";   break;
646
0
    case EOpConstructF16Mat2x3: out.debug << "Construct f16mat2x3"; break;
647
0
    case EOpConstructF16Mat2x4: out.debug << "Construct f16mat2x4"; break;
648
0
    case EOpConstructF16Mat3x2: out.debug << "Construct f16mat3x2"; break;
649
0
    case EOpConstructF16Mat3x3: out.debug << "Construct f16mat3";   break;
650
0
    case EOpConstructF16Mat3x4: out.debug << "Construct f16mat3x4"; break;
651
0
    case EOpConstructF16Mat4x2: out.debug << "Construct f16mat4x2"; break;
652
0
    case EOpConstructF16Mat4x3: out.debug << "Construct f16mat4x3"; break;
653
0
    case EOpConstructF16Mat4x4: out.debug << "Construct f16mat4";   break;
654
0
    case EOpConstructStruct:  out.debug << "Construct structure";  break;
655
0
    case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break;
656
0
    case EOpConstructReference:  out.debug << "Construct reference";  break;
657
0
    case EOpConstructCooperativeMatrixNV:  out.debug << "Construct cooperative matrix NV";  break;
658
0
    case EOpConstructCooperativeMatrixKHR:  out.debug << "Construct cooperative matrix KHR";  break;
659
0
    case EOpConstructCooperativeVectorNV:  out.debug << "Construct cooperative vector NV";  break;
660
0
    case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break;
661
662
0
    case EOpBitCastArrayQCOM:              out.debug << "Bitcast To Array QCOM"; break;
663
0
    case EOpExtractSubArrayQCOM:           out.debug << "Extract Subarray QCOM"; break;
664
0
    case EOpCompositeConstructCoopMatQCOM:   out.debug << "Construct Cooperative Matrix QCOM"; break;
665
0
    case EOpCompositeExtractCoopMatQCOM:     out.debug << "Extract Cooperative Matrix QCOM"; break;
666
667
0
    case EOpLessThan:         out.debug << "Compare Less Than";             break;
668
0
    case EOpGreaterThan:      out.debug << "Compare Greater Than";          break;
669
0
    case EOpLessThanEqual:    out.debug << "Compare Less Than or Equal";    break;
670
0
    case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break;
671
0
    case EOpVectorEqual:      out.debug << "Equal";                         break;
672
0
    case EOpVectorNotEqual:   out.debug << "NotEqual";                      break;
673
674
0
    case EOpMod:           out.debug << "mod";         break;
675
0
    case EOpModf:          out.debug << "modf";        break;
676
0
    case EOpPow:           out.debug << "pow";         break;
677
678
0
    case EOpAtan:          out.debug << "arc tangent"; break;
679
680
0
    case EOpMin:           out.debug << "min";         break;
681
0
    case EOpMax:           out.debug << "max";         break;
682
0
    case EOpClamp:         out.debug << "clamp";       break;
683
0
    case EOpMix:           out.debug << "mix";         break;
684
0
    case EOpStep:          out.debug << "step";        break;
685
0
    case EOpSmoothStep:    out.debug << "smoothstep";  break;
686
687
0
    case EOpDistance:      out.debug << "distance";                break;
688
0
    case EOpDot:           out.debug << "dot-product";             break;
689
0
    case EOpDotPackedEXT:  out.debug << "dot-product-packed";break;
690
0
    case EOpDotAccSatEXT:  out.debug << "dot-product-accumulate-saturate";break;
691
0
    case EOpDotPackedAccSatEXT:  out.debug << "dot-product-packed-accumulate-saturate";break;
692
0
    case EOpCross:         out.debug << "cross-product";           break;
693
0
    case EOpFaceForward:   out.debug << "face-forward";            break;
694
0
    case EOpReflect:       out.debug << "reflect";                 break;
695
0
    case EOpRefract:       out.debug << "refract";                 break;
696
0
    case EOpMul:           out.debug << "component-wise multiply"; break;
697
0
    case EOpOuterProduct:  out.debug << "outer product";           break;
698
699
0
    case EOpEmitVertex:    out.debug << "EmitVertex";              break;
700
0
    case EOpEndPrimitive:  out.debug << "EndPrimitive";            break;
701
702
0
    case EOpBarrier:                    out.debug << "Barrier";                    break;
703
0
    case EOpMemoryBarrier:              out.debug << "MemoryBarrier";              break;
704
0
    case EOpMemoryBarrierAtomicCounter: out.debug << "MemoryBarrierAtomicCounter"; break;
705
0
    case EOpMemoryBarrierBuffer:        out.debug << "MemoryBarrierBuffer";        break;
706
0
    case EOpMemoryBarrierImage:         out.debug << "MemoryBarrierImage";         break;
707
0
    case EOpMemoryBarrierShared:        out.debug << "MemoryBarrierShared";        break;
708
0
    case EOpGroupMemoryBarrier:         out.debug << "GroupMemoryBarrier";         break;
709
710
0
    case EOpReadInvocation:             out.debug << "readInvocation";        break;
711
712
0
    case EOpSwizzleInvocations:         out.debug << "swizzleInvocations";       break;
713
0
    case EOpSwizzleInvocationsMasked:   out.debug << "swizzleInvocationsMasked"; break;
714
0
    case EOpWriteInvocation:            out.debug << "writeInvocation";          break;
715
716
0
    case EOpMin3:                       out.debug << "min3";                  break;
717
0
    case EOpMax3:                       out.debug << "max3";                  break;
718
0
    case EOpMid3:                       out.debug << "mid3";                  break;
719
0
    case EOpTime:                       out.debug << "time";                  break;
720
721
0
    case EOpAtomicAdd:                  out.debug << "AtomicAdd";             break;
722
0
    case EOpAtomicSubtract:             out.debug << "AtomicSubtract";        break;
723
0
    case EOpAtomicMin:                  out.debug << "AtomicMin";             break;
724
0
    case EOpAtomicMax:                  out.debug << "AtomicMax";             break;
725
0
    case EOpAtomicAnd:                  out.debug << "AtomicAnd";             break;
726
0
    case EOpAtomicOr:                   out.debug << "AtomicOr";              break;
727
0
    case EOpAtomicXor:                  out.debug << "AtomicXor";             break;
728
0
    case EOpAtomicExchange:             out.debug << "AtomicExchange";        break;
729
0
    case EOpAtomicCompSwap:             out.debug << "AtomicCompSwap";        break;
730
0
    case EOpAtomicLoad:                 out.debug << "AtomicLoad";            break;
731
0
    case EOpAtomicStore:                out.debug << "AtomicStore";           break;
732
733
0
    case EOpAtomicCounterAdd:           out.debug << "AtomicCounterAdd";      break;
734
0
    case EOpAtomicCounterSubtract:      out.debug << "AtomicCounterSubtract"; break;
735
0
    case EOpAtomicCounterMin:           out.debug << "AtomicCounterMin";      break;
736
0
    case EOpAtomicCounterMax:           out.debug << "AtomicCounterMax";      break;
737
0
    case EOpAtomicCounterAnd:           out.debug << "AtomicCounterAnd";      break;
738
0
    case EOpAtomicCounterOr:            out.debug << "AtomicCounterOr";       break;
739
0
    case EOpAtomicCounterXor:           out.debug << "AtomicCounterXor";      break;
740
0
    case EOpAtomicCounterExchange:      out.debug << "AtomicCounterExchange"; break;
741
0
    case EOpAtomicCounterCompSwap:      out.debug << "AtomicCounterCompSwap"; break;
742
743
0
    case EOpImageQuerySize:             out.debug << "imageQuerySize";        break;
744
0
    case EOpImageQuerySamples:          out.debug << "imageQuerySamples";     break;
745
0
    case EOpImageLoad:                  out.debug << "imageLoad";             break;
746
0
    case EOpImageStore:                 out.debug << "imageStore";            break;
747
0
    case EOpImageAtomicAdd:             out.debug << "imageAtomicAdd";        break;
748
0
    case EOpImageAtomicMin:             out.debug << "imageAtomicMin";        break;
749
0
    case EOpImageAtomicMax:             out.debug << "imageAtomicMax";        break;
750
0
    case EOpImageAtomicAnd:             out.debug << "imageAtomicAnd";        break;
751
0
    case EOpImageAtomicOr:              out.debug << "imageAtomicOr";         break;
752
0
    case EOpImageAtomicXor:             out.debug << "imageAtomicXor";        break;
753
0
    case EOpImageAtomicExchange:        out.debug << "imageAtomicExchange";   break;
754
0
    case EOpImageAtomicCompSwap:        out.debug << "imageAtomicCompSwap";   break;
755
0
    case EOpImageAtomicLoad:            out.debug << "imageAtomicLoad";       break;
756
0
    case EOpImageAtomicStore:           out.debug << "imageAtomicStore";      break;
757
0
    case EOpImageLoadLod:               out.debug << "imageLoadLod";          break;
758
0
    case EOpImageStoreLod:              out.debug << "imageStoreLod";         break;
759
760
0
    case EOpTextureQuerySize:           out.debug << "textureSize";           break;
761
0
    case EOpTextureQueryLod:            out.debug << "textureQueryLod";       break;
762
0
    case EOpTextureQueryLevels:         out.debug << "textureQueryLevels";    break;
763
0
    case EOpTextureQuerySamples:        out.debug << "textureSamples";        break;
764
0
    case EOpTexture:                    out.debug << "texture";               break;
765
0
    case EOpTextureProj:                out.debug << "textureProj";           break;
766
0
    case EOpTextureLod:                 out.debug << "textureLod";            break;
767
0
    case EOpTextureOffset:              out.debug << "textureOffset";         break;
768
0
    case EOpTextureFetch:               out.debug << "textureFetch";          break;
769
0
    case EOpTextureFetchOffset:         out.debug << "textureFetchOffset";    break;
770
0
    case EOpTextureProjOffset:          out.debug << "textureProjOffset";     break;
771
0
    case EOpTextureLodOffset:           out.debug << "textureLodOffset";      break;
772
0
    case EOpTextureProjLod:             out.debug << "textureProjLod";        break;
773
0
    case EOpTextureProjLodOffset:       out.debug << "textureProjLodOffset";  break;
774
0
    case EOpTextureGrad:                out.debug << "textureGrad";           break;
775
0
    case EOpTextureGradOffset:          out.debug << "textureGradOffset";     break;
776
0
    case EOpTextureProjGrad:            out.debug << "textureProjGrad";       break;
777
0
    case EOpTextureProjGradOffset:      out.debug << "textureProjGradOffset"; break;
778
0
    case EOpTextureGather:              out.debug << "textureGather";         break;
779
0
    case EOpTextureGatherOffset:        out.debug << "textureGatherOffset";   break;
780
0
    case EOpTextureGatherOffsets:       out.debug << "textureGatherOffsets";  break;
781
0
    case EOpTextureClamp:               out.debug << "textureClamp";          break;
782
0
    case EOpTextureOffsetClamp:         out.debug << "textureOffsetClamp";    break;
783
0
    case EOpTextureGradClamp:           out.debug << "textureGradClamp";      break;
784
0
    case EOpTextureGradOffsetClamp:     out.debug << "textureGradOffsetClamp";  break;
785
0
    case EOpTextureGatherLod:           out.debug << "textureGatherLod";        break;
786
0
    case EOpTextureGatherLodOffset:     out.debug << "textureGatherLodOffset";  break;
787
0
    case EOpTextureGatherLodOffsets:    out.debug << "textureGatherLodOffsets"; break;
788
789
0
    case EOpSparseTexture:                  out.debug << "sparseTexture";                   break;
790
0
    case EOpSparseTextureOffset:            out.debug << "sparseTextureOffset";             break;
791
0
    case EOpSparseTextureLod:               out.debug << "sparseTextureLod";                break;
792
0
    case EOpSparseTextureLodOffset:         out.debug << "sparseTextureLodOffset";          break;
793
0
    case EOpSparseTextureFetch:             out.debug << "sparseTexelFetch";                break;
794
0
    case EOpSparseTextureFetchOffset:       out.debug << "sparseTexelFetchOffset";          break;
795
0
    case EOpSparseTextureGrad:              out.debug << "sparseTextureGrad";               break;
796
0
    case EOpSparseTextureGradOffset:        out.debug << "sparseTextureGradOffset";         break;
797
0
    case EOpSparseTextureGather:            out.debug << "sparseTextureGather";             break;
798
0
    case EOpSparseTextureGatherOffset:      out.debug << "sparseTextureGatherOffset";       break;
799
0
    case EOpSparseTextureGatherOffsets:     out.debug << "sparseTextureGatherOffsets";      break;
800
0
    case EOpSparseImageLoad:                out.debug << "sparseImageLoad";                 break;
801
0
    case EOpSparseTextureClamp:             out.debug << "sparseTextureClamp";              break;
802
0
    case EOpSparseTextureOffsetClamp:       out.debug << "sparseTextureOffsetClamp";        break;
803
0
    case EOpSparseTextureGradClamp:         out.debug << "sparseTextureGradClamp";          break;
804
0
    case EOpSparseTextureGradOffsetClamp:   out.debug << "sparseTextureGradOffsetClam";     break;
805
0
    case EOpSparseTextureGatherLod:         out.debug << "sparseTextureGatherLod";          break;
806
0
    case EOpSparseTextureGatherLodOffset:   out.debug << "sparseTextureGatherLodOffset";    break;
807
0
    case EOpSparseTextureGatherLodOffsets:  out.debug << "sparseTextureGatherLodOffsets";   break;
808
0
    case EOpSparseImageLoadLod:             out.debug << "sparseImageLoadLod";              break;
809
0
    case EOpImageSampleFootprintNV:             out.debug << "imageSampleFootprintNV";          break;
810
0
    case EOpImageSampleFootprintClampNV:        out.debug << "imageSampleFootprintClampNV";     break;
811
0
    case EOpImageSampleFootprintLodNV:          out.debug << "imageSampleFootprintLodNV";       break;
812
0
    case EOpImageSampleFootprintGradNV:         out.debug << "imageSampleFootprintGradNV";      break;
813
0
    case EOpImageSampleFootprintGradClampNV:    out.debug << "mageSampleFootprintGradClampNV";  break;
814
0
    case EOpAddCarry:                   out.debug << "addCarry";              break;
815
0
    case EOpSubBorrow:                  out.debug << "subBorrow";             break;
816
0
    case EOpUMulExtended:               out.debug << "uMulExtended";          break;
817
0
    case EOpIMulExtended:               out.debug << "iMulExtended";          break;
818
0
    case EOpBitfieldExtract:            out.debug << "bitfieldExtract";       break;
819
0
    case EOpBitfieldInsert:             out.debug << "bitfieldInsert";        break;
820
821
0
    case EOpFma:                        out.debug << "fma";                   break;
822
0
    case EOpFrexp:                      out.debug << "frexp";                 break;
823
0
    case EOpLdexp:                      out.debug << "ldexp";                 break;
824
825
0
    case EOpInterpolateAtSample:   out.debug << "interpolateAtSample";    break;
826
0
    case EOpInterpolateAtOffset:   out.debug << "interpolateAtOffset";    break;
827
0
    case EOpInterpolateAtVertex:   out.debug << "interpolateAtVertex";    break;
828
829
0
    case EOpSinCos:                     out.debug << "sincos";                break;
830
0
    case EOpGenMul:                     out.debug << "mul";                   break;
831
832
0
    case EOpAllMemoryBarrierWithGroupSync:    out.debug << "AllMemoryBarrierWithGroupSync";    break;
833
0
    case EOpDeviceMemoryBarrier:              out.debug << "DeviceMemoryBarrier";              break;
834
0
    case EOpDeviceMemoryBarrierWithGroupSync: out.debug << "DeviceMemoryBarrierWithGroupSync"; break;
835
0
    case EOpWorkgroupMemoryBarrier:           out.debug << "WorkgroupMemoryBarrier";           break;
836
0
    case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break;
837
838
0
    case EOpSubgroupBarrier:                 out.debug << "subgroupBarrier"; break;
839
0
    case EOpSubgroupMemoryBarrier:           out.debug << "subgroupMemoryBarrier"; break;
840
0
    case EOpSubgroupMemoryBarrierBuffer:     out.debug << "subgroupMemoryBarrierBuffer"; break;
841
0
    case EOpSubgroupMemoryBarrierImage:      out.debug << "subgroupMemoryBarrierImage";   break;
842
0
    case EOpSubgroupMemoryBarrierShared:     out.debug << "subgroupMemoryBarrierShared"; break;
843
0
    case EOpSubgroupElect:                   out.debug << "subgroupElect"; break;
844
0
    case EOpSubgroupAll:                     out.debug << "subgroupAll"; break;
845
0
    case EOpSubgroupAny:                     out.debug << "subgroupAny"; break;
846
0
    case EOpSubgroupAllEqual:                out.debug << "subgroupAllEqual"; break;
847
0
    case EOpSubgroupBroadcast:               out.debug << "subgroupBroadcast"; break;
848
0
    case EOpSubgroupBroadcastFirst:          out.debug << "subgroupBroadcastFirst"; break;
849
0
    case EOpSubgroupBallot:                  out.debug << "subgroupBallot"; break;
850
0
    case EOpSubgroupInverseBallot:           out.debug << "subgroupInverseBallot"; break;
851
0
    case EOpSubgroupBallotBitExtract:        out.debug << "subgroupBallotBitExtract"; break;
852
0
    case EOpSubgroupBallotBitCount:          out.debug << "subgroupBallotBitCount"; break;
853
0
    case EOpSubgroupBallotInclusiveBitCount: out.debug << "subgroupBallotInclusiveBitCount"; break;
854
0
    case EOpSubgroupBallotExclusiveBitCount: out.debug << "subgroupBallotExclusiveBitCount"; break;
855
0
    case EOpSubgroupBallotFindLSB:           out.debug << "subgroupBallotFindLSB"; break;
856
0
    case EOpSubgroupBallotFindMSB:           out.debug << "subgroupBallotFindMSB"; break;
857
0
    case EOpSubgroupShuffle:                 out.debug << "subgroupShuffle"; break;
858
0
    case EOpSubgroupShuffleXor:              out.debug << "subgroupShuffleXor"; break;
859
0
    case EOpSubgroupShuffleUp:               out.debug << "subgroupShuffleUp"; break;
860
0
    case EOpSubgroupShuffleDown:             out.debug << "subgroupShuffleDown"; break;
861
0
    case EOpSubgroupRotate:                  out.debug << "subgroupRotate"; break;
862
0
    case EOpSubgroupClusteredRotate:         out.debug << "subgroupClusteredRotate"; break;
863
0
    case EOpSubgroupAdd:                     out.debug << "subgroupAdd"; break;
864
0
    case EOpSubgroupMul:                     out.debug << "subgroupMul"; break;
865
0
    case EOpSubgroupMin:                     out.debug << "subgroupMin"; break;
866
0
    case EOpSubgroupMax:                     out.debug << "subgroupMax"; break;
867
0
    case EOpSubgroupAnd:                     out.debug << "subgroupAnd"; break;
868
0
    case EOpSubgroupOr:                      out.debug << "subgroupOr"; break;
869
0
    case EOpSubgroupXor:                     out.debug << "subgroupXor"; break;
870
0
    case EOpSubgroupInclusiveAdd:            out.debug << "subgroupInclusiveAdd"; break;
871
0
    case EOpSubgroupInclusiveMul:            out.debug << "subgroupInclusiveMul"; break;
872
0
    case EOpSubgroupInclusiveMin:            out.debug << "subgroupInclusiveMin"; break;
873
0
    case EOpSubgroupInclusiveMax:            out.debug << "subgroupInclusiveMax"; break;
874
0
    case EOpSubgroupInclusiveAnd:            out.debug << "subgroupInclusiveAnd"; break;
875
0
    case EOpSubgroupInclusiveOr:             out.debug << "subgroupInclusiveOr"; break;
876
0
    case EOpSubgroupInclusiveXor:            out.debug << "subgroupInclusiveXor"; break;
877
0
    case EOpSubgroupExclusiveAdd:            out.debug << "subgroupExclusiveAdd"; break;
878
0
    case EOpSubgroupExclusiveMul:            out.debug << "subgroupExclusiveMul"; break;
879
0
    case EOpSubgroupExclusiveMin:            out.debug << "subgroupExclusiveMin"; break;
880
0
    case EOpSubgroupExclusiveMax:            out.debug << "subgroupExclusiveMax"; break;
881
0
    case EOpSubgroupExclusiveAnd:            out.debug << "subgroupExclusiveAnd"; break;
882
0
    case EOpSubgroupExclusiveOr:             out.debug << "subgroupExclusiveOr"; break;
883
0
    case EOpSubgroupExclusiveXor:            out.debug << "subgroupExclusiveXor"; break;
884
0
    case EOpSubgroupClusteredAdd:            out.debug << "subgroupClusteredAdd"; break;
885
0
    case EOpSubgroupClusteredMul:            out.debug << "subgroupClusteredMul"; break;
886
0
    case EOpSubgroupClusteredMin:            out.debug << "subgroupClusteredMin"; break;
887
0
    case EOpSubgroupClusteredMax:            out.debug << "subgroupClusteredMax"; break;
888
0
    case EOpSubgroupClusteredAnd:            out.debug << "subgroupClusteredAnd"; break;
889
0
    case EOpSubgroupClusteredOr:             out.debug << "subgroupClusteredOr"; break;
890
0
    case EOpSubgroupClusteredXor:            out.debug << "subgroupClusteredXor"; break;
891
0
    case EOpSubgroupQuadBroadcast:           out.debug << "subgroupQuadBroadcast"; break;
892
0
    case EOpSubgroupQuadSwapHorizontal:      out.debug << "subgroupQuadSwapHorizontal"; break;
893
0
    case EOpSubgroupQuadSwapVertical:        out.debug << "subgroupQuadSwapVertical"; break;
894
0
    case EOpSubgroupQuadSwapDiagonal:        out.debug << "subgroupQuadSwapDiagonal"; break;
895
0
    case EOpSubgroupQuadAll:                 out.debug << "subgroupQuadAll"; break;
896
0
    case EOpSubgroupQuadAny:                 out.debug << "subgroupQuadAny"; break;
897
898
0
    case EOpSubgroupPartition:                          out.debug << "subgroupPartitionNV";                          break;
899
0
    case EOpSubgroupPartitionedAdd:                     out.debug << "subgroupPartitionedAddNV";                     break;
900
0
    case EOpSubgroupPartitionedMul:                     out.debug << "subgroupPartitionedMulNV";                     break;
901
0
    case EOpSubgroupPartitionedMin:                     out.debug << "subgroupPartitionedMinNV";                     break;
902
0
    case EOpSubgroupPartitionedMax:                     out.debug << "subgroupPartitionedMaxNV";                     break;
903
0
    case EOpSubgroupPartitionedAnd:                     out.debug << "subgroupPartitionedAndNV";                     break;
904
0
    case EOpSubgroupPartitionedOr:                      out.debug << "subgroupPartitionedOrNV";                      break;
905
0
    case EOpSubgroupPartitionedXor:                     out.debug << "subgroupPartitionedXorNV";                     break;
906
0
    case EOpSubgroupPartitionedInclusiveAdd:            out.debug << "subgroupPartitionedInclusiveAddNV";            break;
907
0
    case EOpSubgroupPartitionedInclusiveMul:            out.debug << "subgroupPartitionedInclusiveMulNV";            break;
908
0
    case EOpSubgroupPartitionedInclusiveMin:            out.debug << "subgroupPartitionedInclusiveMinNV";            break;
909
0
    case EOpSubgroupPartitionedInclusiveMax:            out.debug << "subgroupPartitionedInclusiveMaxNV";            break;
910
0
    case EOpSubgroupPartitionedInclusiveAnd:            out.debug << "subgroupPartitionedInclusiveAndNV";            break;
911
0
    case EOpSubgroupPartitionedInclusiveOr:             out.debug << "subgroupPartitionedInclusiveOrNV";             break;
912
0
    case EOpSubgroupPartitionedInclusiveXor:            out.debug << "subgroupPartitionedInclusiveXorNV";            break;
913
0
    case EOpSubgroupPartitionedExclusiveAdd:            out.debug << "subgroupPartitionedExclusiveAddNV";            break;
914
0
    case EOpSubgroupPartitionedExclusiveMul:            out.debug << "subgroupPartitionedExclusiveMulNV";            break;
915
0
    case EOpSubgroupPartitionedExclusiveMin:            out.debug << "subgroupPartitionedExclusiveMinNV";            break;
916
0
    case EOpSubgroupPartitionedExclusiveMax:            out.debug << "subgroupPartitionedExclusiveMaxNV";            break;
917
0
    case EOpSubgroupPartitionedExclusiveAnd:            out.debug << "subgroupPartitionedExclusiveAndNV";            break;
918
0
    case EOpSubgroupPartitionedExclusiveOr:             out.debug << "subgroupPartitionedExclusiveOrNV";             break;
919
0
    case EOpSubgroupPartitionedExclusiveXor:            out.debug << "subgroupPartitionedExclusiveXorNV";            break;
920
921
0
    case EOpSubpassLoad:   out.debug << "subpassLoad";   break;
922
0
    case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
923
924
0
    case EOpColorAttachmentReadEXT:   out.debug << "colorAttachmentReadEXT";   break;
925
926
0
    case EOpTraceNV:                          out.debug << "traceNV"; break;
927
0
    case EOpTraceRayMotionNV:                 out.debug << "traceRayMotionNV"; break;
928
0
    case EOpTraceKHR:                         out.debug << "traceRayKHR"; break;
929
0
    case EOpReportIntersection:               out.debug << "reportIntersectionNV"; break;
930
0
    case EOpIgnoreIntersectionNV:             out.debug << "ignoreIntersectionNV"; break;
931
0
    case EOpIgnoreIntersectionKHR:            out.debug << "ignoreIntersectionKHR"; break;
932
0
    case EOpTerminateRayNV:                   out.debug << "terminateRayNV"; break;
933
0
    case EOpTerminateRayKHR:                  out.debug << "terminateRayKHR"; break;
934
0
    case EOpExecuteCallableNV:                out.debug << "executeCallableNV"; break;
935
0
    case EOpExecuteCallableKHR:               out.debug << "executeCallableKHR"; break;
936
0
    case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
937
0
    case EOpEmitMeshTasksEXT:                 out.debug << "EmitMeshTasksEXT"; break;
938
0
    case EOpSetMeshOutputsEXT:                out.debug << "SetMeshOutputsEXT"; break;
939
940
0
    case EOpRayQueryInitialize:                                            out.debug << "rayQueryInitializeEXT"; break;
941
0
    case EOpRayQueryTerminate:                                             out.debug << "rayQueryTerminateEXT"; break;
942
0
    case EOpRayQueryGenerateIntersection:                                  out.debug << "rayQueryGenerateIntersectionEXT"; break;
943
0
    case EOpRayQueryConfirmIntersection:                                   out.debug << "rayQueryConfirmIntersectionEXT"; break;
944
0
    case EOpRayQueryProceed:                                               out.debug << "rayQueryProceedEXT"; break;
945
0
    case EOpRayQueryGetIntersectionType:                                   out.debug << "rayQueryGetIntersectionTypeEXT"; break;
946
0
    case EOpRayQueryGetRayTMin:                                            out.debug << "rayQueryGetRayTMinEXT"; break;
947
0
    case EOpRayQueryGetRayFlags:                                           out.debug << "rayQueryGetRayFlagsEXT"; break;
948
0
    case EOpRayQueryGetIntersectionT:                                      out.debug << "rayQueryGetIntersectionTEXT"; break;
949
0
    case EOpRayQueryGetIntersectionInstanceCustomIndex:                    out.debug << "rayQueryGetIntersectionInstanceCustomIndexEXT"; break;
950
0
    case EOpRayQueryGetIntersectionInstanceId:                             out.debug << "rayQueryGetIntersectionInstanceIdEXT"; break;
951
0
    case EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: out.debug << "rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT"; break;
952
0
    case EOpRayQueryGetIntersectionGeometryIndex:                          out.debug << "rayQueryGetIntersectionGeometryIndexEXT"; break;
953
0
    case EOpRayQueryGetIntersectionPrimitiveIndex:                         out.debug << "rayQueryGetIntersectionPrimitiveIndexEXT"; break;
954
0
    case EOpRayQueryGetIntersectionBarycentrics:                           out.debug << "rayQueryGetIntersectionBarycentricsEXT"; break;
955
0
    case EOpRayQueryGetIntersectionFrontFace:                              out.debug << "rayQueryGetIntersectionFrontFaceEXT"; break;
956
0
    case EOpRayQueryGetIntersectionCandidateAABBOpaque:                    out.debug << "rayQueryGetIntersectionCandidateAABBOpaqueEXT"; break;
957
0
    case EOpRayQueryGetIntersectionObjectRayDirection:                     out.debug << "rayQueryGetIntersectionObjectRayDirectionEXT"; break;
958
0
    case EOpRayQueryGetIntersectionObjectRayOrigin:                        out.debug << "rayQueryGetIntersectionObjectRayOriginEXT"; break;
959
0
    case EOpRayQueryGetWorldRayDirection:                                  out.debug << "rayQueryGetWorldRayDirectionEXT"; break;
960
0
    case EOpRayQueryGetWorldRayOrigin:                                     out.debug << "rayQueryGetWorldRayOriginEXT"; break;
961
0
    case EOpRayQueryGetIntersectionObjectToWorld:                          out.debug << "rayQueryGetIntersectionObjectToWorldEXT"; break;
962
0
    case EOpRayQueryGetIntersectionWorldToObject:                          out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break;
963
0
    case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:             out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break;
964
0
    case EOpRayQueryGetIntersectionClusterIdNV:                            out.debug << "rayQueryGetIntersectionClusterIdNV"; break;
965
0
    case EOpRayQueryGetIntersectionSpherePositionNV:                       out.debug << "rayQueryGetIntersectionSpherePositionNV"; break;
966
0
    case EOpRayQueryGetIntersectionSphereRadiusNV:                         out.debug << "rayQueryGetIntersectionSphereRadiusNV"; break;
967
0
    case EOpRayQueryGetIntersectionLSSHitValueNV:                          out.debug << "rayQueryGetIntersectionLSSHitValueNV"; break;
968
0
    case EOpRayQueryGetIntersectionLSSPositionsNV:                         out.debug << "rayQueryGetIntersectionLSSPositionsNV"; break;
969
0
    case EOpRayQueryGetIntersectionLSSRadiiNV:                             out.debug << "rayQueryGetIntersectionLSSRadiiNV"; break;
970
0
    case EOpRayQueryIsSphereHitNV:                                         out.debug << "rayQueryIsSphereHitNV"; break;
971
0
    case EOpRayQueryIsLSSHitNV:                                            out.debug << "rayQueryIsLSSHitNV"; break;
972
973
0
    case EOpCooperativeMatrixLoad:  out.debug << "Load cooperative matrix KHR"; break;
974
0
    case EOpCooperativeMatrixStore:  out.debug << "Store cooperative matrix KHR"; break;
975
0
    case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices KHR"; break;
976
0
    case EOpCooperativeMatrixLoadNV:  out.debug << "Load cooperative matrix NV"; break;
977
0
    case EOpCooperativeMatrixStoreNV:  out.debug << "Store cooperative matrix NV"; break;
978
0
    case EOpCooperativeMatrixLoadTensorNV:  out.debug << "Load cooperative matrix tensor NV"; break;
979
0
    case EOpCooperativeMatrixStoreTensorNV:  out.debug << "Store cooperative matrix tensor NV"; break;
980
0
    case EOpCooperativeMatrixMulAddNV: out.debug << "MulAdd cooperative matrices NV"; break;
981
0
    case EOpCooperativeMatrixReduceNV: out.debug << "Reduce cooperative matrices"; break;
982
0
    case EOpCooperativeMatrixPerElementOpNV: out.debug << "cooperative matrix per element op"; break;
983
0
    case EOpCooperativeMatrixTransposeNV: out.debug << "Transpose cooperative matrix"; break;
984
985
0
    case EOpCooperativeVectorMatMulNV: out.debug << "Cooperative vector matrix multiply NV"; break;
986
0
    case EOpCooperativeVectorMatMulAddNV: out.debug << "Cooperative vector matrix multiply add NV"; break;
987
0
    case EOpCooperativeVectorLoadNV:  out.debug << "Load cooperative vector NV"; break;
988
0
    case EOpCooperativeVectorStoreNV:  out.debug << "Store cooperative vector NV"; break;
989
0
    case EOpCooperativeVectorOuterProductAccumulateNV: out.debug << "Cooperative vector outer product accumulate NV"; break;
990
0
    case EOpCooperativeVectorReduceSumAccumulateNV: out.debug << "Cooperative vector reduce sum accumulate NV"; break;
991
992
0
    case EOpTensorReadARM:   out.debug << "Read from tensor";  break;
993
0
    case EOpTensorWriteARM:  out.debug << "Write to tensor";  break;
994
0
    case EOpTensorSizeARM:   out.debug << "Get tensor size";  break;
995
996
0
    case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
997
0
    case EOpDebugPrintf:  out.debug << "Debug printf";  break;
998
0
    case EOpAbortEXT:  out.debug << "Abort";  break;
999
1000
0
    case EOpHitObjectTraceRayNV: out.debug << "HitObjectTraceRayNV"; break;
1001
0
    case EOpHitObjectTraceRayMotionNV: out.debug << "HitObjectTraceRayMotionNV"; break;
1002
0
    case EOpHitObjectRecordHitNV: out.debug << "HitObjectRecordHitNV"; break;
1003
0
    case EOpHitObjectRecordHitMotionNV: out.debug << "HitObjectRecordHitMotionNV"; break;
1004
0
    case EOpHitObjectRecordHitWithIndexNV: out.debug << "HitObjectRecordHitWithIndexNV"; break;
1005
0
    case EOpHitObjectRecordHitWithIndexMotionNV: out.debug << "HitObjectRecordHitWithIndexMotionNV"; break;
1006
0
    case EOpHitObjectRecordMissNV: out.debug << "HitObjectRecordMissNV"; break;
1007
0
    case EOpHitObjectRecordMissMotionNV: out.debug << "HitObjectRecordMissMotionNV"; break;
1008
0
    case EOpHitObjectRecordEmptyNV: out.debug << "HitObjectRecordEmptyNV"; break;
1009
0
    case EOpHitObjectExecuteShaderNV: out.debug << "HitObjectExecuteShaderNV"; break;
1010
0
    case EOpHitObjectIsEmptyNV: out.debug << "HitObjectIsEmptyNV"; break;
1011
0
    case EOpHitObjectIsMissNV: out.debug << "HitObjectIsMissNV"; break;
1012
0
    case EOpHitObjectIsHitNV:  out.debug << "HitObjectIsHitNV"; break;
1013
0
    case EOpHitObjectGetRayTMinNV: out.debug << "HitObjectGetRayTMinNV"; break;
1014
0
    case EOpHitObjectGetRayTMaxNV: out.debug << "HitObjectGetRayTMaxNV"; break;
1015
0
    case EOpHitObjectGetObjectRayOriginNV: out.debug << "HitObjectGetObjectRayOriginNV"; break;
1016
0
    case EOpHitObjectGetObjectRayDirectionNV: out.debug << "HitObjectGetObjectRayDirectionNV"; break;
1017
0
    case EOpHitObjectGetWorldRayOriginNV: out.debug << "HitObjectGetWorldRayOriginNV"; break;
1018
0
    case EOpHitObjectGetWorldRayDirectionNV: out.debug << "HitObjectGetWorldRayDirectionNV"; break;
1019
0
    case EOpHitObjectGetObjectToWorldNV: out.debug << "HitObjectGetObjectToWorldNV"; break;
1020
0
    case EOpHitObjectGetWorldToObjectNV: out.debug << "HitObjectGetWorldToObjectNV"; break;
1021
0
    case EOpHitObjectGetInstanceCustomIndexNV: out.debug<< "HitObjectGetInstanceCustomIndexNV"; break;
1022
0
    case EOpHitObjectGetInstanceIdNV: out.debug << "HitObjectGetInstaneIdNV"; break;
1023
0
    case EOpHitObjectGetGeometryIndexNV: out.debug << "HitObjectGetGeometryIndexNV"; break;
1024
0
    case EOpHitObjectGetPrimitiveIndexNV: out.debug << "HitObjectGetPrimitiveIndexNV"; break;
1025
0
    case EOpHitObjectGetHitKindNV: out.debug << "HitObjectGetHitKindNV"; break;
1026
0
    case EOpHitObjectGetAttributesNV: out.debug << "HitObjectGetAttributesNV"; break;
1027
0
    case EOpHitObjectGetCurrentTimeNV: out.debug << "HitObjectGetCurrentTimeNV"; break;
1028
0
    case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break;
1029
0
    case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break;
1030
0
    case EOpHitObjectGetClusterIdNV: out.debug << "HitObjectGetClusterIdNV"; break;
1031
0
    case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break;
1032
0
    case EOpFetchMicroTriangleVertexPositionNV: out.debug << "MicroTriangleVertexPositionNV"; break;
1033
0
    case EOpFetchMicroTriangleVertexBarycentricNV: out.debug << "MicroTriangleVertexBarycentricNV"; break;
1034
0
    case EOpHitObjectGetSpherePositionNV: out.debug << "HitObjectGetSpherePositionNV"; break;
1035
0
    case EOpHitObjectGetSphereRadiusNV:   out.debug << "HitObjectGetSphereRadiusNV"; break;
1036
0
    case EOpHitObjectGetLSSPositionsNV:   out.debug << "HitObjectGetLSSPositionsNV"; break;
1037
0
    case EOpHitObjectGetLSSRadiiNV:       out.debug << "HitObjectGetLSSRadiiNV"; break;
1038
0
    case EOpHitObjectIsSphereHitNV:       out.debug << "HitObjectIsSphereHitNV"; break;
1039
0
    case EOpHitObjectIsLSSHitNV:          out.debug << "HitObjectIsLSSHitNV"; break;
1040
1041
0
    case EOpSpirvInst: out.debug << "spirv_instruction"; break;
1042
0
    case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break;
1043
0
    case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break;
1044
1045
0
    case EOpCreateTensorLayoutNV:           out.debug << "createTensorLayout"; break;
1046
0
    case EOpTensorLayoutSetBlockSizeNV:     out.debug << "setBlockSize"; break;
1047
0
    case EOpTensorLayoutSetDimensionNV:     out.debug << "setDimension"; break;
1048
0
    case EOpTensorLayoutSetStrideNV:        out.debug << "setStride"; break;
1049
0
    case EOpTensorLayoutSliceNV:            out.debug << "slice"; break;
1050
0
    case EOpTensorLayoutSetClampValueNV:    out.debug << "setClampValue"; break;
1051
0
    case EOpCreateTensorViewNV:             out.debug << "createTensorView"; break;
1052
0
    case EOpTensorViewSetDimensionNV:       out.debug << "setTensorViewDimensions"; break;
1053
0
    case EOpTensorViewSetStrideNV:          out.debug << "setTensorViewStride"; break;
1054
0
    case EOpTensorViewSetClipNV:            out.debug << "clipTensorView"; break;
1055
1056
0
    default: out.debug.message(EPrefixError, "Bad aggregation op");
1057
0
    }
1058
1059
0
    if (node->getOp() != EOpSequence && node->getOp() != EOpScope && node->getOp() != EOpParameters)
1060
0
        out.debug << " (" << node->getCompleteString() << ")";
1061
1062
0
    out.debug << "\n";
1063
1064
0
    return true;
1065
0
}
1066
1067
bool TOutputTraverser::visitSelection(TVisit /* visit */, TIntermSelection* node)
1068
0
{
1069
0
    TInfoSink& out = infoSink;
1070
1071
0
    OutputTreeText(out, node, depth);
1072
1073
0
    out.debug << "Test condition and select";
1074
0
    out.debug << " (" << node->getCompleteString() << ")";
1075
1076
0
    if (node->getShortCircuit() == false)
1077
0
        out.debug << ": no shortcircuit";
1078
0
    if (node->getFlatten())
1079
0
        out.debug << ": Flatten";
1080
0
    if (node->getDontFlatten())
1081
0
        out.debug << ": DontFlatten";
1082
0
    out.debug << "\n";
1083
1084
0
    ++depth;
1085
1086
0
    OutputTreeText(out, node, depth);
1087
0
    out.debug << "Condition\n";
1088
0
    node->getCondition()->traverse(this);
1089
1090
0
    OutputTreeText(out, node, depth);
1091
0
    if (node->getTrueBlock()) {
1092
0
        out.debug << "true case\n";
1093
0
        node->getTrueBlock()->traverse(this);
1094
0
    } else
1095
0
        out.debug << "true case is null\n";
1096
1097
0
    if (node->getFalseBlock()) {
1098
0
        OutputTreeText(out, node, depth);
1099
0
        out.debug << "false case\n";
1100
0
        node->getFalseBlock()->traverse(this);
1101
0
    }
1102
1103
0
    --depth;
1104
1105
0
    return false;
1106
0
}
1107
1108
// Print infinities and NaNs, and numbers in a portable way.
1109
// Goals:
1110
//   - portable (across IEEE 754 platforms)
1111
//   - shows all possible IEEE values
1112
//   - shows simple numbers in a simple way, e.g., no leading/trailing 0s
1113
//   - shows all digits, no premature rounding
1114
static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraOutput extra)
1115
0
{
1116
0
    if (std::isinf(value)) {
1117
0
        if (value < 0)
1118
0
            out.debug << "-1.#INF";
1119
0
        else
1120
0
            out.debug << "+1.#INF";
1121
0
    } else if (std::isnan(value))
1122
0
        out.debug << "1.#IND";
1123
0
    else {
1124
0
        const int maxSize = 340;
1125
0
        char buf[maxSize];
1126
0
        const char* format = "%f";
1127
0
        if (fabs(value) > 0.0 && (fabs(value) < 1e-5 || fabs(value) > 1e12))
1128
0
            format = "%-.13e";
1129
0
        int len = snprintf(buf, maxSize, format, value);
1130
0
        assert(len < maxSize);
1131
1132
        // remove a leading zero in the 100s slot in exponent; it is not portable
1133
        // pattern:   XX...XXXe+0XX or XX...XXXe-0XX
1134
0
        if (len > 5) {
1135
0
            if (buf[len-5] == 'e' && (buf[len-4] == '+' || buf[len-4] == '-') && buf[len-3] == '0') {
1136
0
                buf[len-3] = buf[len-2];
1137
0
                buf[len-2] = buf[len-1];
1138
0
                buf[len-1] = '\0';
1139
0
            }
1140
0
        }
1141
1142
0
        out.debug << buf;
1143
1144
0
        switch (extra) {
1145
0
        case TOutputTraverser::BinaryDoubleOutput:
1146
0
        {
1147
0
            uint64_t b;
1148
0
            static_assert(sizeof(b) == sizeof(value), "sizeof(uint64_t) != sizeof(double)");
1149
0
            memcpy(&b, &value, sizeof(b));
1150
1151
0
            out.debug << " : ";
1152
0
            for (size_t i = 0; i < 8 * sizeof(value); ++i, ++b) {
1153
0
                out.debug << ((b & 0x8000000000000000) != 0 ? "1" : "0");
1154
0
                b <<= 1;
1155
0
            }
1156
0
            break;
1157
0
        }
1158
0
        default:
1159
0
            break;
1160
0
        }
1161
0
    }
1162
0
}
1163
1164
static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstUnionArray& constUnion,
1165
    TOutputTraverser::EExtraOutput extra, int depth)
1166
0
{
1167
0
    int size = node->getType().computeNumComponents();
1168
1169
0
    for (int i = 0; i < size; i++) {
1170
0
        OutputTreeText(out, node, depth);
1171
0
        switch (constUnion[i].getType()) {
1172
0
        case EbtBool:
1173
0
            if (constUnion[i].getBConst())
1174
0
                out.debug << "true";
1175
0
            else
1176
0
                out.debug << "false";
1177
1178
0
            out.debug << " (" << "const bool" << ")";
1179
1180
0
            out.debug << "\n";
1181
0
            break;
1182
0
        case EbtFloat:
1183
0
        case EbtDouble:
1184
0
        case EbtFloat16:
1185
0
        case EbtBFloat16:
1186
0
        case EbtFloatE5M2:
1187
0
        case EbtFloatE4M3:
1188
0
            OutputDouble(out, constUnion[i].getDConst(), extra);
1189
0
            out.debug << "\n";
1190
0
            break;
1191
0
        case EbtInt8:
1192
0
            {
1193
0
                const int maxSize = 300;
1194
0
                char buf[maxSize];
1195
0
                snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI8Const(), "const int8_t");
1196
1197
0
                out.debug << buf << "\n";
1198
0
            }
1199
0
            break;
1200
0
        case EbtUint8:
1201
0
            {
1202
0
                const int maxSize = 300;
1203
0
                char buf[maxSize];
1204
0
                snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU8Const(), "const uint8_t");
1205
1206
0
                out.debug << buf << "\n";
1207
0
            }
1208
0
            break;
1209
0
        case EbtInt16:
1210
0
            {
1211
0
                const int maxSize = 300;
1212
0
                char buf[maxSize];
1213
0
                snprintf(buf, maxSize, "%d (%s)", constUnion[i].getI16Const(), "const int16_t");
1214
1215
0
                out.debug << buf << "\n";
1216
0
            }
1217
0
            break;
1218
0
        case EbtUint16:
1219
0
            {
1220
0
                const int maxSize = 300;
1221
0
                char buf[maxSize];
1222
0
                snprintf(buf, maxSize, "%u (%s)", constUnion[i].getU16Const(), "const uint16_t");
1223
1224
0
                out.debug << buf << "\n";
1225
0
            }
1226
0
            break;
1227
0
        case EbtInt:
1228
0
            {
1229
0
                const int maxSize = 300;
1230
0
                char buf[maxSize];
1231
0
                snprintf(buf, maxSize, "%d (%s)", constUnion[i].getIConst(), "const int");
1232
1233
0
                out.debug << buf << "\n";
1234
0
            }
1235
0
            break;
1236
0
        case EbtUint:
1237
0
            {
1238
0
                const int maxSize = 300;
1239
0
                char buf[maxSize];
1240
0
                snprintf(buf, maxSize, "%u (%s)", constUnion[i].getUConst(), "const uint");
1241
1242
0
                out.debug << buf << "\n";
1243
0
            }
1244
0
            break;
1245
0
        case EbtInt64:
1246
0
            {
1247
0
                const int maxSize = 300;
1248
0
                char buf[maxSize];
1249
0
                snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t");
1250
1251
0
                out.debug << buf << "\n";
1252
0
            }
1253
0
            break;
1254
0
        case EbtUint64:
1255
0
            {
1256
0
                const int maxSize = 300;
1257
0
                char buf[maxSize];
1258
0
                snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t");
1259
1260
0
                out.debug << buf << "\n";
1261
0
            }
1262
0
            break;
1263
0
        case EbtString:
1264
0
            out.debug << "\"" << constUnion[i].getSConst()->c_str() << "\"\n";
1265
0
            break;
1266
0
        default:
1267
0
            out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc());
1268
0
            break;
1269
0
        }
1270
0
    }
1271
0
}
1272
1273
void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node)
1274
0
{
1275
0
    OutputTreeText(infoSink, node, depth);
1276
0
    infoSink.debug << "Constant:\n";
1277
1278
0
    OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1);
1279
0
}
1280
1281
void TOutputTraverser::visitSymbol(TIntermSymbol* node)
1282
0
{
1283
0
    OutputTreeText(infoSink, node, depth);
1284
1285
0
    infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n";
1286
1287
0
    if (! node->getConstArray().empty())
1288
0
        OutputConstantUnion(infoSink, node, node->getConstArray(), extraOutput, depth + 1);
1289
0
    else if (node->getConstSubtree()) {
1290
0
        incrementDepth(node);
1291
0
        node->getConstSubtree()->traverse(this);
1292
0
        decrementDepth();
1293
0
    }
1294
0
}
1295
1296
bool TOutputTraverser::visitLoop(TVisit /* visit */, TIntermLoop* node)
1297
0
{
1298
0
    TInfoSink& out = infoSink;
1299
1300
0
    OutputTreeText(out, node, depth);
1301
1302
0
    out.debug << "Loop with condition ";
1303
0
    if (! node->testFirst())
1304
0
        out.debug << "not ";
1305
0
    out.debug << "tested first";
1306
1307
0
    if (node->getUnroll())
1308
0
        out.debug << ": Unroll";
1309
0
    if (node->getDontUnroll())
1310
0
        out.debug << ": DontUnroll";
1311
0
    if (node->getLoopDependency()) {
1312
0
        out.debug << ": Dependency ";
1313
0
        out.debug << node->getLoopDependency();
1314
0
    }
1315
0
    out.debug << "\n";
1316
1317
0
    ++depth;
1318
1319
0
    OutputTreeText(infoSink, node, depth);
1320
0
    if (node->getTest()) {
1321
0
        out.debug << "Loop Condition\n";
1322
0
        node->getTest()->traverse(this);
1323
0
    } else
1324
0
        out.debug << "No loop condition\n";
1325
1326
0
    OutputTreeText(infoSink, node, depth);
1327
0
    if (node->getBody()) {
1328
0
        out.debug << "Loop Body\n";
1329
0
        node->getBody()->traverse(this);
1330
0
    } else
1331
0
        out.debug << "No loop body\n";
1332
1333
0
    if (node->getTerminal()) {
1334
0
        OutputTreeText(infoSink, node, depth);
1335
0
        out.debug << "Loop Terminal Expression\n";
1336
0
        node->getTerminal()->traverse(this);
1337
0
    }
1338
1339
0
    --depth;
1340
1341
0
    return false;
1342
0
}
1343
1344
bool TOutputTraverser::visitBranch(TVisit /* visit*/, TIntermBranch* node)
1345
0
{
1346
0
    TInfoSink& out = infoSink;
1347
1348
0
    OutputTreeText(out, node, depth);
1349
1350
0
    switch (node->getFlowOp()) {
1351
0
    case EOpKill:                   out.debug << "Branch: Kill";                  break;
1352
0
    case EOpTerminateInvocation:    out.debug << "Branch: TerminateInvocation";   break;
1353
0
    case EOpIgnoreIntersectionKHR:  out.debug << "Branch: IgnoreIntersectionKHR"; break;
1354
0
    case EOpTerminateRayKHR:        out.debug << "Branch: TerminateRayKHR";       break;
1355
0
    case EOpBreak:                  out.debug << "Branch: Break";                 break;
1356
0
    case EOpContinue:               out.debug << "Branch: Continue";              break;
1357
0
    case EOpReturn:                 out.debug << "Branch: Return";                break;
1358
0
    case EOpCase:                   out.debug << "case: ";                        break;
1359
0
    case EOpDemote:                 out.debug << "Demote";                        break;
1360
0
    case EOpDefault:                out.debug << "default: ";                     break;
1361
0
    default:                        out.debug << "Branch: Unknown Branch";        break;
1362
0
    }
1363
1364
0
    if (node->getExpression()) {
1365
0
        out.debug << " with expression\n";
1366
0
        ++depth;
1367
0
        node->getExpression()->traverse(this);
1368
0
        --depth;
1369
0
    } else
1370
0
        out.debug << "\n";
1371
1372
0
    return false;
1373
0
}
1374
1375
bool TOutputTraverser::visitSwitch(TVisit /* visit */, TIntermSwitch* node)
1376
0
{
1377
0
    TInfoSink& out = infoSink;
1378
1379
0
    OutputTreeText(out, node, depth);
1380
0
    out.debug << "switch";
1381
1382
0
    if (node->getFlatten())
1383
0
        out.debug << ": Flatten";
1384
0
    if (node->getDontFlatten())
1385
0
        out.debug << ": DontFlatten";
1386
0
    out.debug << "\n";
1387
1388
0
    OutputTreeText(out, node, depth);
1389
0
    out.debug << "condition\n";
1390
0
    ++depth;
1391
0
    node->getCondition()->traverse(this);
1392
1393
0
    --depth;
1394
0
    OutputTreeText(out, node, depth);
1395
0
    out.debug << "body\n";
1396
0
    ++depth;
1397
0
    node->getBody()->traverse(this);
1398
1399
0
    --depth;
1400
1401
0
    return false;
1402
0
}
1403
1404
bool TOutputTraverser::visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* node)
1405
0
{
1406
0
    TInfoSink& out = infoSink;
1407
1408
0
    OutputTreeText(out, node, depth);
1409
1410
0
    out.debug << "VarDecl: " << node->getDeclSymbol()->getName() << '\n';
1411
0
    return true;
1412
0
}
1413
1414
//
1415
// This function is the one to call externally to start the traversal.
1416
// Individual functions can be initialized to 0 to skip processing of that
1417
// type of node.  It's children will still be processed.
1418
//
1419
void TIntermediate::output(TInfoSink& infoSink, bool tree)
1420
0
{
1421
0
    infoSink.debug << "Shader version: " << version << "\n";
1422
0
    if (requestedExtensions.size() > 0) {
1423
0
        for (auto extIt = requestedExtensions.begin(); extIt != requestedExtensions.end(); ++extIt)
1424
0
            infoSink.debug << "Requested " << *extIt << "\n";
1425
0
    }
1426
1427
0
    if (xfbMode)
1428
0
        infoSink.debug << "in xfb mode\n";
1429
1430
0
    if (getSubgroupUniformControlFlow())
1431
0
        infoSink.debug << "subgroup_uniform_control_flow\n";
1432
1433
0
    if (getMaximallyReconverges())
1434
0
        infoSink.debug << "maximally_reconverges\n";
1435
1436
0
    switch (language) {
1437
0
    case EShLangVertex:
1438
0
        break;
1439
1440
0
    case EShLangTessControl:
1441
0
        infoSink.debug << "vertices = " << vertices << "\n";
1442
1443
0
        if (inputPrimitive != ElgNone)
1444
0
            infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n";
1445
0
        if (vertexSpacing != EvsNone)
1446
0
            infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n";
1447
0
        if (vertexOrder != EvoNone)
1448
0
            infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n";
1449
0
        break;
1450
1451
0
    case EShLangTessEvaluation:
1452
0
        infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n";
1453
0
        infoSink.debug << "vertex spacing = " << TQualifier::getVertexSpacingString(vertexSpacing) << "\n";
1454
0
        infoSink.debug << "triangle order = " << TQualifier::getVertexOrderString(vertexOrder) << "\n";
1455
0
        if (pointMode)
1456
0
            infoSink.debug << "using point mode\n";
1457
0
        break;
1458
1459
0
    case EShLangGeometry:
1460
0
        infoSink.debug << "invocations = " << invocations << "\n";
1461
0
        infoSink.debug << "max_vertices = " << vertices << "\n";
1462
0
        infoSink.debug << "input primitive = " << TQualifier::getGeometryString(inputPrimitive) << "\n";
1463
0
        infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
1464
0
        break;
1465
1466
0
    case EShLangFragment:
1467
0
        if (pixelCenterInteger)
1468
0
            infoSink.debug << "gl_FragCoord pixel center is integer\n";
1469
0
        if (originUpperLeft)
1470
0
            infoSink.debug << "gl_FragCoord origin is upper left\n";
1471
0
        if (earlyFragmentTests)
1472
0
            infoSink.debug << "using early_fragment_tests\n";
1473
0
        if (postDepthCoverage)
1474
0
            infoSink.debug << "using post_depth_coverage\n";
1475
0
        if (nonCoherentColorAttachmentReadEXT)
1476
0
            infoSink.debug << "using non_coherent_color_attachment_readEXT\n";
1477
0
        if (nonCoherentDepthAttachmentReadEXT)
1478
0
            infoSink.debug << "using non_coherent_depth_attachment_readEXT\n";
1479
0
        if (nonCoherentStencilAttachmentReadEXT)
1480
0
            infoSink.debug << "using non_coherent_stencil_attachment_readEXT\n";
1481
0
        if (nonCoherentTileAttachmentReadQCOM)
1482
0
            infoSink.debug << "using non_coherent_attachment_readQCOM\n";
1483
0
        if (depthLayout != EldNone)
1484
0
            infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n";
1485
0
        if (blendEquations != 0) {
1486
0
            infoSink.debug << "using";
1487
            // blendEquations is a mask, decode it
1488
0
            for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) {
1489
0
                if (blendEquations & (1 << be))
1490
0
                    infoSink.debug << " " << TQualifier::getBlendEquationString(be);
1491
0
            }
1492
0
            infoSink.debug << "\n";
1493
0
        }
1494
0
        if (interlockOrdering != EioNone)
1495
0
            infoSink.debug << "interlock ordering = " << TQualifier::getInterlockOrderingString(interlockOrdering) << "\n";
1496
0
        break;
1497
1498
0
    case EShLangMesh:
1499
0
        infoSink.debug << "max_vertices = " << vertices << "\n";
1500
0
        infoSink.debug << "max_primitives = " << primitives << "\n";
1501
0
        infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
1502
0
        [[fallthrough]];
1503
0
    case EShLangTask:
1504
        // Fall through
1505
0
    case EShLangCompute:
1506
0
        infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n";
1507
0
        {
1508
0
            if (localSizeSpecId[0] != TQualifier::layoutNotSet ||
1509
0
                localSizeSpecId[1] != TQualifier::layoutNotSet ||
1510
0
                localSizeSpecId[2] != TQualifier::layoutNotSet) {
1511
0
                infoSink.debug << "local_size ids = (" <<
1512
0
                    localSizeSpecId[0] << ", " <<
1513
0
                    localSizeSpecId[1] << ", " <<
1514
0
                    localSizeSpecId[2] << ")\n";
1515
0
            }
1516
0
        }
1517
0
        if (nonCoherentTileAttachmentReadQCOM)
1518
0
            infoSink.debug << "using non_coherent_attachment_readQCOM\n";
1519
0
        if (isTileShadingRateQCOMSet()) {
1520
0
            infoSink.debug << "shading_rateQCOM = (" << tileShadingRateQCOM[0] << ", "
1521
0
                                                     << tileShadingRateQCOM[1] << ", "
1522
0
                                                     << tileShadingRateQCOM[2] << ")\n";
1523
0
        }
1524
0
        break;
1525
1526
0
    default:
1527
0
        break;
1528
0
    }
1529
1530
0
    if (treeRoot == nullptr || ! tree)
1531
0
        return;
1532
1533
0
    TOutputTraverser it(infoSink);
1534
0
    if (getBinaryDoubleOutput())
1535
0
        it.setDoubleOutput(TOutputTraverser::BinaryDoubleOutput);
1536
0
    treeRoot->traverse(&it);
1537
0
}
1538
1539
} // end namespace glslang