i915g: Only apply the optimization to output vars.
authorStéphane Marchesin <marcheu@chromium.org>
Fri, 23 Dec 2011 02:17:54 +0000 (18:17 -0800)
committerStéphane Marchesin <marcheu@chromium.org>
Wed, 28 Dec 2011 01:08:26 +0000 (17:08 -0800)
This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.

src/gallium/drivers/i915/i915_fpc_optimize.c

index 0d680fbf87639c8a4bb5a42a342b3e02253cfc75..d9b4c46b909c57917bab416a5f65f9eae1b75087 100644 (file)
@@ -203,6 +203,7 @@ static void i915_fpc_optimize_useless_mov(union i915_full_token* current, union
         next->FullInstruction.Instruction.Saturate == TGSI_SAT_NONE &&
         next->FullInstruction.Src[0].Register.Absolute == 0 &&
         next->FullInstruction.Src[0].Register.Negate == 0 &&
+        next->FullInstruction.Dst[0].Register.File == TGSI_FILE_OUTPUT &&
         is_unswizzled(&next->FullInstruction.Src[0], next->FullInstruction.Dst[0].Register.WriteMask) &&
         current->FullInstruction.Dst[0].Register.WriteMask == next->FullInstruction.Dst[0].Register.WriteMask &&
         same_src_dst_reg(&next->FullInstruction.Src[0], &current->FullInstruction.Dst[0]) )