From: Kenneth Graunke Date: Wed, 9 Jun 2010 19:58:42 +0000 (-0700) Subject: Add remaining signatures for 'mod' builtin. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2438f64e6332fb0a5f80926f73bf3291bb3bc3ea;p=mesa.git Add remaining signatures for 'mod' builtin. --- diff --git a/builtin_function.cpp b/builtin_function.cpp index 7a6457cc95e..865f58c7557 100644 --- a/builtin_function.cpp +++ b/builtin_function.cpp @@ -1167,6 +1167,45 @@ static const char *builtins_110_mod = { " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((return (expression vec4 % (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 % (swiz x (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz y (var_ref result))\n" + " (expression float % (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 % (swiz x (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz y (var_ref result))\n" + " (expression float % (swiz y (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz z (var_ref result))\n" + " (expression float % (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 % (swiz x (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz y (var_ref result))\n" + " (expression float % (swiz y (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz z (var_ref result))\n" + " (expression float % (swiz z (var_ref arg0)) (var_ref arg1)))\n" + " (assign (constant bool (1)) (swiz w (var_ref result))\n" + " (expression float % (swiz w (var_ref arg0)) (var_ref arg1)))\n" + " (return (var_ref result))))\n" "))\n" }; diff --git a/builtins/110/mod b/builtins/110/mod index 121db4fd08e..9e08bbc7ef4 100644 --- a/builtins/110/mod +++ b/builtins/110/mod @@ -22,4 +22,43 @@ (declare (in) vec4 arg0) (declare (in) vec4 arg1)) ((return (expression vec4 % (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 % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (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 % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float % (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 % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float % (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression float % (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) ))