summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip
Roll back to ANGLE/2845
Diffstat (limited to 'gfx/angle/src/compiler/translator/SeparateDeclarations.cpp')
-rwxr-xr-xgfx/angle/src/compiler/translator/SeparateDeclarations.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/gfx/angle/src/compiler/translator/SeparateDeclarations.cpp b/gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
index 4d3835370..d33747f85 100755
--- a/gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
+++ b/gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
@@ -17,9 +17,6 @@
#include "compiler/translator/IntermNode.h"
-namespace sh
-{
-
namespace
{
@@ -29,7 +26,7 @@ class SeparateDeclarationsTraverser : private TIntermTraverser
static void apply(TIntermNode *root);
private:
SeparateDeclarationsTraverser();
- bool visitDeclaration(Visit, TIntermDeclaration *node) override;
+ bool visitAggregate(Visit, TIntermAggregate *node) override;
};
void SeparateDeclarationsTraverser::apply(TIntermNode *root)
@@ -44,28 +41,32 @@ SeparateDeclarationsTraverser::SeparateDeclarationsTraverser()
{
}
-bool SeparateDeclarationsTraverser::visitDeclaration(Visit, TIntermDeclaration *node)
+bool SeparateDeclarationsTraverser::visitAggregate(Visit, TIntermAggregate *node)
{
- TIntermSequence *sequence = node->getSequence();
- if (sequence->size() > 1)
+ if (node->getOp() == EOpDeclaration)
{
- TIntermBlock *parentBlock = getParentNode()->getAsBlock();
- ASSERT(parentBlock != nullptr);
-
- TIntermSequence replacementDeclarations;
- for (size_t ii = 0; ii < sequence->size(); ++ii)
+ TIntermSequence *sequence = node->getSequence();
+ if (sequence->size() > 1)
{
- TIntermDeclaration *replacementDeclaration = new TIntermDeclaration();
+ TIntermAggregate *parentAgg = getParentNode()->getAsAggregate();
+ ASSERT(parentAgg != nullptr);
- replacementDeclaration->appendDeclarator(sequence->at(ii)->getAsTyped());
- replacementDeclaration->setLine(sequence->at(ii)->getLine());
- replacementDeclarations.push_back(replacementDeclaration);
- }
+ TIntermSequence replacementDeclarations;
+ for (size_t ii = 0; ii < sequence->size(); ++ii)
+ {
+ TIntermAggregate *replacementDeclaration = new TIntermAggregate;
- mMultiReplacements.push_back(
- NodeReplaceWithMultipleEntry(parentBlock, node, replacementDeclarations));
+ replacementDeclaration->setOp(EOpDeclaration);
+ replacementDeclaration->getSequence()->push_back(sequence->at(ii));
+ replacementDeclaration->setLine(sequence->at(ii)->getLine());
+ replacementDeclarations.push_back(replacementDeclaration);
+ }
+
+ mMultiReplacements.push_back(NodeReplaceWithMultipleEntry(parentAgg, node, replacementDeclarations));
+ }
+ return false;
}
- return false;
+ return true;
}
} // namespace
@@ -74,5 +75,3 @@ void SeparateDeclarations(TIntermNode *root)
{
SeparateDeclarationsTraverser::apply(root);
}
-
-} // namespace sh