Skip to content

Commit

Permalink
Fixed LOOP output in GLSL profile.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 17, 2008
1 parent 579081b commit cf8707b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mojoshader.c
Expand Up @@ -2349,8 +2349,11 @@ static void emit_GLSL_LOOP(Context *ctx)
{
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

Expand All @@ -2369,6 +2372,8 @@ static void emit_GLSL_ENDLOOP(Context *ctx)
{
ctx->indent--;
output_line(ctx, "}");
ctx->indent--;
output_line(ctx, "}");
} // emit_GLSL_ENDLOOP

static void emit_GLSL_LABEL(Context *ctx)
Expand Down

0 comments on commit cf8707b

Please sign in to comment.