summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-fc61780b35af913801d72086456f493f63197da6.tar
UXP-fc61780b35af913801d72086456f493f63197da6.tar.gz
UXP-fc61780b35af913801d72086456f493f63197da6.tar.lz
UXP-fc61780b35af913801d72086456f493f63197da6.tar.xz
UXP-fc61780b35af913801d72086456f493f63197da6.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp')
-rwxr-xr-xgfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp33
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