summaryrefslogtreecommitdiff
path: root/src/mesa
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/mesa
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/mesa')
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index 6ecc6d317c..f99a1fc450 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -781,6 +781,11 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
op[0], op[1]);
}
break;
+
+ case ir_binop_cross:
+ ir_to_mesa_emit_op2(ir, OPCODE_XPD, result_dst, op[0], op[1]);
+ break;
+
case ir_unop_sqrt:
ir_to_mesa_emit_scalar_op1(ir, OPCODE_RSQ, result_dst, op[0]);
ir_to_mesa_emit_scalar_op1(ir, OPCODE_RCP, result_dst, result_src);