From 9be7f638130f46a9df2bfbcd4a03b36de9e4f3aa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Jul 2010 15:37:57 -0700 Subject: 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. --- src/mesa/shader/ir_to_mesa.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/shader') 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); -- cgit v1.2.3