From 0b8e5f384c75b56bf2ee34c317bb9d06095c798b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 22 Jul 2010 16:52:32 -0700 Subject: [PATCH] glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin. --- src/glsl/builtins/130/mix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/glsl/builtins/130/mix diff --git a/src/glsl/builtins/130/mix b/src/glsl/builtins/130/mix new file mode 100644 index 00000000000..9a1fcd70ffa --- /dev/null +++ b/src/glsl/builtins/130/mix @@ -0,0 +1,39 @@ +((function mix + (signature float + (parameters + (declare (in) float v1) + (declare (in) float v2) + (declare (in) bool a)) + ((assign (var_ref a) (var_ref v1) (var_ref v2)) + (return (var_ref v1)))) + + (signature vec2 + (parameters + (declare (in) vec2 v1) + (declare (in) vec2 v2) + (declare (in) bvec2 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (return (var_ref v1)))) + + (signature vec3 + (parameters + (declare (in) vec3 v1) + (declare (in) vec3 v2) + (declare (in) bvec3 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (return (var_ref v1)))) + + (signature vec4 + (parameters + (declare (in) vec4 v1) + (declare (in) vec4 v2) + (declare (in) bvec4 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2))) + (return (var_ref v1)))) +)) -- 2.30.2