aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/ir/atan
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/builtins/ir/atan')
-rw-r--r--src/glsl/builtins/ir/atan33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/glsl/builtins/ir/atan b/src/glsl/builtins/ir/atan
index 6dc99d74d37..3f97e0d46f1 100644
--- a/src/glsl/builtins/ir/atan
+++ b/src/glsl/builtins/ir/atan
@@ -1,14 +1,14 @@
((function atan
(signature float
(parameters
- (declare (in) float x))
+ (declare (in) float y_over_x))
((return (call asin ((expression float *
- (var_ref x)
+ (var_ref y_over_x)
(expression float rsq
(expression float +
(expression float *
- (var_ref x)
- (var_ref x))
+ (var_ref y_over_x)
+ (var_ref y_over_x))
(constant float (1.0))))))))))
(signature vec2
@@ -54,30 +54,15 @@
)
(
(declare () float r)
- (declare ( ) float abs_retval)
- (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) ))
-)
- (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (
- (declare ( ) float atan_retval)
- (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))
-)
- (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) )
+ (if (expression bool > (expression float abs (var_ref x)) (constant float (0.000100))) (
+ (assign (constant bool (1)) (x) (var_ref r) (call atan ((expression float / (var_ref y) (var_ref x)))))
(if (expression bool < (var_ref x) (constant float (0.000000)) ) (
- (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (
- (declare ( ) float assignment_tmp)
- (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )
- (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )
- )
- (
- (declare ( ) float assignment_tmp)
- (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )
- (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )
- ))
-
+ (if (expression bool >= (var_ref y) (constant float (0.000000)) )
+ ((assign (constant bool (1)) (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593)))))
+ ((assign (constant bool (1)) (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593))))))
)
(
))
-
)
(
(declare () float sgn)