From: Brian Paul Date: Thu, 5 Aug 2010 22:38:22 +0000 (-0600) Subject: glsl: fix atan(0, -1) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d038a3ed2d8325c4b826f13b62398b3ed33f3ba;p=mesa.git glsl: fix atan(0, -1) Fixes fd.o bug 29388 NOTE: this is a candidate for the 7.8 branch. --- diff --git a/src/mesa/slang/library/slang_common_builtin.gc b/src/mesa/slang/library/slang_common_builtin.gc index d75354deffe..1f5ddbc1ee2 100644 --- a/src/mesa/slang/library/slang_common_builtin.gc +++ b/src/mesa/slang/library/slang_common_builtin.gc @@ -411,7 +411,7 @@ float atan(const float y, const float x) if (abs(x) > 1.0e-4) { r = atan(y / x); if (x < 0.0) { - r = r + sign(y) * 3.141593; + r = r + 3.141593 - 6.283186 * float(y < 0.0); } } else {