From 003ecad0e526d58e254b938c230b37bc711bf427 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 3 Apr 2008 08:31:31 -0400 Subject: [PATCH] Fixed CALLNZ in the GLSL profile. --HG-- branch : trunk --- mojoshader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mojoshader.c b/mojoshader.c index b99890f1..467fb43b 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -1801,9 +1801,11 @@ static void emit_GLSL_CALL(Context *ctx) static void emit_GLSL_CALLNZ(Context *ctx) { + // !!! FIXME: if src1 is a constbool that's true, we can remove the + // !!! FIXME: if. If it's false, we can make this a no-op. const char *src0 = make_GLSL_sourcearg_string(ctx, 0); const char *src1 = make_GLSL_sourcearg_string(ctx, 1); - output_line(ctx, "if (%s) { %s(); }", src0, src1); + output_line(ctx, "if (%s) { %s(); }", src1, src0); } // emit_GLSL_CALLNZ static void emit_GLSL_LOOP(Context *ctx)