r500_fragprog: Fix RSQ with negative parameters
authorNicolai Haehnle <nhaehnle@gmail.com>
Sun, 6 Jul 2008 14:39:31 +0000 (16:39 +0200)
committerNicolai Haehnle <nhaehnle@gmail.com>
Sun, 6 Jul 2008 14:39:31 +0000 (16:39 +0200)
src/mesa/drivers/dri/r300/r500_fragprog_emit.c

index 678114b8c17271b0d43bb591935d54a2f5e8eb7d..8c900941c4d997ad5c1e5b82e3d70b4d3f5683bb 100644 (file)
@@ -784,7 +784,8 @@ static void do_inst(struct r500_pfs_compile_state *cs, struct prog_instruction *
                        break;
                case OPCODE_RSQ:
                        src[0] = make_src(cs, fpi->SrcReg[0]);
-                       emit_sop(cs, R500_ALPHA_OP_RSQ, fpi->DstReg, src[0], make_sop_swizzle(fpi->SrcReg[0]));
+                       emit_sop(cs, R500_ALPHA_OP_RSQ, fpi->DstReg, src[0],
+                               (make_sop_swizzle(fpi->SrcReg[0]) | (R500_SWIZ_MOD_ABS<<3)) & ~(R500_SWIZ_MOD_NEG<<3));
                        break;
                case OPCODE_SCS:
                        emit_trig(cs, fpi);