Implemented LOOP/ENDLOOP in GLSL profile.
I _think_ this should work, we'll see.
--- a/mojoshader.c Mon Apr 07 13:18:31 2008 -0400
+++ b/mojoshader.c Mon Apr 07 20:04:24 2008 -0400
@@ -2349,8 +2349,10 @@
static void emit_GLSL_LOOP(Context *ctx)
{
- //fail(ctx, "unimplemented."); // !!! FIXME
- output_line(ctx, "for (int aL = BLAH, BLAH, BLAH) {");
+ 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);
ctx->indent++;
} // emit_GLSL_LOOP
@@ -2367,7 +2369,6 @@
static void emit_GLSL_ENDLOOP(Context *ctx)
{
- //fail(ctx, "unimplemented."); // !!! FIXME
ctx->indent--;
output_line(ctx, "}");
} // emit_GLSL_ENDLOOP