[Mesa-dev] atan2 piglit failures since commit d877c643b
Ilia Mirkin
imirkin at alum.mit.edu
Sat Apr 19 23:24:07 PDT 2014
On Sun, Apr 20, 2014 at 12:50 AM, Matt Turner <mattst88 at gmail.com> wrote:
> On Sat, Apr 19, 2014 at 8:26 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> Hi Matt,
>>
>> Starting with commit d877c643b ("glsl: Use M_PI_* macros."), I'm
>> seeing a few piglit failures on nvcf (GF116) for
>>
>> generated_tests/spec/glsl-1.10/execution/built-in-functions/fs-atan-vec2-vec2.shader_test
>
> Strange. They all pass for me on Haswell before and after the change.
>
>> and its vs/gs counterparts. Curiously it works fine on nv50-family
>> chips. I checked the generated shaders, and the only differences are
>> the constants[1]. Does the generated test need to be adjusted to
>> expect more (or less) precise values perhaps? Or is it likely that
>> there's some bug in the shader that was being masked by the less
>> correct constants?
>>
>> I haven't actually looked at the atan formula -- could it be that
>> those constants were "off" on purpose? Any other ideas?
>
> No, Paul's commit message for d4c80f5f confirms the constants.
>
> That only some of combinations fail for you makes me think it's
> something driver specific that this patch unwittingly uncovered.
Hm, something odd that I noticed in the generated test:
uniform vec2 arg0 1e+10 1e+10
uniform vec2 arg1 0.0 1e-10
uniform vec2 expected 1.5707964 1.5707964
uniform float tolerance 0.0022214416
draw rect -1 -1 2 2
However
>>> math.atan2(1e10, 0)
1.5707963267948966
>>> math.atan2(1e10, 1e-10)
1.5707963267948966
Has the same very wrong rounding issue that your commit fixed. I'm
still trying to work out how generated_tests/builtin_function.py
works, but I suspect it's related. And it's unclear to me whether the
tolerance takes the dimensionality into account (since it's a
tolerance on the distance between expected and result, it needs to be
scaled). But like I said, I'm still very confused by that generator
code, perhaps it does all that correctly.
-ilia
More information about the mesa-dev
mailing list