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) ...@@ -2262,16 +2262,16 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node) bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
{ {
TInfoSinkBase &out = getInfoSink(); if (visit == PreVisit)
switch (node->getFlowOp())
{ {
case EOpKill: TInfoSinkBase &out = getInfoSink();
outputTriplet(out, visit, "discard;\n", "", "");
break; switch (node->getFlowOp())
case EOpBreak: {
if (visit == PreVisit) case EOpKill:
{ out << "discard";
break;
case EOpBreak:
if (mNestedLoopDepth > 1) if (mNestedLoopDepth > 1)
{ {
mUsesNestedBreak = true; mUsesNestedBreak = true;
...@@ -2285,35 +2285,25 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node) ...@@ -2285,35 +2285,25 @@ bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
} }
else else
{ {
out << "break;\n"; out << "break";
} }
} break;
break; case EOpContinue:
case EOpContinue: out << "continue";
outputTriplet(out, visit, "continue;\n", "", ""); break;
break; case EOpReturn:
case EOpReturn:
if (visit == PreVisit)
{
if (node->getExpression()) if (node->getExpression())
{ {
out << "return "; out << "return ";
} }
else else
{ {
out << "return;\n"; out << "return";
} }
} break;
else if (visit == PostVisit) default:
{ UNREACHABLE();
if (node->getExpression()) }
{
out << ";\n";
}
}
break;
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