i915g: Fix bug in shader optimizer.
authorStéphane Marchesin <marcheu@chromium.org>
Thu, 22 Sep 2011 00:53:22 +0000 (17:53 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Thu, 22 Sep 2011 01:01:39 +0000 (18:01 -0700)
src/gallium/drivers/i915/i915_fpc_optimize.c

index 2b739e9ccb80b4cd2f686a030cccf3272345eb4c..654a8f81a0997927ff7b1125b9ebda27989347eb 100644 (file)
@@ -130,7 +130,7 @@ static void i915_fpc_optimize_mov_after_alu(union i915_full_token* current, unio
         op_commutes(current->FullInstruction.Instruction.Opcode) &&
         current->FullInstruction.Instruction.Saturate == next->FullInstruction.Instruction.Saturate &&
         next->FullInstruction.Instruction.Opcode == TGSI_OPCODE_MOV &&
-        same_dst_reg(&next->FullInstruction.Dst[0], &next->FullInstruction.Dst[0]) &&
+        same_dst_reg(&next->FullInstruction.Dst[0], &current->FullInstruction.Dst[0]) &&
         same_src_reg(&next->FullInstruction.Src[0], &current->FullInstruction.Src[1]) &&
         is_unswizzled(&current->FullInstruction.Src[0], current->FullInstruction.Dst[0].Register.WriteMask) &&
         is_unswizzled(&current->FullInstruction.Src[1], current->FullInstruction.Dst[0].Register.WriteMask) &&
@@ -153,7 +153,7 @@ static void i915_fpc_optimize_mov_after_alu(union i915_full_token* current, unio
         op_commutes(current->FullInstruction.Instruction.Opcode) &&
         current->FullInstruction.Instruction.Saturate == next->FullInstruction.Instruction.Saturate &&
         next->FullInstruction.Instruction.Opcode == TGSI_OPCODE_MOV &&
-        same_dst_reg(&next->FullInstruction.Dst[0], &next->FullInstruction.Dst[0]) &&
+        same_dst_reg(&next->FullInstruction.Dst[0], &current->FullInstruction.Dst[0]) &&
         same_src_reg(&next->FullInstruction.Src[0], &current->FullInstruction.Src[0]) &&
         is_unswizzled(&current->FullInstruction.Src[0], current->FullInstruction.Dst[0].Register.WriteMask) &&
         is_unswizzled(&current->FullInstruction.Src[1], current->FullInstruction.Dst[0].Register.WriteMask) &&