summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <karolherbst@gmail.com>2017-06-23 20:30:29 +0200
committerIlia Mirkin <imirkin@alum.mit.edu>2017-07-21 23:45:18 -0400
commitf98a221f2d1dc250cbba8c8944c5db623c4ada0b (patch)
treee208750cb142b38b8c148285c494e311684011a8
parentf9bfc9301466c3b0d4248627b301d2f37ce0c4ab (diff)
nv50/ir: disable mul+add to mad for precise instructions
fixes missrendering in TombRaider KHR-GL44.gpu_shader5.precise_qualifier KHR-GL45.gpu_shader5.precise_qualifier v4: disable opt only for MAD, it's fine for SAD Signed-off-by: Karol Herbst <karolherbst@gmail.com> Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index df83f18ae83..dac3e6f814c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1677,7 +1677,8 @@ AlgebraicOpt::handleADD(Instruction *add)
return false;
bool changed = false;
- if (!changed && prog->getTarget()->isOpSupported(OP_MAD, add->dType))
+ // we can't optimize to MAD if the add is precise
+ if (!add->precise && prog->getTarget()->isOpSupported(OP_MAD, add->dType))
changed = tryADDToMADOrSAD(add, OP_MAD);
if (!changed && prog->getTarget()->isOpSupported(OP_SAD, add->dType))
changed = tryADDToMADOrSAD(add, OP_SAD);
@@ -1713,7 +1714,7 @@ AlgebraicOpt::tryADDToMADOrSAD(Instruction *add, operation toOp)
return false;
if (src->getInsn()->saturate || src->getInsn()->postFactor ||
- src->getInsn()->dnz)
+ src->getInsn()->dnz || src->getInsn()->precise)
return false;
if (toOp == OP_SAD) {