[Mesa-dev] [PATCH] glsl: Fix pi/2 constant in acos built-in function

Ian Romanick idr at freedesktop.org
Mon Jun 4 23:50:17 CEST 2012


On 06/04/2012 01:31 PM, Olivier Galibert wrote:
> On Mon, Jun 04, 2012 at 01:11:13PM -0700, Ian Romanick wrote:
>> From: Ian Romanick<ian.d.romanick at intel.com>
>>
>> In single precision, 1.5707963 becomes 1.5707962513 which is too
>> small.  However, 1.5707964 becomes 1.5707963705 which is just right.
>> The value 1.5707964 is already used in asin.ir.
>>
>> NOTE: This is a candidate for stable release branches.
>
> If piglit stops bitching on that partical problem thanks to such a
> small change, it's just beautiful.

It does fix the acos issue in piglit.  The closed-source test suite that 
we use still isn't happy, but I think that just means we need better 
approximations for acos and asin.

asin(vec4(.2, .6, .8, 1.)) has an absolute error of (0.0000105351 
0.0001987219 0.0001262426 0.0000003576).  The results for .6 and .8 are 
especially bad, but even the .2 result should be better.  The 
closed-source test suite wants an absolute error of 1e-5 for asin and acos.

> Do we need a better precision atan, or should piglit just be told to
> shutup?  The shutup patch has been sent it ages ago, but I can't do
> the "more precision" one if that's what's wanted.

I think we need a better atan.  The result that it produces is not very 
good.  I plan to look into that more tonight.


More information about the mesa-dev mailing list