[Mesa-dev] NaN behavior in GLSL (was Re: [PATCH] glsl: always do sqrt(abs()) and inversesqrt(abs()))

Matteo Bruni matteo.mystral at gmail.com
Thu Jan 12 22:47:02 UTC 2017


2017-01-12 23:41 GMT+01:00 Axel Davy <axel.davy at ens.fr>:
>> Do you refer to the d3d9 MAD or the hardware instruction? If the
>> former, just generating MUL and ADD separately should do the trick. In
>> the latter case, I guess that means the "NaN switch" should also
>> affect code generation (although I think that should be already
>> covered by the "precise" qualifier.)
>>
> all radeon card released so far have special instructions for both mul and
> mad to have 0*inf = 0.
>
>
> I guess you'd need some gl extension to use them if available.

I see. Does it need to be a separate extension though? I.e. isn't it
enough if the driver uses those special instructions when we don't
want NaN and use the normal instructions otherwise?


More information about the mesa-dev mailing list