Commit 5878f832 by Olli Etuaho Committed by Commit Bot

Fix formatting of OutputHLSL::visitAggregate

Subsequent refactoring of this code will be easier to review if there won't be unrelated style changes that git cl format insists on doing. BUG=angleproject:1490 TEST=angle_unittests Change-Id: I102fd73bd92317ab438e1676422212f644d2859b Reviewed-on: https://chromium-review.googlesource.com/394649Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent b7fe49db
...@@ -1469,7 +1469,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1469,7 +1469,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
{ {
ensureStructDefined(variable->getType()); ensureStructDefined(variable->getType());
if (!variable->getAsSymbolNode() || variable->getAsSymbolNode()->getSymbol() != "") // Variable declaration if (!variable->getAsSymbolNode() ||
variable->getAsSymbolNode()->getSymbol() != "") // Variable declaration
{ {
if (!mInsideFunction) if (!mInsideFunction)
{ {
...@@ -1491,21 +1492,26 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1491,21 +1492,26 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
variable->traverse(this); variable->traverse(this);
} }
} }
else if (variable->getAsSymbolNode() && variable->getAsSymbolNode()->getSymbol() == "") // Type (struct) declaration else if (variable->getAsSymbolNode() &&
variable->getAsSymbolNode()->getSymbol() ==
"") // Type (struct) declaration
{ {
// Already added to constructor map // Already added to constructor map
} }
else UNREACHABLE(); else
UNREACHABLE();
} }
else if (variable && IsVaryingOut(variable->getQualifier())) else if (variable && IsVaryingOut(variable->getQualifier()))
{ {
for (TIntermSequence::iterator sit = sequence->begin(); sit != sequence->end(); sit++) for (TIntermSequence::iterator sit = sequence->begin(); sit != sequence->end();
sit++)
{ {
TIntermSymbol *symbol = (*sit)->getAsSymbolNode(); TIntermSymbol *symbol = (*sit)->getAsSymbolNode();
if (symbol) if (symbol)
{ {
// Vertex (output) varyings which are declared but not written to should still be declared to allow successful linking // Vertex (output) varyings which are declared but not written to should
// still be declared to allow successful linking
mReferencedVaryings[symbol->getSymbol()] = symbol; mReferencedVaryings[symbol->getSymbol()] = symbol;
} }
else else
...@@ -1538,8 +1544,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1538,8 +1544,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
TIntermSequence *arguments = node->getSequence(); TIntermSequence *arguments = node->getSequence();
TString name = DecorateFunctionIfNeeded(node->getNameObj()); TString name = DecorateFunctionIfNeeded(node->getNameObj());
out << TypeString(node->getType()) << " " << name << DisambiguateFunctionName(arguments) out << TypeString(node->getType()) << " " << name
<< (mOutputLod0Function ? "Lod0(" : "("); << DisambiguateFunctionName(arguments) << (mOutputLod0Function ? "Lod0(" : "(");
for (unsigned int i = 0; i < arguments->size(); i++) for (unsigned int i = 0; i < arguments->size(); i++)
{ {
...@@ -1554,7 +1560,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1554,7 +1560,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
out << ", "; out << ", ";
} }
} }
else UNREACHABLE(); else
UNREACHABLE();
} }
out << ");\n"; out << ");\n";
...@@ -1639,7 +1646,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1639,7 +1646,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return false; return false;
} }
break;
case EOpFunctionCall: case EOpFunctionCall:
{ {
TIntermSequence *arguments = node->getSequence(); TIntermSequence *arguments = node->getSequence();
...@@ -1721,7 +1727,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1721,7 +1727,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return false; return false;
} }
break;
case EOpParameters: case EOpParameters:
outputTriplet(out, visit, "(", ", ", ")\n{\n"); outputTriplet(out, visit, "(", ", ", ")\n{\n");
break; break;
...@@ -1867,8 +1872,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1867,8 +1872,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
{ {
outputTriplet(out, visit, "lerp(", ", ", ")"); outputTriplet(out, visit, "lerp(", ", ", ")");
} }
}
break; break;
}
case EOpStep: case EOpStep:
outputTriplet(out, visit, "step(", ", ", ")"); outputTriplet(out, visit, "step(", ", ", ")");
break; break;
...@@ -1901,7 +1906,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1901,7 +1906,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpMul: case EOpMul:
outputTriplet(out, visit, "(", " * ", ")"); outputTriplet(out, visit, "(", " * ", ")");
break; break;
default: UNREACHABLE(); default:
UNREACHABLE();
} }
return true; return true;
......
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