gfx/angle/src/compiler/localintermediate.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/compiler/localintermediate.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +#ifndef _LOCAL_INTERMEDIATE_INCLUDED_
    1.11 +#define _LOCAL_INTERMEDIATE_INCLUDED_
    1.12 +
    1.13 +#include "GLSLANG/ShaderLang.h"
    1.14 +#include "compiler/intermediate.h"
    1.15 +#include "compiler/SymbolTable.h"
    1.16 +
    1.17 +struct TVectorFields {
    1.18 +    int offsets[4];
    1.19 +    int num;
    1.20 +};
    1.21 +
    1.22 +//
    1.23 +// Set of helper functions to help parse and build the tree.
    1.24 +//
    1.25 +class TInfoSink;
    1.26 +class TIntermediate {
    1.27 +public:    
    1.28 +    POOL_ALLOCATOR_NEW_DELETE();
    1.29 +    TIntermediate(TInfoSink& i) : infoSink(i) { }
    1.30 +
    1.31 +    TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TSourceLoc&);
    1.32 +    TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*);
    1.33 +    TIntermTyped* addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&, TSymbolTable&);
    1.34 +    TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);
    1.35 +    TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, const TSourceLoc&);
    1.36 +    TIntermTyped* addUnaryMath(TOperator op, TIntermNode* child, const TSourceLoc&, TSymbolTable&);
    1.37 +    TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&);
    1.38 +    TIntermAggregate* makeAggregate(TIntermNode* node, const TSourceLoc&);
    1.39 +    TIntermAggregate* setAggregateOperator(TIntermNode*, TOperator, const TSourceLoc&);
    1.40 +    TIntermNode*  addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&);
    1.41 +    TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&);
    1.42 +    TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);
    1.43 +    TIntermConstantUnion* addConstantUnion(ConstantUnion*, const TType&, const TSourceLoc&);
    1.44 +    TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) ;
    1.45 +    bool parseConstTree(const TSourceLoc&, TIntermNode*, ConstantUnion*, TOperator, TSymbolTable&, TType, bool singleConstantParam = false);        
    1.46 +    TIntermNode* addLoop(TLoopType, TIntermNode*, TIntermTyped*, TIntermTyped*, TIntermNode*, const TSourceLoc&);
    1.47 +    TIntermBranch* addBranch(TOperator, const TSourceLoc&);
    1.48 +    TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&);
    1.49 +    TIntermTyped* addSwizzle(TVectorFields&, const TSourceLoc&);
    1.50 +    bool postProcess(TIntermNode*);
    1.51 +    void remove(TIntermNode*);
    1.52 +    void outputTree(TIntermNode*);
    1.53 +
    1.54 +private:
    1.55 +    void operator=(TIntermediate&); // prevent assignments
    1.56 +
    1.57 +    TInfoSink& infoSink;
    1.58 +};
    1.59 +
    1.60 +#endif // _LOCAL_INTERMEDIATE_INCLUDED_

mercurial