Use a single index for excessive loops.
TRAC #21167
ISSUE=338
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1209 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index 50186b3..c52f61c 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -2052,7 +2052,9 @@
return false; // Not an excessive loop
}
- out << "{";
+ out << "{int ";
+ index->traverse(this);
+ out << ";\n";
while (iterations > 0)
{
@@ -2060,7 +2062,7 @@
// for(int index = initial; index < clampedLimit; index += increment)
- out << "for(int ";
+ out << "for(";
index->traverse(this);
out << " = ";
out << initial;