glsl: Bitwise conversion operator support in the software renderers.
authorOlivier Galibert <galibert@pobox.com>
Tue, 8 May 2012 18:40:36 +0000 (20:40 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Jun 2012 07:06:18 +0000 (00:06 -0700)
TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene).  Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c021c6956e6c0f1e03cc0227c8ff1e30fa9e15b2..22454000509fe33e5b62e7f9d9a9c88894aaa499 100644 (file)
@@ -1407,6 +1407,11 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       emit(ir, OPCODE_SNE, result_dst,
                          op[0], src_reg_for_float(0.0));
       break;
+   case ir_unop_bitcast_f2i: // Ignore these 4, they can't happen here anyway
+   case ir_unop_bitcast_f2u:
+   case ir_unop_bitcast_i2f:
+   case ir_unop_bitcast_u2f:
+      break;
    case ir_unop_trunc:
       emit(ir, OPCODE_TRUNC, result_dst, op[0]);
       break;
index e8d60f80de60a8d08bbb8560dd19dbc5482cec35..347a22f19cb6e4e206765edaa6dfc7f2707e9767 100644 (file)
@@ -1762,6 +1762,12 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
       else
          emit(ir, TGSI_OPCODE_TRUNC, result_dst, op[0]);
       break;
+   case ir_unop_bitcast_f2i:
+   case ir_unop_bitcast_f2u:
+   case ir_unop_bitcast_i2f:
+   case ir_unop_bitcast_u2f:
+      result_src = op[0];
+      break;
    case ir_unop_f2b:
       emit(ir, TGSI_OPCODE_SNE, result_dst, op[0], st_src_reg_for_float(0.0));
       break;