glsl2: Fix the implementation of atan(y, x).
authorEric Anholt <eric@anholt.net>
Fri, 30 Jul 2010 17:20:34 +0000 (10:20 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 30 Jul 2010 22:19:00 +0000 (15:19 -0700)
commit3fa1b85196b7d57c6c139e62000ac519b1b2320c
tree45f9c77753353f9bf47d22429934be0ea3244018
parentec9675ec533cc0c0c7b1c738280e9b9adf2591fb
glsl2: Fix the implementation of atan(y, x).

So many problems here.  One is that we can't do the quadrant handling
for all the channels at the same time, so we call the float(y, x)
version multiple times.  I'd also left out the x == 0 handling.  Also,
the quadrant handling was broken for y == 0, so there was a funny
discontinuity on the +x side if you plugged in obvious values to test.

I generated the atan(float y, float x) code from a short segment of
GLSL and pasted it in by hand.  It would be nice to automate that
somehow.

Fixes:
glsl-fs-atan-1
glsl-fs-atan-2
src/glsl/builtin_function.cpp
src/glsl/builtins/110/atan