zenilib: zenilib/jni/external/angle/src/compiler/intermediate.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
intermediate.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6
7 //
8 // Definition of the in-memory high-level intermediate representation
9 // of shaders. This is a tree that parser creates.
10 //
11 // Nodes in the tree are defined as a hierarchy of classes derived from
12 // TIntermNode. Each is a node in a tree. There is no preset branching factor;
13 // each node can have it's own type of list of children.
14 //
15
16 #ifndef __INTERMEDIATE_H
17 #define __INTERMEDIATE_H
18
19 #include "GLSLANG/ShaderLang.h"
20
21 #include <algorithm>
22 #include "compiler/Common.h"
23 #include "compiler/Types.h"
24 #include "compiler/ConstantUnion.h"
25
26 //
27 // Operators used by the high-level (parse tree) representation.
28 //
29 enum TOperator {
30 EOpNull, // if in a node, should only mean a node is still being built
31 EOpSequence, // denotes a list of statements, or parameters, etc.
32 EOpFunctionCall,
33 EOpFunction, // For function definition
34 EOpParameters, // an aggregate listing the parameters to a function
35
36 EOpDeclaration,
37 EOpPrototype,
38
39 //
40 // Unary operators
41 //
42
43 EOpNegative,
44 EOpLogicalNot,
45 EOpVectorLogicalNot,
46
47 EOpPostIncrement,
48 EOpPostDecrement,
49 EOpPreIncrement,
50 EOpPreDecrement,
51
52 EOpConvIntToBool,
53 EOpConvFloatToBool,
54 EOpConvBoolToFloat,
55 EOpConvIntToFloat,
56 EOpConvFloatToInt,
57 EOpConvBoolToInt,
58
59 //
60 // binary operations
61 //
62
63 EOpAdd,
64 EOpSub,
65 EOpMul,
66 EOpDiv,
67 EOpEqual,
68 EOpNotEqual,
69 EOpVectorEqual,
70 EOpVectorNotEqual,
71 EOpLessThan,
72 EOpGreaterThan,
73 EOpLessThanEqual,
74 EOpGreaterThanEqual,
75 EOpComma,
76
77 EOpVectorTimesScalar,
78 EOpVectorTimesMatrix,
79 EOpMatrixTimesVector,
80 EOpMatrixTimesScalar,
81
82 EOpLogicalOr,
83 EOpLogicalXor,
84 EOpLogicalAnd,
85
86 EOpIndexDirect,
87 EOpIndexIndirect,
88 EOpIndexDirectStruct,
89
90 EOpVectorSwizzle,
91
92 //
93 // Built-in functions potentially mapped to operators
94 //
95
96 EOpRadians,
97 EOpDegrees,
98 EOpSin,
99 EOpCos,
100 EOpTan,
101 EOpAsin,
102 EOpAcos,
103 EOpAtan,
104
105 EOpPow,
106 EOpExp,
107 EOpLog,
108 EOpExp2,
109 EOpLog2,
110 EOpSqrt,
111 EOpInverseSqrt,
112
113 EOpAbs,
114 EOpSign,
115 EOpFloor,
116 EOpCeil,
117 EOpFract,
118 EOpMod,
119 EOpMin,
120 EOpMax,
121 EOpClamp,
122 EOpMix,
123 EOpStep,
124 EOpSmoothStep,
125
126 EOpLength,
127 EOpDistance,
128 EOpDot,
129 EOpCross,
130 EOpNormalize,
131 EOpFaceForward,
132 EOpReflect,
133 EOpRefract,
134
135 EOpDFdx, // Fragment only, OES_standard_derivatives extension
136 EOpDFdy, // Fragment only, OES_standard_derivatives extension
137 EOpFwidth, // Fragment only, OES_standard_derivatives extension
138
139 EOpMatrixTimesMatrix,
140
141 EOpAny,
142 EOpAll,
143
144 //
145 // Branch
146 //
147
148 EOpKill, // Fragment only
149 EOpReturn,
150 EOpBreak,
151 EOpContinue,
152
153 //
154 // Constructors
155 //
156
157 EOpConstructInt,
158 EOpConstructBool,
159 EOpConstructFloat,
160 EOpConstructVec2,
161 EOpConstructVec3,
162 EOpConstructVec4,
163 EOpConstructBVec2,
164 EOpConstructBVec3,
165 EOpConstructBVec4,
166 EOpConstructIVec2,
167 EOpConstructIVec3,
168 EOpConstructIVec4,
169 EOpConstructMat2,
170 EOpConstructMat3,
171 EOpConstructMat4,
172 EOpConstructStruct,
173
174 //
175 // moves
176 //
177
178 EOpAssign,
179 EOpInitialize,
180 EOpAddAssign,
181 EOpSubAssign,
182 EOpMulAssign,
183 EOpVectorTimesMatrixAssign,
184 EOpVectorTimesScalarAssign,
185 EOpMatrixTimesScalarAssign,
186 EOpMatrixTimesMatrixAssign,
187 EOpDivAssign
188 };
189
190 extern const char* getOperatorString(TOperator op);
191
192 class TIntermTraverser;
193 class TIntermAggregate;
194 class TIntermBinary;
195 class TIntermUnary;
196 class TIntermConstantUnion;
197 class TIntermSelection;
198 class TIntermTyped;
199 class TIntermSymbol;
200 class TIntermLoop;
201 class TInfoSink;
202
203 //
204 // Base class for the tree nodes
205 //
206 class TIntermNode {
207 public:
208 POOL_ALLOCATOR_NEW_DELETE();
209 TIntermNode() {
210 // TODO: Move this to TSourceLoc constructor
211 // after getting rid of TPublicType.
212 line.first_file = line.last_file = 0;
213 line.first_line = line.last_line = 0;
214 }
215 virtual ~TIntermNode() { }
216
217 const TSourceLoc& getLine() const { return line; }
218 void setLine(const TSourceLoc& l) { line = l; }
219
220 virtual void traverse(TIntermTraverser*) = 0;
221 virtual TIntermTyped* getAsTyped() { return 0; }
222 virtual TIntermConstantUnion* getAsConstantUnion() { return 0; }
223 virtual TIntermAggregate* getAsAggregate() { return 0; }
224 virtual TIntermBinary* getAsBinaryNode() { return 0; }
225 virtual TIntermUnary* getAsUnaryNode() { return 0; }
226 virtual TIntermSelection* getAsSelectionNode() { return 0; }
227 virtual TIntermSymbol* getAsSymbolNode() { return 0; }
228 virtual TIntermLoop* getAsLoopNode() { return 0; }
229
230 protected:
231 TSourceLoc line;
232 };
233
234 //
235 // This is just to help yacc.
236 //
237 struct TIntermNodePair {
238 TIntermNode* node1;
239 TIntermNode* node2;
240 };
241
242 //
243 // Intermediate class for nodes that have a type.
244 //
245 class TIntermTyped : public TIntermNode {
246 public:
247 TIntermTyped(const TType& t) : type(t) { }
248 virtual TIntermTyped* getAsTyped() { return this; }
249
250 void setType(const TType& t) { type = t; }
251 const TType& getType() const { return type; }
252 TType* getTypePointer() { return &type; }
253
254 TBasicType getBasicType() const { return type.getBasicType(); }
255 TQualifier getQualifier() const { return type.getQualifier(); }
256 TPrecision getPrecision() const { return type.getPrecision(); }
257 int getNominalSize() const { return type.getNominalSize(); }
258
259 bool isMatrix() const { return type.isMatrix(); }
260 bool isArray() const { return type.isArray(); }
261 bool isVector() const { return type.isVector(); }
262 bool isScalar() const { return type.isScalar(); }
263 const char* getBasicString() const { return type.getBasicString(); }
264 const char* getQualifierString() const { return type.getQualifierString(); }
265 TString getCompleteString() const { return type.getCompleteString(); }
266
267 int totalRegisterCount() const { return type.totalRegisterCount(); }
268 int elementRegisterCount() const { return type.elementRegisterCount(); }
269 int getArraySize() const { return type.getArraySize(); }
270
271 protected:
272 TType type;
273 };
274
275 //
276 // Handle for, do-while, and while loops.
277 //
278 enum TLoopType {
279 ELoopFor,
280 ELoopWhile,
281 ELoopDoWhile
282 };
283
284 class TIntermLoop : public TIntermNode {
285 public:
286 TIntermLoop(TLoopType aType,
287 TIntermNode *aInit, TIntermTyped* aCond, TIntermTyped* aExpr,
288 TIntermNode* aBody) :
289 type(aType),
290 init(aInit),
291 cond(aCond),
292 expr(aExpr),
293 body(aBody),
294 unrollFlag(false) { }
295
296 virtual TIntermLoop* getAsLoopNode() { return this; }
297 virtual void traverse(TIntermTraverser*);
298
299 TLoopType getType() const { return type; }
300 TIntermNode* getInit() { return init; }
301 TIntermTyped* getCondition() { return cond; }
302 TIntermTyped* getExpression() { return expr; }
303 TIntermNode* getBody() { return body; }
304
305 void setUnrollFlag(bool flag) { unrollFlag = flag; }
306 bool getUnrollFlag() { return unrollFlag; }
307
308 protected:
309 TLoopType type;
310 TIntermNode* init; // for-loop initialization
311 TIntermTyped* cond; // loop exit condition
312 TIntermTyped* expr; // for-loop expression
313 TIntermNode* body; // loop body
314
315 bool unrollFlag; // Whether the loop should be unrolled or not.
316 };
317
318 //
319 // Handle break, continue, return, and kill.
320 //
321 class TIntermBranch : public TIntermNode {
322 public:
323 TIntermBranch(TOperator op, TIntermTyped* e) :
324 flowOp(op),
325 expression(e) { }
326
327 virtual void traverse(TIntermTraverser*);
328
329 TOperator getFlowOp() { return flowOp; }
330 TIntermTyped* getExpression() { return expression; }
331
332 protected:
333 TOperator flowOp;
334 TIntermTyped* expression; // non-zero except for "return exp;" statements
335 };
336
337 //
338 // Nodes that correspond to symbols or constants in the source code.
339 //
340 class TIntermSymbol : public TIntermTyped {
341 public:
342 // if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from
343 // per process globalpoolallocator, then it causes increased memory usage per compile
344 // it is essential to use "symbol = sym" to assign to symbol
345 TIntermSymbol(int i, const TString& sym, const TType& t) :
346 TIntermTyped(t), id(i) { symbol = sym; originalSymbol = sym; }
347
348 int getId() const { return id; }
349 const TString& getSymbol() const { return symbol; }
350
351 void setId(int newId) { id = newId; }
352 void setSymbol(const TString& sym) { symbol = sym; }
353
354 const TString& getOriginalSymbol() const { return originalSymbol; }
355
356 virtual void traverse(TIntermTraverser*);
357 virtual TIntermSymbol* getAsSymbolNode() { return this; }
358
359 protected:
360 int id;
361 TString symbol;
362 TString originalSymbol;
363 };
364
365 class TIntermConstantUnion : public TIntermTyped {
366 public:
367 TIntermConstantUnion(ConstantUnion *unionPointer, const TType& t) : TIntermTyped(t), unionArrayPointer(unionPointer) { }
368
369 ConstantUnion* getUnionArrayPointer() const { return unionArrayPointer; }
370
371 int getIConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getIConst() : 0; }
372 float getFConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getFConst() : 0.0f; }
373 bool getBConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getBConst() : false; }
374
375 virtual TIntermConstantUnion* getAsConstantUnion() { return this; }
376 virtual void traverse(TIntermTraverser*);
377
378 TIntermTyped* fold(TOperator, TIntermTyped*, TInfoSink&);
379
380 protected:
381 ConstantUnion *unionArrayPointer;
382 };
383
384 //
385 // Intermediate class for node types that hold operators.
386 //
387 class TIntermOperator : public TIntermTyped {
388 public:
389 TOperator getOp() const { return op; }
390 void setOp(TOperator o) { op = o; }
391
392 bool modifiesState() const;
393 bool isConstructor() const;
394
395 protected:
396 TIntermOperator(TOperator o) : TIntermTyped(TType(EbtFloat, EbpUndefined)), op(o) {}
397 TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o) {}
398 TOperator op;
399 };
400
401 //
402 // Nodes for all the basic binary math operators.
403 //
404 class TIntermBinary : public TIntermOperator {
405 public:
406 TIntermBinary(TOperator o) : TIntermOperator(o), addIndexClamp(false) {}
407
408 virtual TIntermBinary* getAsBinaryNode() { return this; }
409 virtual void traverse(TIntermTraverser*);
410
411 void setLeft(TIntermTyped* n) { left = n; }
412 void setRight(TIntermTyped* n) { right = n; }
413 TIntermTyped* getLeft() const { return left; }
414 TIntermTyped* getRight() const { return right; }
415 bool promote(TInfoSink&);
416
417 void setAddIndexClamp() { addIndexClamp = true; }
418 bool getAddIndexClamp() { return addIndexClamp; }
419
420 protected:
421 TIntermTyped* left;
422 TIntermTyped* right;
423
424 // If set to true, wrap any EOpIndexIndirect with a clamp to bounds.
425 bool addIndexClamp;
426 };
427
428 //
429 // Nodes for unary math operators.
430 //
431 class TIntermUnary : public TIntermOperator {
432 public:
433 TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0), useEmulatedFunction(false) {}
434 TIntermUnary(TOperator o) : TIntermOperator(o), operand(0), useEmulatedFunction(false) {}
435
436 virtual void traverse(TIntermTraverser*);
437 virtual TIntermUnary* getAsUnaryNode() { return this; }
438
439 void setOperand(TIntermTyped* o) { operand = o; }
440 TIntermTyped* getOperand() { return operand; }
441 bool promote(TInfoSink&);
442
443 void setUseEmulatedFunction() { useEmulatedFunction = true; }
444 bool getUseEmulatedFunction() { return useEmulatedFunction; }
445
446 protected:
447 TIntermTyped* operand;
448
449 // If set to true, replace the built-in function call with an emulated one
450 // to work around driver bugs.
451 bool useEmulatedFunction;
452 };
453
454 typedef TVector<TIntermNode*> TIntermSequence;
455 typedef TVector<int> TQualifierList;
456
457 //
458 // Nodes that operate on an arbitrary sized set of children.
459 //
460 class TIntermAggregate : public TIntermOperator {
461 public:
462 TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), useEmulatedFunction(false) { }
463 TIntermAggregate(TOperator o) : TIntermOperator(o), useEmulatedFunction(false) { }
464 ~TIntermAggregate() { }
465
466 virtual TIntermAggregate* getAsAggregate() { return this; }
467 virtual void traverse(TIntermTraverser*);
468
469 TIntermSequence& getSequence() { return sequence; }
470
471 void setName(const TString& n) { name = n; }
472 const TString& getName() const { return name; }
473
474 void setUserDefined() { userDefined = true; }
475 bool isUserDefined() const { return userDefined; }
476
477 void setOptimize(bool o) { optimize = o; }
478 bool getOptimize() { return optimize; }
479 void setDebug(bool d) { debug = d; }
480 bool getDebug() { return debug; }
481
482 void setUseEmulatedFunction() { useEmulatedFunction = true; }
483 bool getUseEmulatedFunction() { return useEmulatedFunction; }
484
485 protected:
486 TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
487 TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
488 TIntermSequence sequence;
489 TString name;
490 bool userDefined; // used for user defined function names
491
492 bool optimize;
493 bool debug;
494
495 // If set to true, replace the built-in function call with an emulated one
496 // to work around driver bugs.
497 bool useEmulatedFunction;
498 };
499
500 //
501 // For if tests. Simplified since there is no switch statement.
502 //
503 class TIntermSelection : public TIntermTyped {
504 public:
505 TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) :
506 TIntermTyped(TType(EbtVoid, EbpUndefined)), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
507 TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) :
508 TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
509
510 virtual void traverse(TIntermTraverser*);
511
512 bool usesTernaryOperator() const { return getBasicType() != EbtVoid; }
513 TIntermNode* getCondition() const { return condition; }
514 TIntermNode* getTrueBlock() const { return trueBlock; }
515 TIntermNode* getFalseBlock() const { return falseBlock; }
516 TIntermSelection* getAsSelectionNode() { return this; }
517
518 protected:
519 TIntermTyped* condition;
520 TIntermNode* trueBlock;
521 TIntermNode* falseBlock;
522 };
523
524 enum Visit
525 {
526 PreVisit,
527 InVisit,
528 PostVisit
529 };
530
531 //
532 // For traversing the tree. User should derive from this,
533 // put their traversal specific data in it, and then pass
534 // it to a Traverse method.
535 //
536 // When using this, just fill in the methods for nodes you want visited.
537 // Return false from a pre-visit to skip visiting that node's subtree.
538 //
539 class TIntermTraverser
540 {
541 public:
542 POOL_ALLOCATOR_NEW_DELETE();
543 TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false) :
544 preVisit(preVisit),
545 inVisit(inVisit),
546 postVisit(postVisit),
547 rightToLeft(rightToLeft),
548 depth(0),
549 maxDepth(0) {}
550 virtual ~TIntermTraverser() {};
551
552 virtual void visitSymbol(TIntermSymbol*) {}
553 virtual void visitConstantUnion(TIntermConstantUnion*) {}
554 virtual bool visitBinary(Visit visit, TIntermBinary*) {return true;}
555 virtual bool visitUnary(Visit visit, TIntermUnary*) {return true;}
556 virtual bool visitSelection(Visit visit, TIntermSelection*) {return true;}
557 virtual bool visitAggregate(Visit visit, TIntermAggregate*) {return true;}
558 virtual bool visitLoop(Visit visit, TIntermLoop*) {return true;}
559 virtual bool visitBranch(Visit visit, TIntermBranch*) {return true;}
560
561 int getMaxDepth() const {return maxDepth;}
562 void incrementDepth() {depth++; maxDepth = std::max(maxDepth, depth); }
563 void decrementDepth() {depth--;}
564
565 // Return the original name if hash function pointer is NULL;
566 // otherwise return the hashed name.
567 static TString hash(const TString& name, ShHashFunction64 hashFunction);
568
569 const bool preVisit;
570 const bool inVisit;
571 const bool postVisit;
572 const bool rightToLeft;
573
574 protected:
575 int depth;
576 int maxDepth;
577 };
578
579 #endif // __INTERMEDIATE_H
TIntermAggregate::isUserDefined
bool isUserDefined() const
Definition: intermediate.h:475
TIntermConstantUnion::TIntermConstantUnion
TIntermConstantUnion(ConstantUnion *unionPointer, const TType &t)
Definition: intermediate.h:367
TOperator
TOperator
Definition: intermediate.h:29
EOpStep
Definition: intermediate.h:123
EOpConvBoolToInt
Definition: intermediate.h:57
TIntermConstantUnion::unionArrayPointer
ConstantUnion * unionArrayPointer
Definition: intermediate.h:381
TIntermSelection::getAsSelectionNode
TIntermSelection * getAsSelectionNode()
Definition: intermediate.h:516
TIntermTyped::elementRegisterCount
int elementRegisterCount() const
Definition: intermediate.h:268
EOpFaceForward
Definition: intermediate.h:131
condition
GLenum condition
Definition: gl2ext.h:1403
EOpMatrixTimesScalar
Definition: intermediate.h:80
EOpLogicalNot
Definition: intermediate.h:44
EOpConstructBVec3
Definition: intermediate.h:164
TIntermBinary::getAsBinaryNode
virtual TIntermBinary * getAsBinaryNode()
Definition: intermediate.h:408
EOpPow
Definition: intermediate.h:105
Visit
Visit
Definition: intermediate.h:524
TIntermOperator::getOp
TOperator getOp() const
Definition: intermediate.h:389
EOpConstructVec2
Definition: intermediate.h:160
TQualifier
TQualifier
Definition: BaseTypes.h:81
TIntermBranch::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:277
EOpRadians
Definition: intermediate.h:96
TIntermAggregate::TIntermAggregate
TIntermAggregate(TOperator o)
Definition: intermediate.h:463
ConstantUnion::getBConst
bool getBConst()
Definition: ConstantUnion.h:27
EOpAny
Definition: intermediate.h:141
EOpReflect
Definition: intermediate.h:132
EOpClamp
Definition: intermediate.h:121
EOpFunctionCall
Definition: intermediate.h:32
TIntermBranch::expression
TIntermTyped * expression
Definition: intermediate.h:334
TIntermTraverser::visitAggregate
virtual bool visitAggregate(Visit visit, TIntermAggregate *)
Definition: intermediate.h:557
TIntermOperator::setOp
void setOp(TOperator o)
Definition: intermediate.h:390
EbtVoid
Definition: BaseTypes.h:38
TIntermAggregate::getSequence
TIntermSequence & getSequence()
Definition: intermediate.h:469
TIntermSelection::getTrueBlock
TIntermNode * getTrueBlock() const
Definition: intermediate.h:514
EOpDivAssign
Definition: intermediate.h:187
EOpMax
Definition: intermediate.h:120
TIntermLoop::getCondition
TIntermTyped * getCondition()
Definition: intermediate.h:301
type
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
TIntermSymbol::getOriginalSymbol
const TString & getOriginalSymbol() const
Definition: intermediate.h:354
TIntermNode::POOL_ALLOCATOR_NEW_DELETE
POOL_ALLOCATOR_NEW_DELETE()
EOpConstructIVec4
Definition: intermediate.h:168
ELoopFor
Definition: intermediate.h:279
TIntermLoop::getUnrollFlag
bool getUnrollFlag()
Definition: intermediate.h:306
EOpSub
Definition: intermediate.h:64
ConstantUnion::getIConst
int getIConst()
Definition: ConstantUnion.h:25
TIntermAggregate::setName
void setName(const TString &n)
Definition: intermediate.h:471
EOpLogicalOr
Definition: intermediate.h:82
left
GLint left
Definition: glew.h:7291
TIntermSymbol::getId
int getId() const
Definition: intermediate.h:348
TIntermBinary::getLeft
TIntermTyped * getLeft() const
Definition: intermediate.h:413
EOpSign
Definition: intermediate.h:114
EOpVectorSwizzle
Definition: intermediate.h:90
TIntermUnary::promote
bool promote(TInfoSink &)
Definition: Intermediate.cpp:805
TIntermAggregate::operator=
TIntermAggregate & operator=(const TIntermAggregate &)
EOpAtan
Definition: intermediate.h:103
TIntermAggregate::setOptimize
void setOptimize(bool o)
Definition: intermediate.h:477
TIntermNode::getAsAggregate
virtual TIntermAggregate * getAsAggregate()
Definition: intermediate.h:223
TIntermSymbol::getAsSymbolNode
virtual TIntermSymbol * getAsSymbolNode()
Definition: intermediate.h:357
EOpSmoothStep
Definition: intermediate.h:124
TIntermBranch::TIntermBranch
TIntermBranch(TOperator op, TIntermTyped *e)
Definition: intermediate.h:323
ShHashFunction64
khronos_uint64_t(* ShHashFunction64)(const char *, size_t)
Definition: ShaderLang.h:197
TIntermTraverser::getMaxDepth
int getMaxDepth() const
Definition: intermediate.h:561
TIntermBinary::right
TIntermTyped * right
Definition: intermediate.h:422
n
GLclampd n
Definition: glew.h:7287
TIntermTyped::setType
void setType(const TType &t)
Definition: intermediate.h:250
TIntermTyped::getCompleteString
TString getCompleteString() const
Definition: intermediate.h:265
EOpConstructMat4
Definition: intermediate.h:171
EOpInitialize
Definition: intermediate.h:179
TSourceLoc::last_file
int last_file
Definition: Common.h:20
TIntermBranch::getFlowOp
TOperator getFlowOp()
Definition: intermediate.h:329
ShaderLang.h
TIntermSelection::getFalseBlock
TIntermNode * getFalseBlock() const
Definition: intermediate.h:515
TIntermBranch::flowOp
TOperator flowOp
Definition: intermediate.h:333
EOpRefract
Definition: intermediate.h:133
TIntermBinary::getRight
TIntermTyped * getRight() const
Definition: intermediate.h:414
TIntermTyped::totalRegisterCount
int totalRegisterCount() const
Definition: intermediate.h:267
sym
SDL_Keycode sym
Definition: SDL_pspevents.c:51
e
return Display return Display Bool Bool int int e
Definition: SDL_x11sym.h:30
ELoopDoWhile
Definition: intermediate.h:281
EOpSequence
Definition: intermediate.h:31
EOpVectorNotEqual
Definition: intermediate.h:70
TIntermLoop::type
TLoopType type
Definition: intermediate.h:309
t
GLdouble GLdouble t
Definition: glew.h:1384
TIntermTyped::getArraySize
int getArraySize() const
Definition: intermediate.h:269
TIntermTyped::getBasicType
TBasicType getBasicType() const
Definition: intermediate.h:254
TIntermAggregate::getDebug
bool getDebug()
Definition: intermediate.h:480
EOpMatrixTimesVector
Definition: intermediate.h:79
TIntermTyped::getPrecision
TPrecision getPrecision() const
Definition: intermediate.h:256
TIntermConstantUnion::getAsConstantUnion
virtual TIntermConstantUnion * getAsConstantUnion()
Definition: intermediate.h:375
TIntermAggregate::userDefined
bool userDefined
Definition: intermediate.h:490
TIntermAggregate::debug
bool debug
Definition: intermediate.h:493
EOpVectorTimesMatrixAssign
Definition: intermediate.h:183
TIntermBinary::TIntermBinary
TIntermBinary(TOperator o)
Definition: intermediate.h:406
TIntermOperator::isConstructor
bool isConstructor() const
Definition: Intermediate.cpp:775
EOpConstructStruct
Definition: intermediate.h:172
TIntermTyped
Definition: intermediate.h:245
EOpGreaterThan
Definition: intermediate.h:72
TIntermTraverser::TIntermTraverser
TIntermTraverser(bool preVisit=true, bool inVisit=false, bool postVisit=false, bool rightToLeft=false)
Definition: intermediate.h:543
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
EOpPreIncrement
Definition: intermediate.h:49
TIntermSymbol::symbol
TString symbol
Definition: intermediate.h:361
TIntermNode::getAsBinaryNode
virtual TIntermBinary * getAsBinaryNode()
Definition: intermediate.h:224
EOpDeclaration
Definition: intermediate.h:36
EOpConstructVec3
Definition: intermediate.h:161
TIntermTraverser::incrementDepth
void incrementDepth()
Definition: intermediate.h:562
TIntermTyped::getQualifier
TQualifier getQualifier() const
Definition: intermediate.h:255
TIntermTraverser::preVisit
const bool preVisit
Definition: intermediate.h:569
d
return Display return Display Bool Bool int d
Definition: SDL_x11sym.h:30
TIntermNodePair::node2
TIntermNode * node2
Definition: intermediate.h:239
EOpLength
Definition: intermediate.h:126
Types.h
ConstantUnion.h
TIntermTraverser::decrementDepth
void decrementDepth()
Definition: intermediate.h:563
TType
Definition: Types.h:93
id
GLuint id
Definition: gl2ext.h:1142
TIntermConstantUnion::getBConst
bool getBConst(int index) const
Definition: intermediate.h:373
EOpDot
Definition: intermediate.h:128
TIntermTyped::isMatrix
bool isMatrix() const
Definition: intermediate.h:259
EOpConstructVec4
Definition: intermediate.h:162
TIntermTraverser::~TIntermTraverser
virtual ~TIntermTraverser()
Definition: intermediate.h:550
EbtFloat
Definition: BaseTypes.h:39
EbpUndefined
Definition: BaseTypes.h:16
TIntermBinary::promote
bool promote(TInfoSink &)
Definition: Intermediate.cpp:844
TIntermTraverser::visitBranch
virtual bool visitBranch(Visit visit, TIntermBranch *)
Definition: intermediate.h:559
TIntermNode::~TIntermNode
virtual ~TIntermNode()
Definition: intermediate.h:215
EOpTan
Definition: intermediate.h:100
EOpConstructIVec3
Definition: intermediate.h:167
TIntermAggregate
Definition: intermediate.h:460
TIntermNode::TIntermNode
TIntermNode()
Definition: intermediate.h:209
TIntermTyped::isScalar
bool isScalar() const
Definition: intermediate.h:262
TIntermBinary
Definition: intermediate.h:404
EOpParameters
Definition: intermediate.h:34
EOpConstructMat2
Definition: intermediate.h:169
TIntermTyped::isVector
bool isVector() const
Definition: intermediate.h:261
EOpInverseSqrt
Definition: intermediate.h:111
EOpConstructFloat
Definition: intermediate.h:159
TIntermUnary::setUseEmulatedFunction
void setUseEmulatedFunction()
Definition: intermediate.h:443
TIntermSelection
Definition: intermediate.h:503
TIntermTraverser::postVisit
const bool postVisit
Definition: intermediate.h:571
TIntermUnary::getUseEmulatedFunction
bool getUseEmulatedFunction()
Definition: intermediate.h:444
EOpCeil
Definition: intermediate.h:116
TIntermTraverser::depth
int depth
Definition: intermediate.h:575
EOpLogicalXor
Definition: intermediate.h:83
TIntermNode::setLine
void setLine(const TSourceLoc &l)
Definition: intermediate.h:218
TIntermNode::getAsConstantUnion
virtual TIntermConstantUnion * getAsConstantUnion()
Definition: intermediate.h:222
TIntermLoop::cond
TIntermTyped * cond
Definition: intermediate.h:311
TIntermAggregate::getOptimize
bool getOptimize()
Definition: intermediate.h:478
TIntermAggregate::optimize
bool optimize
Definition: intermediate.h:492
EOpDFdy
Definition: intermediate.h:136
TIntermTraverser::visitUnary
virtual bool visitUnary(Visit visit, TIntermUnary *)
Definition: intermediate.h:555
EOpIndexIndirect
Definition: intermediate.h:87
TIntermSelection::condition
TIntermTyped * condition
Definition: intermediate.h:519
TIntermNode::line
TSourceLoc line
Definition: intermediate.h:231
ConstantUnion::getFConst
float getFConst()
Definition: ConstantUnion.h:26
EOpVectorTimesScalarAssign
Definition: intermediate.h:184
EOpAdd
Definition: intermediate.h:63
TIntermTraverser::rightToLeft
const bool rightToLeft
Definition: intermediate.h:572
EOpAssign
Definition: intermediate.h:178
EOpAbs
Definition: intermediate.h:113
ELoopWhile
Definition: intermediate.h:280
EOpConstructIVec2
Definition: intermediate.h:166
TIntermTraverser::visitSymbol
virtual void visitSymbol(TIntermSymbol *)
Definition: intermediate.h:552
TIntermBranch
Definition: intermediate.h:321
TIntermTraverser::visitBinary
virtual bool visitBinary(Visit visit, TIntermBinary *)
Definition: intermediate.h:554
EOpDFdx
Definition: intermediate.h:135
EOpConvIntToBool
Definition: intermediate.h:52
TIntermTraverser::inVisit
const bool inVisit
Definition: intermediate.h:570
EOpFunction
Definition: intermediate.h:33
TIntermAggregate::getUseEmulatedFunction
bool getUseEmulatedFunction()
Definition: intermediate.h:483
TIntermNode::traverse
virtual void traverse(TIntermTraverser *)=0
TIntermSelection::getCondition
TIntermNode * getCondition() const
Definition: intermediate.h:513
EOpAsin
Definition: intermediate.h:101
TIntermNode::getLine
const TSourceLoc & getLine() const
Definition: intermediate.h:217
EOpVectorTimesMatrix
Definition: intermediate.h:78
TIntermTyped::getType
const TType & getType() const
Definition: intermediate.h:251
TIntermTraverser::hash
static TString hash(const TString &name, ShHashFunction64 hashFunction)
Definition: Intermediate.cpp:1433
TIntermNode::getAsUnaryNode
virtual TIntermUnary * getAsUnaryNode()
Definition: intermediate.h:225
TIntermLoop::getBody
TIntermNode * getBody()
Definition: intermediate.h:303
EOpFloor
Definition: intermediate.h:115
TIntermOperator
Definition: intermediate.h:387
EOpNegative
Definition: intermediate.h:43
EOpConvBoolToFloat
Definition: intermediate.h:54
TIntermConstantUnion::getUnionArrayPointer
ConstantUnion * getUnionArrayPointer() const
Definition: intermediate.h:369
TIntermAggregate::useEmulatedFunction
bool useEmulatedFunction
Definition: intermediate.h:497
TIntermBinary::setRight
void setRight(TIntermTyped *n)
Definition: intermediate.h:412
TIntermBranch::getExpression
TIntermTyped * getExpression()
Definition: intermediate.h:330
TIntermAggregate::getName
const TString & getName() const
Definition: intermediate.h:472
TQualifierList
TVector< int > TQualifierList
Definition: intermediate.h:455
TIntermBinary::addIndexClamp
bool addIndexClamp
Definition: intermediate.h:425
EOpConvIntToFloat
Definition: intermediate.h:55
EOpPostIncrement
Definition: intermediate.h:47
EOpMulAssign
Definition: intermediate.h:182
depth
GLint GLenum GLsizei GLsizei GLsizei depth
Definition: gl2ext.h:845
EOpIndexDirectStruct
Definition: intermediate.h:88
index
GLuint index
Definition: glew.h:1800
TIntermAggregate::setDebug
void setDebug(bool d)
Definition: intermediate.h:479
EOpKill
Definition: intermediate.h:148
EOpVectorTimesScalar
Definition: intermediate.h:77
EOpNull
Definition: intermediate.h:30
TIntermOperator::TIntermOperator
TIntermOperator(TOperator o)
Definition: intermediate.h:396
ConstantUnion
Definition: ConstantUnion.h:12
EOpComma
Definition: intermediate.h:75
TIntermSymbol::setSymbol
void setSymbol(const TString &sym)
Definition: intermediate.h:352
TIntermTraverser
Definition: intermediate.h:539
TIntermUnary::TIntermUnary
TIntermUnary(TOperator o)
Definition: intermediate.h:434
TIntermUnary::getOperand
TIntermTyped * getOperand()
Definition: intermediate.h:440
EOpAcos
Definition: intermediate.h:102
EOpConstructBVec2
Definition: intermediate.h:163
TIntermSelection::falseBlock
TIntermNode * falseBlock
Definition: intermediate.h:521
TIntermNode::getAsLoopNode
virtual TIntermLoop * getAsLoopNode()
Definition: intermediate.h:228
TIntermNode::getAsTyped
virtual TIntermTyped * getAsTyped()
Definition: intermediate.h:221
EOpConstructBool
Definition: intermediate.h:158
EOpSqrt
Definition: intermediate.h:110
TIntermAggregate::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:129
EOpLessThan
Definition: intermediate.h:71
TBasicType
TBasicType
Definition: BaseTypes.h:36
EOpContinue
Definition: intermediate.h:151
EOpConstructMat3
Definition: intermediate.h:170
EOpSin
Definition: intermediate.h:98
TIntermBinary::left
TIntermTyped * left
Definition: intermediate.h:421
TIntermLoop::getAsLoopNode
virtual TIntermLoop * getAsLoopNode()
Definition: intermediate.h:296
EOpCross
Definition: intermediate.h:129
Common.h
EOpConvFloatToInt
Definition: intermediate.h:56
TIntermConstantUnion::getIConst
int getIConst(int index) const
Definition: intermediate.h:371
TString
std::basic_string< char, std::char_traits< char >, TStringAllocator > TString
Definition: Common.h:41
TIntermBinary::setLeft
void setLeft(TIntermTyped *n)
Definition: intermediate.h:411
EOpEqual
Definition: intermediate.h:67
TSourceLoc::last_line
int last_line
Definition: Common.h:21
EOpVectorLogicalNot
Definition: intermediate.h:45
TIntermTraverser::visitLoop
virtual bool visitLoop(Visit visit, TIntermLoop *)
Definition: intermediate.h:558
EOpLog2
Definition: intermediate.h:109
TIntermSelection::usesTernaryOperator
bool usesTernaryOperator() const
Definition: intermediate.h:512
l
GLdouble l
Definition: glew.h:8383
TSourceLoc::first_file
int first_file
Definition: Common.h:18
TIntermUnary::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:109
TIntermTraverser::visitSelection
virtual bool visitSelection(Visit visit, TIntermSelection *)
Definition: intermediate.h:556
TIntermUnary::getAsUnaryNode
virtual TIntermUnary * getAsUnaryNode()
Definition: intermediate.h:437
TIntermAggregate::name
TString name
Definition: intermediate.h:489
TIntermSymbol
Definition: intermediate.h:340
TIntermBinary::setAddIndexClamp
void setAddIndexClamp()
Definition: intermediate.h:417
TIntermTraverser::visitConstantUnion
virtual void visitConstantUnion(TIntermConstantUnion *)
Definition: intermediate.h:553
EOpReturn
Definition: intermediate.h:149
TIntermLoop
Definition: intermediate.h:284
InVisit
Definition: intermediate.h:527
EOpConvFloatToBool
Definition: intermediate.h:53
TIntermTyped::getTypePointer
TType * getTypePointer()
Definition: intermediate.h:252
EOpConstructInt
Definition: intermediate.h:157
EOpExp
Definition: intermediate.h:106
TIntermLoop::body
TIntermNode * body
Definition: intermediate.h:313
EOpMatrixTimesMatrixAssign
Definition: intermediate.h:186
EOpLogicalAnd
Definition: intermediate.h:84
TIntermTyped::isArray
bool isArray() const
Definition: intermediate.h:260
TIntermConstantUnion::fold
TIntermTyped * fold(TOperator, TIntermTyped *, TInfoSink &)
Definition: Intermediate.cpp:1069
TIntermUnary
Definition: intermediate.h:431
EOpMatrixTimesMatrix
Definition: intermediate.h:139
TIntermLoop::getExpression
TIntermTyped * getExpression()
Definition: intermediate.h:302
TIntermLoop::TIntermLoop
TIntermLoop(TLoopType aType, TIntermNode *aInit, TIntermTyped *aCond, TIntermTyped *aExpr, TIntermNode *aBody)
Definition: intermediate.h:286
EOpCos
Definition: intermediate.h:99
EOpDiv
Definition: intermediate.h:66
TIntermNodePair::node1
TIntermNode * node1
Definition: intermediate.h:238
PostVisit
Definition: intermediate.h:528
TIntermLoop::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:217
TIntermSymbol::TIntermSymbol
TIntermSymbol(int i, const TString &sym, const TType &t)
Definition: intermediate.h:345
TIntermBinary::getAddIndexClamp
bool getAddIndexClamp()
Definition: intermediate.h:418
TIntermConstantUnion::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:31
EOpDistance
Definition: intermediate.h:127
TSourceLoc
Definition: Common.h:17
TVector< TIntermNode * >
TIntermAggregate::setUseEmulatedFunction
void setUseEmulatedFunction()
Definition: intermediate.h:482
EOpPostDecrement
Definition: intermediate.h:48
EOpConstructBVec4
Definition: intermediate.h:165
TIntermTyped::getAsTyped
virtual TIntermTyped * getAsTyped()
Definition: intermediate.h:248
TIntermLoop::init
TIntermNode * init
Definition: intermediate.h:310
TPrecision
TPrecision
Definition: BaseTypes.h:13
EOpFwidth
Definition: intermediate.h:137
TIntermSymbol::originalSymbol
TString originalSymbol
Definition: intermediate.h:362
TIntermTraverser::POOL_ALLOCATOR_NEW_DELETE
POOL_ALLOCATOR_NEW_DELETE()
TIntermNode
Definition: intermediate.h:206
TIntermAggregate::setUserDefined
void setUserDefined()
Definition: intermediate.h:474
TIntermSequence
TVector< TIntermNode * > TIntermSequence
Definition: intermediate.h:454
TIntermSymbol::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:26
TSourceLoc::first_line
int first_line
Definition: Common.h:19
TIntermUnary::useEmulatedFunction
bool useEmulatedFunction
Definition: intermediate.h:451
TIntermOperator::op
TOperator op
Definition: intermediate.h:398
PreVisit
Definition: intermediate.h:526
TIntermOperator::TIntermOperator
TIntermOperator(TOperator o, TType &t)
Definition: intermediate.h:397
EOpAddAssign
Definition: intermediate.h:180
TIntermAggregate::TIntermAggregate
TIntermAggregate()
Definition: intermediate.h:462
TIntermUnary::TIntermUnary
TIntermUnary(TOperator o, TType &t)
Definition: intermediate.h:433
EOpAll
Definition: intermediate.h:142
EOpNormalize
Definition: intermediate.h:130
EOpPrototype
Definition: intermediate.h:37
TIntermSymbol::getSymbol
const TString & getSymbol() const
Definition: intermediate.h:349
EOpExp2
Definition: intermediate.h:108
TIntermLoop::setUnrollFlag
void setUnrollFlag(bool flag)
Definition: intermediate.h:305
TIntermAggregate::sequence
TIntermSequence sequence
Definition: intermediate.h:488
TLoopType
TLoopType
Definition: intermediate.h:278
TIntermAggregate::~TIntermAggregate
~TIntermAggregate()
Definition: intermediate.h:464
TIntermUnary::operand
TIntermTyped * operand
Definition: intermediate.h:447
i
int i
Definition: pngrutil.c:1377
TIntermTyped::type
TType type
Definition: intermediate.h:272
right
GLfloat right
Definition: glew.h:13816
EOpVectorEqual
Definition: intermediate.h:69
TIntermTyped::getBasicString
const char * getBasicString() const
Definition: intermediate.h:263
TIntermLoop::unrollFlag
bool unrollFlag
Definition: intermediate.h:315
TIntermSelection::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:185
TIntermSelection::TIntermSelection
TIntermSelection(TIntermTyped *cond, TIntermNode *trueB, TIntermNode *falseB)
Definition: intermediate.h:505
TIntermConstantUnion::getFConst
float getFConst(int index) const
Definition: intermediate.h:372
TIntermLoop::getInit
TIntermNode * getInit()
Definition: intermediate.h:300
max
#define max(x, y)
Definition: os.h:79
getOperatorString
const char * getOperatorString(TOperator op)
Definition: Intermediate.cpp:26
EOpMod
Definition: intermediate.h:118
TIntermSelection::TIntermSelection
TIntermSelection(TIntermTyped *cond, TIntermNode *trueB, TIntermNode *falseB, const TType &type)
Definition: intermediate.h:507
TIntermOperator::modifiesState
bool modifiesState() const
Definition: Intermediate.cpp:750
EOpGreaterThanEqual
Definition: intermediate.h:74
TIntermTyped::getNominalSize
int getNominalSize() const
Definition: intermediate.h:257
EOpLessThanEqual
Definition: intermediate.h:73
TIntermBinary::traverse
virtual void traverse(TIntermTraverser *)
Definition: IntermTraverse.cpp:39
TIntermNodePair
Definition: intermediate.h:237
EOpFract
Definition: intermediate.h:117
TIntermNode::getAsSymbolNode
virtual TIntermSymbol * getAsSymbolNode()
Definition: intermediate.h:227
TIntermSymbol::setId
void setId(int newId)
Definition: intermediate.h:351
EOpMatrixTimesScalarAssign
Definition: intermediate.h:185
TIntermLoop::expr
TIntermTyped * expr
Definition: intermediate.h:312
EOpNotEqual
Definition: intermediate.h:68
EOpMin
Definition: intermediate.h:119
EOpPreDecrement
Definition: intermediate.h:50
EOpDegrees
Definition: intermediate.h:97
EOpLog
Definition: intermediate.h:107
false
#define false
Definition: ftrandom.c:50
EOpBreak
Definition: intermediate.h:150
TIntermConstantUnion
Definition: intermediate.h:365
TIntermSelection::trueBlock
TIntermNode * trueBlock
Definition: intermediate.h:520
TIntermNode::getAsSelectionNode
virtual TIntermSelection * getAsSelectionNode()
Definition: intermediate.h:226
TIntermAggregate::getAsAggregate
virtual TIntermAggregate * getAsAggregate()
Definition: intermediate.h:466
EOpMix
Definition: intermediate.h:122
EOpIndexDirect
Definition: intermediate.h:86
TInfoSink
Definition: InfoSink.h:108
TIntermTraverser::maxDepth
int maxDepth
Definition: intermediate.h:576
TIntermTyped::TIntermTyped
TIntermTyped(const TType &t)
Definition: intermediate.h:247
EOpMul
Definition: intermediate.h:65
EOpSubAssign
Definition: intermediate.h:181
TIntermLoop::getType
TLoopType getType() const
Definition: intermediate.h:299
TIntermTyped::getQualifierString
const char * getQualifierString() const
Definition: intermediate.h:264
TIntermUnary::setOperand
void setOperand(TIntermTyped *o)
Definition: intermediate.h:439
TIntermSymbol::id
int id
Definition: intermediate.h:360