Limit HLSL loop scope to match that of GLSL.
TRAC #19197
ISSUE=260
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@999 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index 9741ffb..53318b6 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -1635,14 +1635,14 @@
if (node->getType() == ELoopDoWhile)
{
- out << "do\n";
+ out << "{do\n";
outputLineDirective(node->getLine());
out << "{\n";
}
else
{
- out << "for(";
+ out << "{for(";
if (node->getInit())
{
@@ -1687,7 +1687,7 @@
out << ")";
}
- out << ";\n";
+ out << "};\n";
return false;
}