From: Karol Herbst Date: Fri, 23 Jun 2017 18:30:29 +0000 (+0200) Subject: nv50/ir: disable mul+add to mad for precise instructions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f98a221f2d1dc250cbba8c8944c5db623c4ada0b;p=mesa.git 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 Reviewed-by: Pierre Moreau --- 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) {