summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-11-17 13:20:30 -0800
committerKenneth Graunke <[email protected]>2010-11-17 13:20:30 -0800
commit671ccf593e1079d0f3e1adf42831d09da91a2b68 (patch)
tree3fe577c6e81bb6c68391edb4c4980dec8af8153a /src/glsl/builtins
parent302fe4049c1f409655eb283e20f9ab6397ac3db4 (diff)
glsl: Reimplement the "cross" built-in without ir_binop_cross.
We are not aware of any GPU that actually implements the cross product as a single instruction. Hence, there's no need for it to be an opcode. Future commits will remove it entirely.
Diffstat (limited to 'src/glsl/builtins')
-rw-r--r--src/glsl/builtins/ir/cross8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsl/builtins/ir/cross b/src/glsl/builtins/ir/cross
index 24717a2183d..02991fe4227 100644
--- a/src/glsl/builtins/ir/cross
+++ b/src/glsl/builtins/ir/cross
@@ -1,7 +1,9 @@
((function cross
(signature vec3
(parameters
- (declare (in) vec3 arg0)
- (declare (in) vec3 arg1))
- ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))
+ (declare (in) vec3 a)
+ (declare (in) vec3 b))
+ ((return (expression vec3 -
+ (expression vec3 * (swiz yzx (var_ref a)) (swiz zxy (var_ref b)))
+ (expression vec3 * (swiz zxy (var_ref a)) (swiz yzx (var_ref b)))))))
))