aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-13 15:37:57 -0700
committerEric Anholt <[email protected]>2010-07-18 18:12:12 -0700
commit9be7f638130f46a9df2bfbcd4a03b36de9e4f3aa (patch)
tree5db2a2e0c0198c2960bfcb3051ffbeeda8757573 /src/glsl/builtins
parent87a2ee8db6222006480bd0e0ac58b77795c5d951 (diff)
glsl2: Make cross() be an expression operation.
ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have instructions for cross. Shaves 12 Mesa instructions off of a 66-instruction shader I have.
Diffstat (limited to 'src/glsl/builtins')
-rw-r--r--src/glsl/builtins/110/cross12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/glsl/builtins/110/cross b/src/glsl/builtins/110/cross
index deb2f952bfc..24717a2183d 100644
--- a/src/glsl/builtins/110/cross
+++ b/src/glsl/builtins/110/cross
@@ -3,15 +3,5 @@
(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))))
+ ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))
))