summaryrefslogtreecommitdiff
path: root/src/glsl/builtin_function.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-13 15:37:57 -0700
committerEric Anholt <eric@anholt.net>2010-07-18 18:12:12 -0700
commit9be7f638130f46a9df2bfbcd4a03b36de9e4f3aa (patch)
tree5db2a2e0c0198c2960bfcb3051ffbeeda8757573 /src/glsl/builtin_function.cpp
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/builtin_function.cpp')
-rw-r--r--src/glsl/builtin_function.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 1cf88ada16..b3a283306d 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -486,17 +486,7 @@ static const char *builtins_110_cross = {
" (parameters\n"
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
- " ((declare () vec3 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t))\n"
- " (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1)))\n"
- " (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0)))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t))\n"
- " (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1)))\n"
- " (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0)))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref t))\n"
- " (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1)))\n"
- " (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0)))))\n"
- " (return (var_ref t))))\n"
+ " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n"
"))\n"
};