i965: Fix missing "break;" in i2b/f2b, and missing AND of CMP result.
authorEric Anholt <eric@anholt.net>
Tue, 12 Oct 2010 18:36:56 +0000 (11:36 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 12 Oct 2010 20:07:40 +0000 (13:07 -0700)
Fixes glsl-fs-i2b.

src/mesa/drivers/dri/i965/brw_fs.cpp

index fd041b8bbd55c96c511b5b72d6a9ce7dde809eeb..5e5d17504b76dcdb3a8b670087c0e4c8a9a3c1ee 100644 (file)
@@ -854,8 +854,6 @@ fs_visitor::visit(ir_expression *ir)
    case ir_unop_i2f:
    case ir_unop_b2f:
    case ir_unop_b2i:
-      emit(fs_inst(BRW_OPCODE_MOV, this->result, op[0]));
-      break;
    case ir_unop_f2i:
       emit(fs_inst(BRW_OPCODE_MOV, this->result, op[0]));
       break;
@@ -863,6 +861,9 @@ fs_visitor::visit(ir_expression *ir)
    case ir_unop_i2b:
       inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], fs_reg(0.0f)));
       inst->conditional_mod = BRW_CONDITIONAL_NZ;
+      inst = emit(fs_inst(BRW_OPCODE_AND, this->result,
+                         this->result, fs_reg(1)));
+      break;
 
    case ir_unop_trunc:
       emit(fs_inst(BRW_OPCODE_RNDD, this->result, op[0]));