From e9262f14a9c6f763a607c76f54f383052985fd9f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Apr 2008 17:53:41 -0400 Subject: [PATCH] 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 --- mojoshader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 4a0b6f48..864a9322 100644 --- a/mojoshader.c +++ b/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