From: Kenneth Graunke Date: Tue, 4 May 2010 04:29:01 +0000 (-0700) Subject: Implement "cross" builtin. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a9b1e1f06c2859f0c20375189c6ff02ed769d1a;p=mesa.git Implement "cross" builtin. --- diff --git a/builtins/110/cross b/builtins/110/cross new file mode 100644 index 00000000000..deb2f952bfc --- /dev/null +++ b/builtins/110/cross @@ -0,0 +1,17 @@ +((function cross + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1))) + (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0))))) + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1))) + (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0))))) + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1))) + (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0))))) + (return (var_ref t)))) +))