Mesa (master): i965/vs: Fix gen4 comparisons used for predication.

Eric Anholt anholt at kemper.freedesktop.org
Wed Sep 7 01:02:40 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Sep  2 16:46:46 2011 -0700

i965/vs: Fix gen4 comparisons used for predication.

When we tried to retype a brw_null_reg() in CMP(), the retyping didn't
take effect because HW_REG just ignores the type field.

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

---

 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 2cea90d..344c4e0 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -203,8 +203,11 @@ vec4_visitor::CMP(dst_reg dst, src_reg src0, src_reg src1, uint32_t condition)
     * before before comparison, producing garbage results for floating
     * point comparisons.
     */
-   if (intel->gen == 4)
+   if (intel->gen == 4) {
       dst.type = src0.type;
+      if (dst.file == HW_REG)
+	 dst.fixed_hw_reg.type = dst.type;
+   }
 
    inst = new(mem_ctx) vec4_instruction(this, BRW_OPCODE_CMP, dst, src0, src1);
    inst->conditional_mod = condition;




More information about the mesa-commit mailing list