Fixed LOOP output in GLSL profile.
--- a/mojoshader.c Wed Apr 16 18:03:08 2008 -0400
+++ b/mojoshader.c Wed Apr 16 23:19:25 2008 -0400
@@ -2349,8 +2349,11 @@
{
const char *varname = get_GLSL_sourcearg_varname(ctx, 1);
assert(ctx->source_args[0].regnum == 0); // in case they add aL1 someday.
- output_line(ctx, "for (int aL = %s.y, const int aLend = %s.x+%s.y; aL < aLend; aL += %s.z) {",
- varname, varname, varname, varname);
+ output_line(ctx, "{");
+ ctx->indent++;
+ output_line(ctx, "const int aLend = %s.x+%s.y;", varname, varname);
+ output_line(ctx, "for (int aL = %s.y; aL < aLend; aL += %s.z) {",
+ varname, varname);
ctx->indent++;
} // emit_GLSL_LOOP
@@ -2369,6 +2372,8 @@
{
ctx->indent--;
output_line(ctx, "}");
+ ctx->indent--;
+ output_line(ctx, "}");
} // emit_GLSL_ENDLOOP
static void emit_GLSL_LABEL(Context *ctx)