diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/builtin_function.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index f0206431fb2..942f2335eb6 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -265,14 +265,14 @@ static const char builtin_atan[] = "((function atan\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) float y_over_x))\n" " ((return (call asin ((expression float *\n" - " (var_ref x)\n" + " (var_ref y_over_x)\n" " (expression float rsq\n" " (expression float +\n" " (expression float *\n" - " (var_ref x)\n" - " (var_ref x))\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" " (constant float (1.0))))))))))\n" "\n" " (signature vec2\n" @@ -318,30 +318,15 @@ static const char builtin_atan[] = " )\n" " (\n" " (declare () float r)\n" - " (declare ( ) float abs_retval)\n" - " (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) ))\n" - ")\n" - " (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (\n" - " (declare ( ) float atan_retval)\n" - " (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))\n" - ")\n" - " (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) )\n" + " (if (expression bool > (expression float abs (var_ref x)) (constant float (0.000100))) (\n" + " (assign (constant bool (1)) (x) (var_ref r) (call atan ((expression float / (var_ref y) (var_ref x)))))\n" " (if (expression bool < (var_ref x) (constant float (0.000000)) ) (\n" - " (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n" - " (declare ( ) float assignment_tmp)\n" - " (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )\n" - " (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )\n" - " )\n" - " (\n" - " (declare ( ) float assignment_tmp)\n" - " (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )\n" - " (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )\n" - " ))\n" - "\n" + " (if (expression bool >= (var_ref y) (constant float (0.000000)) )\n" + " ((assign (constant bool (1)) (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593)))))\n" + " ((assign (constant bool (1)) (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593))))))\n" " )\n" " (\n" " ))\n" - "\n" " )\n" " (\n" " (declare () float sgn)\n" |