Change infrastructure to support constant folding across built-in functions, as required by 1.2 semantics. Partially fleshed out with min/max and some trig functions. Still have to complete all operations.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20806 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
3f3e0ad3ad
commit
53fb465729
14 changed files with 737 additions and 481 deletions
|
|
@ -40,8 +40,8 @@
|
|||
//
|
||||
class TConstTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TConstTraverser(constUnion* cUnion, bool singleConstParam, TOperator constructType, TInfoSink& sink, TSymbolTable& symTable, TType& t) : unionArray(cUnion), type(t),
|
||||
constructorType(constructType), singleConstantParam(singleConstParam), infoSink(sink), symbolTable(symTable), error(false), isMatrix(false),
|
||||
TConstTraverser(constUnion* cUnion, bool singleConstParam, TOperator constructType, TInfoSink& sink, TType& t) : unionArray(cUnion), type(t),
|
||||
constructorType(constructType), singleConstantParam(singleConstParam), infoSink(sink), error(false), isMatrix(false),
|
||||
matrixCols(0), matrixRows(0) { index = 0; tOp = EOpNull;}
|
||||
int index ;
|
||||
constUnion *unionArray;
|
||||
|
|
@ -50,7 +50,6 @@ public:
|
|||
TOperator constructorType;
|
||||
bool singleConstantParam;
|
||||
TInfoSink& infoSink;
|
||||
TSymbolTable& symbolTable;
|
||||
bool error;
|
||||
int size; // size of the constructor ( 4 for vec4)
|
||||
bool isMatrix;
|
||||
|
|
@ -256,12 +255,12 @@ bool ParseBranch(bool /* previsit*/, TIntermBranch* node, TIntermTraverser* it)
|
|||
// Individual functions can be initialized to 0 to skip processing of that
|
||||
// type of node. It's children will still be processed.
|
||||
//
|
||||
bool TIntermediate::parseConstTree(TSourceLoc line, TIntermNode* root, constUnion* unionArray, TOperator constructorType, TSymbolTable& symbolTable, TType t, bool singleConstantParam)
|
||||
bool TIntermediate::parseConstTree(TSourceLoc line, TIntermNode* root, constUnion* unionArray, TOperator constructorType, TType t, bool singleConstantParam)
|
||||
{
|
||||
if (root == 0)
|
||||
return false;
|
||||
|
||||
TConstTraverser it(unionArray, singleConstantParam, constructorType, infoSink, symbolTable, t);
|
||||
TConstTraverser it(unionArray, singleConstantParam, constructorType, infoSink, t);
|
||||
|
||||
it.visitAggregate = ParseAggregate;
|
||||
it.visitBinary = ParseBinary;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue