summaryrefslogtreecommitdiff
path: root/builtin_function.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-30 15:20:06 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-05-14 16:34:46 -0700
commit67e07ad3a33192ebf8e296c1c652d29dee467ae2 (patch)
tree7c972107251431d5e7d276c9472c582e8d6ca131 /builtin_function.cpp
parentc8de850dd5b80b42f75dc339921b3d4f28db5bf5 (diff)
Refresh autogenerated builtin_function.cpp.
Diffstat (limited to 'builtin_function.cpp')
-rw-r--r--builtin_function.cpp798
1 files changed, 654 insertions, 144 deletions
diff --git a/builtin_function.cpp b/builtin_function.cpp
index ef3a5c8..909329c 100644
--- a/builtin_function.cpp
+++ b/builtin_function.cpp
@@ -163,6 +163,50 @@ static const char *builtins_110_clamp = {
"))\n"
};
+static const char *builtins_110_cos = {
+ "((function cos\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ((return (expression float cos (var_ref angle)))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ((return (expression vec2 cos (var_ref angle)))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ((return (expression vec3 cos (var_ref angle)))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ((return (expression vec4 cos (var_ref angle)))))\n"
+ "))\n"
+};
+
+static const char *builtins_110_cross = {
+ "((function cross\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 arg0)\n"
+ " (declare (in) vec3 arg1))\n"
+ " ((declare () vec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1)))\n"
+ " (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1)))\n"
+ " (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0)))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1)))\n"
+ " (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0)))))\n"
+ " (return (var_ref t))))\n"
+ "))\n"
+};
+
static const char *builtins_110_degrees = {
"((function degrees\n"
" (signature float\n"
@@ -222,8 +266,8 @@ static const char *builtins_110_equal = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -231,9 +275,9 @@ static const char *builtins_110_equal = {
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -241,10 +285,10 @@ static const char *builtins_110_equal = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -252,8 +296,8 @@ static const char *builtins_110_equal = {
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -261,9 +305,9 @@ static const char *builtins_110_equal = {
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -271,10 +315,10 @@ static const char *builtins_110_equal = {
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -351,6 +395,43 @@ static const char *builtins_110_floor = {
"))\n"
};
+static const char *builtins_110_fract = {
+ "((function fract\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ((return (expression float - (var_ref x) (expression float floor (var_ref x))))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float - (swiz w (var_ref x)) (expression float floor (swiz w (var_ref x)))))\n"
+ " (return (var_ref t))))\n"
+ "))\n"
+ "\n"
+};
+
static const char *builtins_110_greaterThan = {
"((function greaterThan\n"
" (signature bvec2\n"
@@ -358,8 +439,8 @@ static const char *builtins_110_greaterThan = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -367,9 +448,9 @@ static const char *builtins_110_greaterThan = {
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -377,10 +458,10 @@ static const char *builtins_110_greaterThan = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -388,8 +469,8 @@ static const char *builtins_110_greaterThan = {
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -397,9 +478,9 @@ static const char *builtins_110_greaterThan = {
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -407,10 +488,10 @@ static const char *builtins_110_greaterThan = {
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -422,8 +503,8 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -431,9 +512,9 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -441,10 +522,10 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -452,8 +533,8 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -461,9 +542,9 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -471,10 +552,10 @@ static const char *builtins_110_greaterThanEqual = {
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -534,8 +615,8 @@ static const char *builtins_110_lessThan = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -543,9 +624,9 @@ static const char *builtins_110_lessThan = {
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -553,10 +634,10 @@ static const char *builtins_110_lessThan = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -564,8 +645,8 @@ static const char *builtins_110_lessThan = {
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -573,9 +654,9 @@ static const char *builtins_110_lessThan = {
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -583,10 +664,10 @@ static const char *builtins_110_lessThan = {
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -598,8 +679,8 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -607,9 +688,9 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -617,10 +698,10 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -628,8 +709,8 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -637,9 +718,9 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -647,10 +728,10 @@ static const char *builtins_110_lessThanEqual = {
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -978,6 +1059,294 @@ static const char *builtins_110_radians = {
"))\n"
};
+static const char *builtins_110_sign = {
+ "((function sign\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ((return (expression float sign (var_ref x)))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float sign (swiz w (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "))\n"
+ "\n"
+};
+
+static const char *builtins_110_sin = {
+ "((function sin\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ((return (expression float sin (var_ref angle)))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ((return (expression vec2 sin (var_ref angle)))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ((return (expression vec3 sin (var_ref angle)))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ((return (expression vec4 sin (var_ref angle)))))\n"
+ "))\n"
+};
+
+static const char *builtins_110_smoothstep = {
+ "((function smoothstep\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) float x))\n"
+ " ((declare () float t)\n"
+ "\n"
+ " (assign (constant bool (1)) (var_ref t)\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (declare () vec2 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (declare () vec3 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (declare () vec4 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge0)\n"
+ " (declare (in) vec2 edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (declare () vec2 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge0)\n"
+ " (declare (in) vec3 edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (declare () vec3 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge0)\n"
+ " (declare (in) vec4 edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (declare () vec4 retval)\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ "\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t))\n"
+ " (expression float max\n"
+ " (expression float min\n"
+ " (expression float / (expression float - (swiz w (var_ref x)) (swiz w (var_ref edge0))) (expression float - (swiz w (var_ref edge1)) (swiz w (var_ref edge0))))\n"
+ " (constant float (1.0)))\n"
+ " (constant float (0.0))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
+ " (return (var_ref retval))\n"
+ " ))\n"
+ "\n"
+ "))\n"
+ "\n"
+};
+
static const char *builtins_110_sqrt = {
"((function sqrt\n"
" (signature float\n"
@@ -1002,18 +1371,116 @@ static const char *builtins_110_sqrt = {
"))\n"
};
+static const char *builtins_110_step = {
+ "((function step\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) float x))\n"
+ " ((return (expression float b2f (expression bool < (var_ref x) (var_ref edge))))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(var_ref edge))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ((declare () vec2 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ((declare () vec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(swiz z (var_ref edge)))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ((declare () vec4 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz z (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(swiz w (var_ref edge)))))\n"
+ " (return (var_ref t))))\n"
+ "))\n"
+ "\n"
+};
+
+static const char *builtins_110_tan = {
+ "((function tan\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ((return (expression float / (expression float sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ((return (expression float / (expression float sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ((return (expression float / (expression float sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n"
+ "))\n"
+};
+
static const char *functions_for_110 [] = {
builtins_110_abs,
builtins_110_all,
builtins_110_any,
builtins_110_ceil,
builtins_110_clamp,
+ builtins_110_cos,
+ builtins_110_cross,
builtins_110_degrees,
builtins_110_dot,
builtins_110_equal,
builtins_110_exp,
builtins_110_exp2,
builtins_110_floor,
+ builtins_110_fract,
builtins_110_greaterThan,
builtins_110_greaterThanEqual,
builtins_110_inversesqrt,
@@ -1031,7 +1498,12 @@ static const char *functions_for_110 [] = {
builtins_110_notEqual,
builtins_110_pow,
builtins_110_radians,
+ builtins_110_sign,
+ builtins_110_sin,
+ builtins_110_smoothstep,
builtins_110_sqrt,
+ builtins_110_step,
+ builtins_110_tan,
};
/* Version 130 builtins */
@@ -1043,8 +1515,8 @@ static const char *builtins_130_equal = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1052,9 +1524,9 @@ static const char *builtins_130_equal = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1062,10 +1534,10 @@ static const char *builtins_130_equal = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -1077,8 +1549,8 @@ static const char *builtins_130_greaterThan = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1086,9 +1558,9 @@ static const char *builtins_130_greaterThan = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1096,10 +1568,10 @@ static const char *builtins_130_greaterThan = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -1111,8 +1583,8 @@ static const char *builtins_130_greaterThanEqual = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1120,9 +1592,9 @@ static const char *builtins_130_greaterThanEqual = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1130,10 +1602,10 @@ static const char *builtins_130_greaterThanEqual = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -1145,8 +1617,8 @@ static const char *builtins_130_lessThan = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1154,9 +1626,9 @@ static const char *builtins_130_lessThan = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1164,10 +1636,10 @@ static const char *builtins_130_lessThan = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -1179,8 +1651,8 @@ static const char *builtins_130_lessThanEqual = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1188,9 +1660,9 @@ static const char *builtins_130_lessThanEqual = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1198,10 +1670,10 @@ static const char *builtins_130_lessThanEqual = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
@@ -1213,8 +1685,8 @@ static const char *builtins_130_notEqual = {
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1222,9 +1694,9 @@ static const char *builtins_130_notEqual = {
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1232,14 +1704,51 @@ static const char *builtins_130_notEqual = {
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression uint != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression uint != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression uint != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression uint != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
" (return (var_ref temp))))\n"
"))\n"
};
+static const char *builtins_130_sign = {
+ "((function sign\n"
+ " (signature int\n"
+ " (parameters\n"
+ " (declare (in) int x))\n"
+ " ((return (expression int / (var_ref x) (expression int abs (var_ref x))))))\n"
+ "\n"
+ " (signature ivec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x))\n"
+ " ((declare () ivec2 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature ivec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x))\n"
+ " ((declare () ivec3 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "\n"
+ " (signature ivec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x))\n"
+ " ((declare () ivec4 t)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x))))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref t)) (expression int sign (swiz w (var_ref x))))\n"
+ " (return (var_ref t))))\n"
+ "))\n"
+ "\n"
+};
+
static const char *functions_for_130 [] = {
builtins_130_equal,
builtins_130_greaterThan,
@@ -1247,6 +1756,7 @@ static const char *functions_for_130 [] = {
builtins_130_lessThan,
builtins_130_lessThanEqual,
builtins_130_notEqual,
+ builtins_130_sign,
};
void