From 394420ebb3eec6d8956588ee13380d5059e14bea Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Fri, 22 Feb 2019 20:41:00 +0100 Subject: [PATCH] st/nine: Use FLT_MAX/2 for RCP clamping This seems to fix Rayman (which adds things to the RCP result, and thus gets an Inf), while not having regressions. Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/nine_shader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 145647bc3f8..49e7c9407bb 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -2333,8 +2333,9 @@ DECL_SPECIAL(RCP) struct ureg_dst tmp = tx->mul_zero_wins ? dst : tx_scratch(tx); ureg_RCP(ureg, tmp, src); if (!tx->mul_zero_wins) { - ureg_MIN(ureg, tmp, ureg_imm1f(ureg, FLT_MAX), ureg_src(tmp)); - ureg_MAX(ureg, dst, ureg_imm1f(ureg, -FLT_MAX), ureg_src(tmp)); + /* FLT_MAX has issues with Rayman */ + ureg_MIN(ureg, tmp, ureg_imm1f(ureg, FLT_MAX/2.f), ureg_src(tmp)); + ureg_MAX(ureg, dst, ureg_imm1f(ureg, -FLT_MAX/2.f), ureg_src(tmp)); } return D3D_OK; } -- 2.30.2