From e4afc64290a7917fa388f4395ed7066eaba519a5 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 28 Apr 2010 22:57:47 -0700 Subject: [PATCH] Initial commit of IR for builtins. These were all generated by Eric's existing builtin_functions.cpp; I split the uvec* signatures out of 110 into the 130 folder. --- builtins/110/abs | 21 ++++++++++++ builtins/110/all | 16 +++++++++ builtins/110/any | 16 +++++++++ builtins/110/ceil | 21 ++++++++++++ builtins/110/clamp | 29 +++++++++++++++++ builtins/110/degrees | 21 ++++++++++++ builtins/110/dot | 25 ++++++++++++++ builtins/110/equal | 61 +++++++++++++++++++++++++++++++++++ builtins/110/exp | 21 ++++++++++++ builtins/110/exp2 | 21 ++++++++++++ builtins/110/floor | 21 ++++++++++++ builtins/110/greaterThan | 61 +++++++++++++++++++++++++++++++++++ builtins/110/greaterThanEqual | 61 +++++++++++++++++++++++++++++++++++ builtins/110/inversesqrt | 21 ++++++++++++ builtins/110/length | 21 ++++++++++++ builtins/110/lessThan | 61 +++++++++++++++++++++++++++++++++++ builtins/110/lessThanEqual | 61 +++++++++++++++++++++++++++++++++++ builtins/110/log | 21 ++++++++++++ builtins/110/log2 | 21 ++++++++++++ builtins/110/max | 25 ++++++++++++++ builtins/110/min | 25 ++++++++++++++ builtins/110/mix | 29 +++++++++++++++++ builtins/110/mod | 25 ++++++++++++++ builtins/110/normalize | 21 ++++++++++++ builtins/110/not | 16 +++++++++ builtins/110/notEqual | 61 +++++++++++++++++++++++++++++++++++ builtins/110/pow | 25 ++++++++++++++ builtins/110/radians | 21 ++++++++++++ builtins/110/sqrt | 21 ++++++++++++ builtins/130/equal | 31 ++++++++++++++++++ builtins/130/greaterThan | 31 ++++++++++++++++++ builtins/130/greaterThanEqual | 31 ++++++++++++++++++ builtins/130/lessThan | 31 ++++++++++++++++++ builtins/130/lessThanEqual | 31 ++++++++++++++++++ builtins/130/notEqual | 31 ++++++++++++++++++ 35 files changed, 1056 insertions(+) create mode 100644 builtins/110/abs create mode 100644 builtins/110/all create mode 100644 builtins/110/any create mode 100644 builtins/110/ceil create mode 100644 builtins/110/clamp create mode 100644 builtins/110/degrees create mode 100644 builtins/110/dot create mode 100644 builtins/110/equal create mode 100644 builtins/110/exp create mode 100644 builtins/110/exp2 create mode 100644 builtins/110/floor create mode 100644 builtins/110/greaterThan create mode 100644 builtins/110/greaterThanEqual create mode 100644 builtins/110/inversesqrt create mode 100644 builtins/110/length create mode 100644 builtins/110/lessThan create mode 100644 builtins/110/lessThanEqual create mode 100644 builtins/110/log create mode 100644 builtins/110/log2 create mode 100644 builtins/110/max create mode 100644 builtins/110/min create mode 100644 builtins/110/mix create mode 100644 builtins/110/mod create mode 100644 builtins/110/normalize create mode 100644 builtins/110/not create mode 100644 builtins/110/notEqual create mode 100644 builtins/110/pow create mode 100644 builtins/110/radians create mode 100644 builtins/110/sqrt create mode 100644 builtins/130/equal create mode 100644 builtins/130/greaterThan create mode 100644 builtins/130/greaterThanEqual create mode 100644 builtins/130/lessThan create mode 100644 builtins/130/lessThanEqual create mode 100644 builtins/130/notEqual diff --git a/builtins/110/abs b/builtins/110/abs new file mode 100644 index 00000000000..904845307c4 --- /dev/null +++ b/builtins/110/abs @@ -0,0 +1,21 @@ +((function abs + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 abs (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 abs (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 abs (var_ref arg0))))) +)) diff --git a/builtins/110/all b/builtins/110/all new file mode 100644 index 00000000000..2cac0dfb684 --- /dev/null +++ b/builtins/110/all @@ -0,0 +1,16 @@ +((function all + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) +)) diff --git a/builtins/110/any b/builtins/110/any new file mode 100644 index 00000000000..f10e8a7b478 --- /dev/null +++ b/builtins/110/any @@ -0,0 +1,16 @@ +((function any + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool || (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) +)) diff --git a/builtins/110/ceil b/builtins/110/ceil new file mode 100644 index 00000000000..a26a7750493 --- /dev/null +++ b/builtins/110/ceil @@ -0,0 +1,21 @@ +((function ceil + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float ceil (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 ceil (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 ceil (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 ceil (var_ref arg0))))) +)) diff --git a/builtins/110/clamp b/builtins/110/clamp new file mode 100644 index 00000000000..1ae44db46ca --- /dev/null +++ b/builtins/110/clamp @@ -0,0 +1,29 @@ +((function clamp + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) +)) diff --git a/builtins/110/degrees b/builtins/110/degrees new file mode 100644 index 00000000000..dc0d7b9e20d --- /dev/null +++ b/builtins/110/degrees @@ -0,0 +1,21 @@ +((function degrees + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) +)) diff --git a/builtins/110/dot b/builtins/110/dot new file mode 100644 index 00000000000..a91a6d2c56d --- /dev/null +++ b/builtins/110/dot @@ -0,0 +1,25 @@ +((function dot + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) +)) diff --git a/builtins/110/equal b/builtins/110/equal new file mode 100644 index 00000000000..0061cb28e4a --- /dev/null +++ b/builtins/110/equal @@ -0,0 +1,61 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/exp b/builtins/110/exp new file mode 100644 index 00000000000..a73bd6a7f84 --- /dev/null +++ b/builtins/110/exp @@ -0,0 +1,21 @@ +((function exp + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp (var_ref arg0))))) +)) diff --git a/builtins/110/exp2 b/builtins/110/exp2 new file mode 100644 index 00000000000..a842d3fe65b --- /dev/null +++ b/builtins/110/exp2 @@ -0,0 +1,21 @@ +((function exp2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp2 (var_ref arg0))))) +)) diff --git a/builtins/110/floor b/builtins/110/floor new file mode 100644 index 00000000000..8dd8052799b --- /dev/null +++ b/builtins/110/floor @@ -0,0 +1,21 @@ +((function floor + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float floor (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 floor (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 floor (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 floor (var_ref arg0))))) +)) diff --git a/builtins/110/greaterThan b/builtins/110/greaterThan new file mode 100644 index 00000000000..8a95cc0478a --- /dev/null +++ b/builtins/110/greaterThan @@ -0,0 +1,61 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/greaterThanEqual b/builtins/110/greaterThanEqual new file mode 100644 index 00000000000..b6c6ab8f2bd --- /dev/null +++ b/builtins/110/greaterThanEqual @@ -0,0 +1,61 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/inversesqrt b/builtins/110/inversesqrt new file mode 100644 index 00000000000..5b66d2b3695 --- /dev/null +++ b/builtins/110/inversesqrt @@ -0,0 +1,21 @@ +((function inversesqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float rsq (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 rsq (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 rsq (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 rsq (var_ref arg0))))) +)) diff --git a/builtins/110/length b/builtins/110/length new file mode 100644 index 00000000000..89ff7f3ef12 --- /dev/null +++ b/builtins/110/length @@ -0,0 +1,21 @@ +((function length + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec2 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec3 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec4 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) +)) diff --git a/builtins/110/lessThan b/builtins/110/lessThan new file mode 100644 index 00000000000..433acad1fe1 --- /dev/null +++ b/builtins/110/lessThan @@ -0,0 +1,61 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/lessThanEqual b/builtins/110/lessThanEqual new file mode 100644 index 00000000000..d4f2d89efd2 --- /dev/null +++ b/builtins/110/lessThanEqual @@ -0,0 +1,61 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/log b/builtins/110/log new file mode 100644 index 00000000000..d168abb5a73 --- /dev/null +++ b/builtins/110/log @@ -0,0 +1,21 @@ +((function log + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log (var_ref arg0))))) +)) diff --git a/builtins/110/log2 b/builtins/110/log2 new file mode 100644 index 00000000000..b96c6276f0a --- /dev/null +++ b/builtins/110/log2 @@ -0,0 +1,21 @@ +((function log2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log2 (var_ref arg0))))) +)) diff --git a/builtins/110/max b/builtins/110/max new file mode 100644 index 00000000000..0dc3ffb5e41 --- /dev/null +++ b/builtins/110/max @@ -0,0 +1,25 @@ +((function max + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) +)) diff --git a/builtins/110/min b/builtins/110/min new file mode 100644 index 00000000000..f9820ef8286 --- /dev/null +++ b/builtins/110/min @@ -0,0 +1,25 @@ +((function min + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) +)) diff --git a/builtins/110/mix b/builtins/110/mix new file mode 100644 index 00000000000..6bdac74f6ff --- /dev/null +++ b/builtins/110/mix @@ -0,0 +1,29 @@ +((function mix + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) +)) diff --git a/builtins/110/mod b/builtins/110/mod new file mode 100644 index 00000000000..121db4fd08e --- /dev/null +++ b/builtins/110/mod @@ -0,0 +1,25 @@ +((function mod + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) +)) diff --git a/builtins/110/normalize b/builtins/110/normalize new file mode 100644 index 00000000000..be88a9830d1 --- /dev/null +++ b/builtins/110/normalize @@ -0,0 +1,21 @@ +((function normalize + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) +)) diff --git a/builtins/110/not b/builtins/110/not new file mode 100644 index 00000000000..b696b06557f --- /dev/null +++ b/builtins/110/not @@ -0,0 +1,16 @@ +((function not + (signature bvec2 + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bvec2 ! (var_ref arg0))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bvec3 ! (var_ref arg0))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bvec4 ! (var_ref arg0))))) +)) diff --git a/builtins/110/notEqual b/builtins/110/notEqual new file mode 100644 index 00000000000..c87efa317f7 --- /dev/null +++ b/builtins/110/notEqual @@ -0,0 +1,61 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/110/pow b/builtins/110/pow new file mode 100644 index 00000000000..a61bc4418e3 --- /dev/null +++ b/builtins/110/pow @@ -0,0 +1,25 @@ +((function pow + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float pow (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) +)) diff --git a/builtins/110/radians b/builtins/110/radians new file mode 100644 index 00000000000..6a0f5d2e219 --- /dev/null +++ b/builtins/110/radians @@ -0,0 +1,21 @@ +((function radians + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (0.017453)))))) +)) diff --git a/builtins/110/sqrt b/builtins/110/sqrt new file mode 100644 index 00000000000..0302d164ae5 --- /dev/null +++ b/builtins/110/sqrt @@ -0,0 +1,21 @@ +((function sqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 sqrt (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 sqrt (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 sqrt (var_ref arg0))))) +)) diff --git a/builtins/130/equal b/builtins/130/equal new file mode 100644 index 00000000000..5060155ab34 --- /dev/null +++ b/builtins/130/equal @@ -0,0 +1,31 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/130/greaterThan b/builtins/130/greaterThan new file mode 100644 index 00000000000..c17d4644ba8 --- /dev/null +++ b/builtins/130/greaterThan @@ -0,0 +1,31 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/130/greaterThanEqual b/builtins/130/greaterThanEqual new file mode 100644 index 00000000000..c9d0b23723c --- /dev/null +++ b/builtins/130/greaterThanEqual @@ -0,0 +1,31 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/130/lessThan b/builtins/130/lessThan new file mode 100644 index 00000000000..4ed489da2bd --- /dev/null +++ b/builtins/130/lessThan @@ -0,0 +1,31 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/130/lessThanEqual b/builtins/130/lessThanEqual new file mode 100644 index 00000000000..92ae2dff12a --- /dev/null +++ b/builtins/130/lessThanEqual @@ -0,0 +1,31 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/builtins/130/notEqual b/builtins/130/notEqual new file mode 100644 index 00000000000..d49e2cb7730 --- /dev/null +++ b/builtins/130/notEqual @@ -0,0 +1,31 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) -- 2.30.2