i965/vs: Fix gen4 comparisons used for predication.
authorEric Anholt <eric@anholt.net>
Fri, 2 Sep 2011 23:46:46 +0000 (16:46 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 7 Sep 2011 01:01:17 +0000 (18:01 -0700)
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@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 2cea90d0ff44aeea12339d562e4705782104461d..344c4e08eb857e5e0fa0e97c302d02ab9fa93fea 100644 (file)
@@ -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;