Commit 6cb1637f by steve-lunarg

Move promote methods to TIntermediate class

A need arose to use capabilities from TIntermediate during node promotion. These methods have been moved from virtual methods on the TIntermUnary and TIntermBinary nodes to methods on TIntermediate, so it is easy for them construct new nodes and so on. This is done as a separate commit to verify that no test results are changed as a result.
parent e5921f13
......@@ -847,7 +847,7 @@ public:
virtual TIntermOperator* getAsOperator() { return this; }
virtual const TIntermOperator* getAsOperator() const { return this; }
TOperator getOp() const { return op; }
virtual bool promote(TIntermediate&) { return true; }
void setOp(TOperator newOp) { op = newOp; }
bool modifiesState() const;
bool isConstructor() const;
bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; }
......@@ -1026,7 +1026,6 @@ public:
virtual TIntermTyped* getRight() const { return right; }
virtual TIntermBinary* getAsBinaryNode() { return this; }
virtual const TIntermBinary* getAsBinaryNode() const { return this; }
virtual bool promote(TIntermediate&);
virtual void updatePrecision();
protected:
TIntermTyped* left;
......@@ -1046,7 +1045,6 @@ public:
virtual const TIntermTyped* getOperand() const { return operand; }
virtual TIntermUnary* getAsUnaryNode() { return this; }
virtual const TIntermUnary* getAsUnaryNode() const { return this; }
virtual bool promote(TIntermediate&);
virtual void updatePrecision();
protected:
TIntermTyped* operand;
......
......@@ -393,6 +393,9 @@ protected:
bool userOutputUsed() const;
static int getBaseAlignmentScalar(const TType&, int& size);
bool isSpecializationOperation(const TIntermOperator&) const;
bool promote(TIntermOperator*);
bool promoteUnary(TIntermUnary&);
bool promoteBinary(TIntermBinary&);
const EShLanguage language; // stage, known at construction time
EShSource source; // source language, known a bit later
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment