r300: Fix special case (tmp.x <= 0) in fragment program LIT instruction
authorNicolai Haehnle <nhaehnle@gmail.com>
Mon, 19 Mar 2007 21:26:08 +0000 (22:26 +0100)
committerNicolai Haehnle <nhaehnle@gmail.com>
Mon, 19 Mar 2007 21:29:34 +0000 (22:29 +0100)
Also, fix a typo in a related comment.

src/mesa/drivers/dri/r300/r300_fragprog.c

index 3f9d83f..1d462eb 100644 (file)
@@ -1463,7 +1463,7 @@ static void emit_lit(struct r300_fragment_program *rp,
                temp = keep(dest);
        }
 
-       // Npte: The order of emit_arith inside the slots is relevant,
+       // Note: The order of emit_arith inside the slots is relevant,
        // because emit_arith only looks at scalar vs. vector when resolving
        // dependencies, and it does not consider individual vector components,
        // so swizzling between the two parts can create fake dependencies.
@@ -1496,7 +1496,7 @@ static void emit_lit(struct r300_fragment_program *rp,
 
        // Fifth slot
        emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z,
-                  swizzle(temp, W, W, W, W), pfs_zero, swizzle(temp, Y, Y, Y, Y), flags);
+                  pfs_zero, swizzle(temp, W, W, W, W), negate(swizzle(temp, Y, Y, Y, Y)), flags);
        emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
                   pfs_one, pfs_one, pfs_zero, 0);