summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2019-02-22 20:41:00 +0100
committerAxel Davy <[email protected]>2019-04-30 19:18:49 +0200
commit394420ebb3eec6d8956588ee13380d5059e14bea (patch)
treec447e494563a458ca8b3119a056a7030f752bc35 /src/gallium
parent64a45ba7f83095a8a44a7b1104f31bab68b259fe (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/nine/nine_shader.c5
1 files 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;
}