Don't check for Break on the first loop fragment.

TRAC #21167 ISSUE=338 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1212 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8c77f854
...@@ -2078,13 +2078,18 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node) ...@@ -2078,13 +2078,18 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
index->traverse(this); index->traverse(this);
out << " = false;\n"; out << " = false;\n";
bool firstLoopFragment = true;
while (iterations > 0) while (iterations > 0)
{ {
int clampedLimit = initial + increment * std::min(MAX_LOOP_ITERATIONS, iterations); int clampedLimit = initial + increment * std::min(MAX_LOOP_ITERATIONS, iterations);
out << "if(!Break"; if (!firstLoopFragment)
index->traverse(this); {
out << ") {\n"; out << "if(!Break";
index->traverse(this);
out << ") {\n";
}
// for(int index = initial; index < clampedLimit; index += increment) // for(int index = initial; index < clampedLimit; index += increment)
...@@ -2113,7 +2118,14 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node) ...@@ -2113,7 +2118,14 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
} }
outputLineDirective(node->getLine()); outputLineDirective(node->getLine());
out << ";}}\n"; out << ";}\n";
if (!firstLoopFragment)
{
out << "}\n";
}
firstLoopFragment = false;
initial += MAX_LOOP_ITERATIONS * increment; initial += MAX_LOOP_ITERATIONS * increment;
iterations -= MAX_LOOP_ITERATIONS; iterations -= MAX_LOOP_ITERATIONS;
......
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