Mesa (master): Revert "i965/fs: Fix conversions float->bool, int->bool"

Eric Anholt anholt at kemper.freedesktop.org
Tue Nov 20 06:40:17 UTC 2012


Module: Mesa
Branch: master
Commit: afc5a26b5c48f9f2399a092228ad8d6da0c42711
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=afc5a26b5c48f9f2399a092228ad8d6da0c42711

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 12 13:16:02 2012 -0800

Revert "i965/fs: Fix conversions float->bool, int->bool"

This reverts commit cf0bbb30f6bd9d3fa61b5207320e8f34c563a2c6.  It
was just papering over the bug fixed in the previous commit.

Acked-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 3c0a27b..edadd35 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -501,16 +501,16 @@ fs_visitor::visit(ir_expression *ir)
       break;
 
    case ir_unop_f2b:
-      inst = emit(BRW_OPCODE_CMP, this->result, op[0], fs_reg(0.0f));
-      inst->conditional_mod = BRW_CONDITIONAL_NZ;
-      emit(BRW_OPCODE_AND, this->result, this->result, fs_reg(1));
-      break;
    case ir_unop_i2b:
-      assert(op[0].type == BRW_REGISTER_TYPE_D);
+      temp = this->result;
+      /* original gen4 does implicit conversion before comparison. */
+      if (intel->gen < 5)
+	 temp.type = op[0].type;
+
+      resolve_ud_negate(&op[0]);
 
-      inst = emit(BRW_OPCODE_CMP, this->result, op[0], fs_reg(0));
+      inst = emit(BRW_OPCODE_CMP, temp, op[0], fs_reg(0.0f));
       inst->conditional_mod = BRW_CONDITIONAL_NZ;
-      emit(BRW_OPCODE_AND, this->result, this->result, fs_reg(1));
       break;
 
    case ir_unop_trunc:




More information about the mesa-commit mailing list