From 056689d457924ba4d8a0723d0c5f24383d1757d9 Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Sun, 6 Jul 2008 16:39:31 +0200 Subject: r500_fragprog: Fix RSQ with negative parameters --- src/mesa/drivers/dri/r300/r500_fragprog_emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c index 678114b8c17..8c900941c4d 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c @@ -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); -- cgit v1.2.3