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.
This commit is contained in:
Eric Anholt
2010-07-13 15:37:57 -07:00
parent 87a2ee8db6
commit 9be7f63813
6 changed files with 22 additions and 23 deletions

View File

@@ -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);