Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Axel Davy
On 9/12/18 11:44 PM, Roland Scheidegger wrote: Am 12.09.2018 um 23:43 schrieb Roland Scheidegger: I small precision I want to add: This is not the only place clamping makes a difference. Indeed else MUL_ZERO_WINS would be safe to use and remove all the clamping. The rasterizers can produce

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Roland Scheidegger
Am 12.09.2018 um 23:43 schrieb Roland Scheidegger: > Am 12.09.2018 um 08:31 schrieb Axel Davy: >> On 9/12/18 8:17 AM, Axel Davy wrote: >>> >>> The goal is to catch inf and -inf and replace them by FLT_MAX and >>> -FLT_MAX. >>> >>> Without, the NaN would appear when doing mul or mad. > Ah I somehow

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Roland Scheidegger
Am 12.09.2018 um 08:31 schrieb Axel Davy: > On 9/12/18 8:17 AM, Axel Davy wrote: >> >> The goal is to catch inf and -inf and replace them by FLT_MAX and >> -FLT_MAX. >> >> Without, the NaN would appear when doing mul or mad. Ah I somehow completely missed this (but indeed this code will replace

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Axel Davy
On 9/9/18 9:40 PM, Ilia Mirkin wrote: On Sun, Sep 9, 2018 at 3:19 PM, Axel Davy wrote: Tests showed Intel on windows does always clamp RCP, RSQ and LOG (thus preventing inf/nan generation), for all shader versions (some vendor behaviours vary with shader versions). By the way, this happens

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Axel Davy
On 9/12/18 8:17 AM, Axel Davy wrote: The goal is to catch inf and -inf and replace them by FLT_MAX and -FLT_MAX. Without, the NaN would appear when doing mul or mad. Axel I small precision I want to add: This is not the only place clamping makes a difference. Indeed else MUL_ZERO_WINS

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-12 Thread Axel Davy
On 9/11/18 11:28 PM, Roland Scheidegger wrote: Am 09.09.2018 um 21:19 schrieb Axel Davy: Tests done on several devices of all 3 vendors and of different generations showed that there are several ways of handling infs and NaN for d3d9. Tests showed Intel on windows does always clamp RCP, RSQ

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-11 Thread Roland Scheidegger
Am 09.09.2018 um 21:19 schrieb Axel Davy: > Tests done on several devices of all 3 vendors and > of different generations showed that there are several > ways of handling infs and NaN for d3d9. > > Tests showed Intel on windows does always clamp > RCP, RSQ and LOG (thus preventing inf/nan

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-09 Thread Axel Davy
On 9/9/18 9:40 PM, Ilia Mirkin wrote: On Sun, Sep 9, 2018 at 3:19 PM, Axel Davy wrote: Tests showed Intel on windows does always clamp RCP, RSQ and LOG (thus preventing inf/nan generation), for all shader versions (some vendor behaviours vary with shader versions). By the way, this happens

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-09 Thread Axel Davy
On 9/9/18 9:35 PM, Ilia Mirkin wrote: On Sun, Sep 9, 2018 at 3:19 PM, Axel Davy wrote: For now clamp for all drivers. An ulterior optimization would be to avoid clamping for drivers with MUL_ZERO_WINS for the specific shader versions where NV or AMD don't clamp. Too bad. The whole point of

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-09 Thread Ilia Mirkin
On Sun, Sep 9, 2018 at 3:19 PM, Axel Davy wrote: > Tests showed Intel on windows does always clamp > RCP, RSQ and LOG (thus preventing inf/nan generation), > for all shader versions (some vendor behaviours vary > with shader versions). By the way, this happens because on Intel, the ALU is put

Re: [Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-09 Thread Ilia Mirkin
On Sun, Sep 9, 2018 at 3:19 PM, Axel Davy wrote: > For now clamp for all drivers. An ulterior optimization > would be to avoid clamping for drivers with MUL_ZERO_WINS > for the specific shader versions where NV or AMD don't > clamp. Too bad. The whole point of this feature was for nine to use

[Mesa-dev] [PATCH 1/5] st/nine: Clamp RCP when 0*inf!=0

2018-09-09 Thread Axel Davy
Tests done on several devices of all 3 vendors and of different generations showed that there are several ways of handling infs and NaN for d3d9. Tests showed Intel on windows does always clamp RCP, RSQ and LOG (thus preventing inf/nan generation), for all shader versions (some vendor behaviours