summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-09-25 17:20:38 +0200
committerMarek Olšák <[email protected]>2012-09-27 19:14:44 +0200
commitfd5c5384648a0d6191c19748a2d1f1148c5ee98f (patch)
treebefadad86ad66d88b95e972f0872f6458e55398d /src
parent836325bf7edd797e02ab0717a05ca5c51aa1ac93 (diff)
r600g: fix RSQ of negative value on Cayman
NOTE: This is a candidate for the stable branches.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 6e475933175..7df549ba702 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;