Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | #ifndef _LOCAL_INTERMEDIATE_INCLUDED_ |
michael@0 | 8 | #define _LOCAL_INTERMEDIATE_INCLUDED_ |
michael@0 | 9 | |
michael@0 | 10 | #include "GLSLANG/ShaderLang.h" |
michael@0 | 11 | #include "compiler/intermediate.h" |
michael@0 | 12 | #include "compiler/SymbolTable.h" |
michael@0 | 13 | |
michael@0 | 14 | struct TVectorFields { |
michael@0 | 15 | int offsets[4]; |
michael@0 | 16 | int num; |
michael@0 | 17 | }; |
michael@0 | 18 | |
michael@0 | 19 | // |
michael@0 | 20 | // Set of helper functions to help parse and build the tree. |
michael@0 | 21 | // |
michael@0 | 22 | class TInfoSink; |
michael@0 | 23 | class TIntermediate { |
michael@0 | 24 | public: |
michael@0 | 25 | POOL_ALLOCATOR_NEW_DELETE(); |
michael@0 | 26 | TIntermediate(TInfoSink& i) : infoSink(i) { } |
michael@0 | 27 | |
michael@0 | 28 | TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TSourceLoc&); |
michael@0 | 29 | TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*); |
michael@0 | 30 | TIntermTyped* addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&, TSymbolTable&); |
michael@0 | 31 | TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); |
michael@0 | 32 | TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, const TSourceLoc&); |
michael@0 | 33 | TIntermTyped* addUnaryMath(TOperator op, TIntermNode* child, const TSourceLoc&, TSymbolTable&); |
michael@0 | 34 | TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&); |
michael@0 | 35 | TIntermAggregate* makeAggregate(TIntermNode* node, const TSourceLoc&); |
michael@0 | 36 | TIntermAggregate* setAggregateOperator(TIntermNode*, TOperator, const TSourceLoc&); |
michael@0 | 37 | TIntermNode* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&); |
michael@0 | 38 | TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&); |
michael@0 | 39 | TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&); |
michael@0 | 40 | TIntermConstantUnion* addConstantUnion(ConstantUnion*, const TType&, const TSourceLoc&); |
michael@0 | 41 | TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) ; |
michael@0 | 42 | bool parseConstTree(const TSourceLoc&, TIntermNode*, ConstantUnion*, TOperator, TSymbolTable&, TType, bool singleConstantParam = false); |
michael@0 | 43 | TIntermNode* addLoop(TLoopType, TIntermNode*, TIntermTyped*, TIntermTyped*, TIntermNode*, const TSourceLoc&); |
michael@0 | 44 | TIntermBranch* addBranch(TOperator, const TSourceLoc&); |
michael@0 | 45 | TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); |
michael@0 | 46 | TIntermTyped* addSwizzle(TVectorFields&, const TSourceLoc&); |
michael@0 | 47 | bool postProcess(TIntermNode*); |
michael@0 | 48 | void remove(TIntermNode*); |
michael@0 | 49 | void outputTree(TIntermNode*); |
michael@0 | 50 | |
michael@0 | 51 | private: |
michael@0 | 52 | void operator=(TIntermediate&); // prevent assignments |
michael@0 | 53 | |
michael@0 | 54 | TInfoSink& infoSink; |
michael@0 | 55 | }; |
michael@0 | 56 | |
michael@0 | 57 | #endif // _LOCAL_INTERMEDIATE_INCLUDED_ |