ir_to_mesa: Fix up implementation of ir_unop_exp.
authorEric Anholt <eric@anholt.net>
Sat, 3 Jul 2010 00:02:42 +0000 (17:02 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 3 Jul 2010 00:06:32 +0000 (17:06 -0700)
OPCODE_EXP is not to ir_unop_exp what OPCODE_EX2 is to ir_unop_exp2.
It's the weird VP approximation helper opcode.  Just implement it with
OPCODE_POW instead.

Fixes glsl-fs-exp.

src/mesa/shader/ir_to_mesa.cpp

index f8858af26d6684465be72b2a425bcf3252d61e41..87d6f8452a26f8cad4b687ed41b3542866a52314 100644 (file)
@@ -625,7 +625,8 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       break;
 
    case ir_unop_exp:
-      ir_to_mesa_emit_scalar_op1(ir, OPCODE_EXP, result_dst, op[0]);
+      ir_to_mesa_emit_scalar_op2(ir, OPCODE_POW, result_dst,
+                                src_reg_for_float(M_E), op[0]);
       break;
    case ir_unop_exp2:
       ir_to_mesa_emit_scalar_op1(ir, OPCODE_EX2, result_dst, op[0]);