From 3d038a3ed2d8325c4b826f13b62398b3ed33f3ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Aug 2010 16:38:22 -0600 Subject: [PATCH] glsl: fix atan(0, -1) Fixes fd.o bug 29388 NOTE: this is a candidate for the 7.8 branch. --- src/mesa/slang/library/slang_common_builtin.gc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 2.30.2