From 22188168dafba0a903c41aed38125a95d99e36ba Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 13 Apr 2012 02:13:47 -0400 Subject: [PATCH] Fixed the GLSL LIT opcode. Clearly we never pushed this through a GLSL compiler before. :) --- mojoshader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 728e3e2c..42f11c08 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -2756,7 +2756,7 @@ static void emit_GLSL_LOG(Context *ctx) static void emit_GLSL_LIT_helper(Context *ctx) { - const char *maxp = "127.9961f"; // value from the dx9 reference. + const char *maxp = "127.9961"; // value from the dx9 reference. if (ctx->glsl_generated_lit_opcode) return; @@ -2764,10 +2764,10 @@ static void emit_GLSL_LIT_helper(Context *ctx) ctx->glsl_generated_lit_opcode = 1; push_output(ctx, &ctx->helpers); - output_line(ctx, "const vec4 LIT(const vec4 src)"); + output_line(ctx, "vec4 LIT(const vec4 src)"); output_line(ctx, "{"); ctx->indent++; - output_line(ctx, "const float power = clamp(src.w, -%s, %s);",maxp,maxp); - output_line(ctx, "vec4 retval(1.0, 0.0, 0.0, 1.0)"); + output_line(ctx, "float power = clamp(src.w, -%s, %s);",maxp,maxp); + output_line(ctx, "vec4 retval = vec4(1.0, 0.0, 0.0, 1.0);"); output_line(ctx, "if (src.x > 0.0) {"); ctx->indent++; output_line(ctx, "retval.y = src.x;"); output_line(ctx, "if (src.y > 0.0) {"); ctx->indent++;