summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/110/atan
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/builtins/110/atan')
-rw-r--r--src/glsl/builtins/110/atan166
1 files changed, 83 insertions, 83 deletions
diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/110/atan
index bcf75718e45..84048293870 100644
--- a/src/glsl/builtins/110/atan
+++ b/src/glsl/builtins/110/atan
@@ -47,56 +47,66 @@
(var_ref y_over_x))
(constant float (1.0))))))))))
- (signature float
- (parameters
- (declare (in) float y)
- (declare (in) float x))
- ((declare () float r)
- (if (expression bool >
- (expression float abs (var_ref x))
- (constant float (.0001)))
- ((assign (constant bool (1))
- (var_ref r) (call atan ((expression float /
- (var_ref y)
- (var_ref x)))))
- (if (expression bool <
- (var_ref x)
- (constant float (0.0)))
- ((assign (constant bool (1))
- (var_ref r)
- (expression float +
- (var_ref r)
- (expression float *
- (expression float sign (var_ref y))
- (constant float (3.1415926))))))
- ()))
- ())
- (return (var_ref r))))
+ (signature float
+ (parameters
+ (declare (in ) float y)
+ (declare (in ) float x)
+ )
+ (
+ (declare () float r)
+ (declare ( ) float abs_retval)
+ (assign (constant bool (1)) (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)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))
+)
+ (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) )
+ (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)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )
+ (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) )
+ )
+ (
+ (declare ( ) float assignment_tmp)
+ (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )
+ (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) )
+ ))
+
+ )
+ (
+ ))
+
+ )
+ (
+ (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (
+ (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) )
+ )
+ (
+ (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) )
+ ))
+
+ ))
+
+ (return (var_ref r) )
+ ))
+
+
(signature vec2
(parameters
(declare (in) vec2 y)
(declare (in) vec2 x))
((declare () vec2 r)
- (if (expression bool >
- (expression vec2 abs (var_ref x))
- (constant float (.0001)))
- ((assign (constant bool (1))
- (var_ref r) (call atan ((expression vec2 /
- (var_ref y)
- (var_ref x)))))
- (if (expression bool <
- (var_ref x)
- (constant float (0.0)))
- ((assign (constant bool (1))
- (var_ref r)
- (expression vec2 +
- (var_ref r)
- (expression vec2 *
- (expression float sign (var_ref y))
- (constant float (3.1415926))))))
- ()))
- ())
+ (assign (constant bool (1))
+ (swiz x (var_ref r))
+ (call atan ((swiz x (var_ref y))
+ (swiz x (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz y (var_ref r))
+ (call atan ((swiz y (var_ref y))
+ (swiz y (var_ref x)))))
(return (var_ref r))))
(signature vec3
@@ -104,25 +114,18 @@
(declare (in) vec3 y)
(declare (in) vec3 x))
((declare () vec3 r)
- (if (expression bool >
- (expression vec3 abs (var_ref x))
- (constant float (.0001)))
- ((assign (constant bool (1))
- (var_ref r) (call atan ((expression vec3 /
- (var_ref y)
- (var_ref x)))))
- (if (expression bool <
- (var_ref x)
- (constant float (0.0)))
- ((assign (constant bool (1))
- (var_ref r)
- (expression vec3 +
- (var_ref r)
- (expression vec3 *
- (expression float sign (var_ref y))
- (constant float (3.1415926))))))
- ()))
- ())
+ (assign (constant bool (1))
+ (swiz x (var_ref r))
+ (call atan ((swiz x (var_ref y))
+ (swiz x (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz y (var_ref r))
+ (call atan ((swiz y (var_ref y))
+ (swiz y (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz z (var_ref r))
+ (call atan ((swiz z (var_ref y))
+ (swiz z (var_ref x)))))
(return (var_ref r))))
(signature vec4
@@ -130,25 +133,22 @@
(declare (in) vec4 y)
(declare (in) vec4 x))
((declare () vec4 r)
- (if (expression bool >
- (expression vec4 abs (var_ref x))
- (constant float (.0001)))
- ((assign (constant bool (1))
- (var_ref r) (call atan ((expression vec4 /
- (var_ref y)
- (var_ref x)))))
- (if (expression bool <
- (var_ref x)
- (constant float (0.0)))
- ((assign (constant bool (1))
- (var_ref r)
- (expression vec4 +
- (var_ref r)
- (expression vec4 *
- (expression float sign (var_ref y))
- (constant float (3.1415926))))))
- ()))
- ())
- (return (var_ref r))))
+ (assign (constant bool (1))
+ (swiz x (var_ref r))
+ (call atan ((swiz x (var_ref y))
+ (swiz x (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz y (var_ref r))
+ (call atan ((swiz y (var_ref y))
+ (swiz y (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz z (var_ref r))
+ (call atan ((swiz z (var_ref y))
+ (swiz z (var_ref x)))))
+ (assign (constant bool (1))
+ (swiz w (var_ref r))
+ (call atan ((swiz w (var_ref y))
+ (swiz w (var_ref x)))))
+ (return (var_ref r)))))
))