Skip to content

Commit

Permalink
Implemented LOOP/ENDLOOP in GLSL profile.
Browse files Browse the repository at this point in the history
I _think_ this should work, we'll see.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 8, 2008
1 parent 4227a91 commit 0a7bfac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mojoshader.c
Expand Up @@ -2349,8 +2349,10 @@ static void emit_GLSL_CALLNZ(Context *ctx)

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

Expand All @@ -2367,7 +2369,6 @@ static void emit_GLSL_RET(Context *ctx)

static void emit_GLSL_ENDLOOP(Context *ctx)
{
//fail(ctx, "unimplemented."); // !!! FIXME
ctx->indent--;
output_line(ctx, "}");
} // emit_GLSL_ENDLOOP
Expand Down

0 comments on commit 0a7bfac

Please sign in to comment.