diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:29:50 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:31:02 +0200 |
commit | 70dd5e7c66b1fe3f82e5b4db2406050baba15f05 (patch) | |
tree | 3f012200ef3c934f33db1a4ef2b790fae3141860 /gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp | |
parent | 3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff) | |
parent | 8481fa25d246f1968d0a254ee3c6cdd82c60781a (diff) | |
download | UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.gz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.lz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.xz UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.zip |
Merge branch 'ANGLE-rollback'
This resolves #624
Note: Cherry-picked some fixes on top of the ANGLE version that we want to keep.
Diffstat (limited to 'gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp')
-rwxr-xr-x | gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp b/gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp index ba991b709..31bfae996 100755 --- a/gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp +++ b/gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp @@ -11,9 +11,6 @@ #include "compiler/translator/CallDAG.h" #include "compiler/translator/SymbolTable.h" -namespace sh -{ - namespace { @@ -34,7 +31,7 @@ class PullGradient : public TIntermTraverser ASSERT(index < metadataList->size()); } - void traverse(TIntermFunctionDefinition *node) + void traverse(TIntermAggregate *node) { node->traverse(this); ASSERT(mParents.empty()); @@ -75,9 +72,9 @@ class PullGradient : public TIntermTraverser return true; } - bool visitIfElse(Visit visit, TIntermIfElse *ifElse) override + bool visitSelection(Visit visit, TIntermSelection *selection) override { - visitControlFlow(visit, ifElse); + visitControlFlow(visit, selection); return true; } @@ -106,8 +103,9 @@ class PullGradient : public TIntermTraverser { if (node->isUserDefined()) { - size_t calleeIndex = mDag.findIndex(node->getFunctionSymbolInfo()); + size_t calleeIndex = mDag.findIndex(node); ASSERT(calleeIndex != CallDAG::InvalidIndex && calleeIndex < mIndex); + UNUSED_ASSERTION_VARIABLE(mIndex); if ((*mMetadataList)[calleeIndex].mUsesGradient) { onGradient(); @@ -115,8 +113,7 @@ class PullGradient : public TIntermTraverser } else { - TString name = - TFunction::unmangleName(node->getFunctionSymbolInfo()->getName()); + TString name = TFunction::unmangleName(node->getName()); if (name == "texture2D" || name == "texture2DProj" || @@ -160,7 +157,7 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser { } - void traverse(TIntermFunctionDefinition *node) + void traverse(TIntermAggregate *node) { node->traverse(this); ASSERT(mLoopsAndSwitches.empty()); @@ -199,7 +196,7 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser return true; } - bool visitIfElse(Visit visit, TIntermIfElse *node) override + bool visitSelection(Visit visit, TIntermSelection *node) override { if (visit == PreVisit) { @@ -278,8 +275,9 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser { if (node->isUserDefined()) { - size_t calleeIndex = mDag.findIndex(node->getFunctionSymbolInfo()); + size_t calleeIndex = mDag.findIndex(node); ASSERT(calleeIndex != CallDAG::InvalidIndex && calleeIndex < mIndex); + UNUSED_ASSERTION_VARIABLE(mIndex); if ((*mMetadataList)[calleeIndex].mHasGradientLoopInCallGraph) { @@ -312,7 +310,7 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser const CallDAG &mDag; std::vector<TIntermNode*> mLoopsAndSwitches; - std::vector<TIntermIfElse *> mIfs; + std::vector<TIntermSelection*> mIfs; }; // Tags all the functions called in a discontinuous loop @@ -329,7 +327,7 @@ class PushDiscontinuousLoops : public TIntermTraverser { } - void traverse(TIntermFunctionDefinition *node) + void traverse(TIntermAggregate *node) { node->traverse(this); ASSERT(mNestedDiscont == (mMetadata->mCalledInDiscontinuousLoop ? 1 : 0)); @@ -358,8 +356,9 @@ class PushDiscontinuousLoops : public TIntermTraverser case EOpFunctionCall: if (visit == PreVisit && node->isUserDefined() && mNestedDiscont > 0) { - size_t calleeIndex = mDag.findIndex(node->getFunctionSymbolInfo()); + size_t calleeIndex = mDag.findIndex(node); ASSERT(calleeIndex != CallDAG::InvalidIndex && calleeIndex < mIndex); + UNUSED_ASSERTION_VARIABLE(mIndex); (*mMetadataList)[calleeIndex].mCalledInDiscontinuousLoop = true; } @@ -386,7 +385,7 @@ bool ASTMetadataHLSL::hasGradientInCallGraph(TIntermLoop *node) return mControlFlowsContainingGradient.count(node) > 0; } -bool ASTMetadataHLSL::hasGradientLoop(TIntermIfElse *node) +bool ASTMetadataHLSL::hasGradientLoop(TIntermSelection *node) { return mIfsContainingGradientLoop.count(node) > 0; } @@ -450,5 +449,3 @@ MetadataList CreateASTMetadataHLSL(TIntermNode *root, const CallDAG &callDag) return metadataList; } - -} // namespace sh |