[Mesa-dev] [PATCH 4/5] r600g: fix RSQ of negative value on Cayman

Marek Olšák maraeo at gmail.com
Tue Sep 25 16:46:13 PDT 2012


NOTE: This is a candidate for the stable branches.
---
 src/gallium/drivers/r600/r600_shader.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 6e47593..7df549b 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1888,6 +1888,11 @@ static int cayman_emit_float_instr(struct r600_shader_ctx *ctx)
 		alu.inst = ctx->inst_info->r600_opcode;
 		for (j = 0; j < inst->Instruction.NumSrcRegs; j++) {
 			r600_bytecode_src(&alu.src[j], &ctx->src[j], 0);
+
+			/* RSQ should take the absolute value of src */
+			if (ctx->inst_info->tgsi_opcode == TGSI_OPCODE_RSQ) {
+				r600_bytecode_src_set_abs(&alu.src[j]);
+			}
 		}
 		tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
 		alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
-- 
1.7.9.5



More information about the mesa-dev mailing list