Skip to content
Permalink
Browse files
Fixed DEF and DEFI output in GLSL profile.
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 e9262f14a9c6f763a607c76f54f383052985fd9f
Showing with 2 additions and 2 deletions.
  1. +2 −2 mojoshader.c
@@ -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
@@ -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

0 comments on commit e9262f1

Please sign in to comment.