Fixed CALLNZ in the GLSL profile. trunk
authorRyan C. Gordon <icculus@icculus.org>
Thu, 03 Apr 2008 08:31:31 -0400
branchtrunk
changeset 70 e1e19abca250
parent 69 73199b16b926
child 71 21354bd7531a
Fixed CALLNZ in the GLSL profile.
mojoshader.c
--- a/mojoshader.c	Thu Apr 03 08:29:38 2008 -0400
+++ b/mojoshader.c	Thu Apr 03 08:31:31 2008 -0400
@@ -1801,9 +1801,11 @@
 
 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)