Commit 8886f0fc by Olli Etuaho Committed by Commit Bot

Clean redundant semicolons from HLSL branch statements

Branch statements can only exist inside block nodes. The block node that contains a branch will take care of writing a semicolon after each statement. BUG=angleproject:1013 TEST=angle_end2end_tests Change-Id: Ie5d9077c5d2e090c704282dba39b4d46845cbf1e Reviewed-on: https://chromium-review.googlesource.com/708894Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 180f43c6
......@@ -2262,16 +2262,16 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
{
if (visit == PreVisit)
{
TInfoSinkBase &out = getInfoSink();
switch (node->getFlowOp())
{
case EOpKill:
outputTriplet(out, visit, "discard;\n", "", "");
out << "discard";
break;
case EOpBreak:
if (visit == PreVisit)
{
if (mNestedLoopDepth > 1)
{
mUsesNestedBreak = true;
......@@ -2285,36 +2285,26 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
}
else
{
out << "break;\n";
}
out << "break";
}
break;
case EOpContinue:
outputTriplet(out, visit, "continue;\n", "", "");
out << "continue";
break;
case EOpReturn:
if (visit == PreVisit)
{
if (node->getExpression())
{
out << "return ";
}
else
{
out << "return;\n";
}
}
else if (visit == PostVisit)
{
if (node->getExpression())
{
out << ";\n";
}
out << "return";
}
break;
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