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
nans with flt_max, I guess though it's fine as long as you try to avoid
getting nans as inputs there in the first place).


>>
>> Axel
>>
>>
>>
> 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 NaN when given Inf in the vertex shader on
> some devices for example,
> 
> and I think on some devices inf and FLT_MAX give different color in the
> pixel shader.
> 
> 
> Thus why I want to test carefully what do the other vendors for all the
> shader versions (we know already there are
> 
> behaviour changes for some) and check with the behaviours mentionned
> above, before removing the clamps when MUL_ZERO_WINS.
Yes it's all quite a mess. d3d9 rules are awkward (if they are even
documented), whereas gl may do whatever (personally I would consider at
least for core contexts everything not following ieee754 rules a bug,
well maybe not for gles...).

Roland


> 
> 
> 
> Axel
> 

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to