[Mesa-dev] [PATCH] radeonsi: compute the absolute value before RSQ

Kenneth Graunke kenneth at whitecape.org
Thu Jan 5 19:32:52 UTC 2017


On Thursday, January 5, 2017 5:47:37 PM PST Samuel Pitoiset wrote:
> As explained by Nicolai, it seems like D3D always compute the
> absolute value while GLSL says that the result of inversesqrt()
> is undefined if x <= 0. Using the absolute value looks like safer
> especially when the game has been ported from D3D to GL.
> 
> This gets rid of the NaN values in the "Spec Ops: The Line" game
> as well as the black squares.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97338
> 
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> 
> Nouveau also computes the absolute value before emitting RSQ.
> 

Would it make sense to just make the GLSL sqrt() and inversesqrt()
functions take the absolute value, so we do this for all drivers?
abs is cheap...

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170105/dab82092/attachment.sig>


More information about the mesa-dev mailing list