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)
{
ensureStructDefined(variable->getType());
if (!variable->getAsSymbolNode() || variable->getAsSymbolNode()->getSymbol() != "") // Variable declaration
if (!variable->getAsSymbolNode() ||
variable->getAsSymbolNode()->getSymbol() != "") // Variable declaration
{
if (!mInsideFunction)
{
......@@ -1491,21 +1492,26 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
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
}
else UNREACHABLE();
else
UNREACHABLE();
}
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();
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;
}
else
......@@ -1538,8 +1544,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
TIntermSequence *arguments = node->getSequence();
TString name = DecorateFunctionIfNeeded(node->getNameObj());
out << TypeString(node->getType()) << " " << name << DisambiguateFunctionName(arguments)
<< (mOutputLod0Function ? "Lod0(" : "(");
out << TypeString(node->getType()) << " " << name
<< DisambiguateFunctionName(arguments) << (mOutputLod0Function ? "Lod0(" : "(");
for (unsigned int i = 0; i < arguments->size(); i++)
{
......@@ -1554,7 +1560,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
out << ", ";
}
}
else UNREACHABLE();
else
UNREACHABLE();
}
out << ");\n";
......@@ -1639,7 +1646,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return false;
}
break;
case EOpFunctionCall:
{
TIntermSequence *arguments = node->getSequence();
......@@ -1721,7 +1727,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return false;
}
break;
case EOpParameters:
outputTriplet(out, visit, "(", ", ", ")\n{\n");
break;
......@@ -1867,8 +1872,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
{
outputTriplet(out, visit, "lerp(", ", ", ")");
}
}
break;
}
case EOpStep:
outputTriplet(out, visit, "step(", ", ", ")");
break;
......@@ -1901,7 +1906,8 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpMul:
outputTriplet(out, visit, "(", " * ", ")");
break;
default: UNREACHABLE();
default:
UNREACHABLE();
}
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