Module: Mesa Branch: master Commit: 08ddfe7b2fa9f577ba00c8c05c5604460942f5a8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=08ddfe7b2fa9f577ba00c8c05c5604460942f5a8
Author: Samuel Pitoiset <samuel.pitoi...@gmail.com> Date: Mon Jun 6 21:12:15 2016 +0200 nv50/ir: use round toward 0 when converting doubles to integers Like floats, we should use the round toward 0 mode instead of the nearest one (which is the default) for doubles to integers. This fixes all arb_gpu_shader_fp64 piglits which convert doubles to integers (16 tests). Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com> Reviewed-by: Ilia Mirkin <imir...@alum.mit.edu> Cc: "11.2 12.0" <mesa-sta...@lists.freedesktop.org> --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index cd98f70..beb7b53 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -3598,7 +3598,9 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn) src0 = fetchSrc(0, pos); src1 = fetchSrc(0, pos + 1); mkOp2(OP_MERGE, TYPE_U64, dreg, src0, src1); - mkCvt(OP_CVT, dstTy, dst0[c], srcTy, dreg); + Instruction *cvt = mkCvt(OP_CVT, dstTy, dst0[c], srcTy, dreg); + if (!isFloatType(dstTy)) + cvt->rnd = ROUND_Z; pos += 2; } break; _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit