r300/compiler: Don't merge instructions that write output regs and ALU result
authorTom Stellard <tstellar@gmail.com>
Wed, 29 Sep 2010 06:10:09 +0000 (23:10 -0700)
committerTom Stellard <tstellar@gmail.com>
Wed, 29 Sep 2010 06:52:41 +0000 (23:52 -0700)
https://bugs.freedesktop.org/show_bug.cgi?id=30415

NOTE: This is a candidate for the 7.9 branch.

src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c

index a33b2fde7b587cc44828d9ae189db2a2e61dcc79..38bae26f3c15b8aef9b773fef34828f112362f0e 100644 (file)
@@ -475,6 +475,12 @@ static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_i
 {
        struct rc_pair_instruction backup;
 
+       /*Instructions can't write output registers and ALU result at the
+        * same time. */
+       if ((rgb->WriteALUResult && alpha->Alpha.OutputWriteMask)
+               || (rgb->RGB.OutputWriteMask && alpha->WriteALUResult)) {
+               return 0;
+       }
        memcpy(&backup, rgb, sizeof(struct rc_pair_instruction));
 
        if (destructive_merge_instructions(rgb, alpha))