summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--builtin_function.cpp39
-rw-r--r--builtins/110/max39
2 files changed, 78 insertions, 0 deletions
diff --git a/builtin_function.cpp b/builtin_function.cpp
index 9cc70ee1a75..d61c2bde56f 100644
--- a/builtin_function.cpp
+++ b/builtin_function.cpp
@@ -1058,6 +1058,45 @@ static const char *builtins_110_max = {
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 arg0)\n"
+ " (declare (in) float arg1))\n"
+ " ((declare () vec2 result)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref result))\n"
+ " (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref result))\n"
+ " (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
+ " (return (var_ref result))))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 arg0)\n"
+ " (declare (in) float arg1))\n"
+ " ((declare () vec3 result)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref result))\n"
+ " (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref result))\n"
+ " (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref result))\n"
+ " (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
+ " (return (var_ref result))))\n"
+ " \n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 arg0)\n"
+ " (declare (in) float arg1))\n"
+ " ((declare () vec4 result)\n"
+ " (assign (constant bool (1)) (swiz x (var_ref result))\n"
+ " (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz y (var_ref result))\n"
+ " (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz z (var_ref result))\n"
+ " (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))\n"
+ " (assign (constant bool (1)) (swiz w (var_ref result))\n"
+ " (expression float max (swiz w (var_ref arg0)) (var_ref arg1)))\n"
+ " (return (var_ref result))))\n"
"))\n"
};
diff --git a/builtins/110/max b/builtins/110/max
index 0dc3ffb5e41..c05545f3d93 100644
--- a/builtins/110/max
+++ b/builtins/110/max
@@ -22,4 +22,43 @@
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))
+
+ (signature vec2
+ (parameters
+ (declare (in) vec2 arg0)
+ (declare (in) float arg1))
+ ((declare () vec2 result)
+ (assign (constant bool (1)) (swiz x (var_ref result))
+ (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz y (var_ref result))
+ (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))
+ (return (var_ref result))))
+
+ (signature vec3
+ (parameters
+ (declare (in) vec3 arg0)
+ (declare (in) float arg1))
+ ((declare () vec3 result)
+ (assign (constant bool (1)) (swiz x (var_ref result))
+ (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz y (var_ref result))
+ (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz z (var_ref result))
+ (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))
+ (return (var_ref result))))
+
+ (signature vec4
+ (parameters
+ (declare (in) vec4 arg0)
+ (declare (in) float arg1))
+ ((declare () vec4 result)
+ (assign (constant bool (1)) (swiz x (var_ref result))
+ (expression float max (swiz x (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz y (var_ref result))
+ (expression float max (swiz y (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz z (var_ref result))
+ (expression float max (swiz z (var_ref arg0)) (var_ref arg1)))
+ (assign (constant bool (1)) (swiz w (var_ref result))
+ (expression float max (swiz w (var_ref arg0)) (var_ref arg1)))
+ (return (var_ref result))))
))