Skip to content

Commit

Permalink
Fixed DEF and DEFI output in GLSL profile.
Browse files Browse the repository at this point in the history
Apparently you can't do "1.0f" for float constants, just "1.0" ... at least,
 that's what Apple's GLSL compiler thinks, and you have to do an assignment
 instead of a direct constructor.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 16, 2008
1 parent b674818 commit e9262f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mojoshader.c
Expand Up @@ -2537,7 +2537,7 @@ static void emit_GLSL_DEFI(Context *ctx)
const char *varname = get_GLSL_destarg_varname(ctx, 0);
const int32 *x = (const int32 *) ctx->dwords;
push_output(ctx, &ctx->globals);
output_line(ctx, "const ivec4 %s(%d, %d, %d, %d);",
output_line(ctx, "const ivec4 %s = ivec4(%d, %d, %d, %d);",
varname, (int) x[0], (int) x[1], (int) x[2], (int) x[3]);
pop_output(ctx);
} // emit_GLSL_DEFI
Expand Down Expand Up @@ -2687,7 +2687,7 @@ static void emit_GLSL_DEF(Context *ctx)
floatstr(ctx, val3, sizeof (val3), val[3], 1);

push_output(ctx, &ctx->globals);
output_line(ctx, "const vec4 %s(%sf, %sf, %sf, %sf);",
output_line(ctx, "const vec4 %s = vec4(%s, %s, %s, %s);",
varname, val0, val1, val2, val3);
pop_output(ctx);
} // emit_GLSL_DEF
Expand Down

0 comments on commit e9262f1

Please sign in to comment.