From: Axel Davy Date: Fri, 22 Feb 2019 19:41:00 +0000 (+0100) Subject: st/nine: Use FLT_MAX/2 for RCP clamping X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=394420ebb3eec6d8956588ee13380d5059e14bea;p=mesa.git 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 --- 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; }