r300/compiler: Don't pair output writes with GPR writes in the scheduler
authorTom Stellard <tstellar@gmail.com>
Thu, 13 Oct 2011 23:32:35 +0000 (16:32 -0700)
committerTom Stellard <tstellar@gmail.com>
Sat, 15 Oct 2011 01:30:14 +0000 (18:30 -0700)
src/gallium/drivers/r300/compiler/radeon_pair_schedule.c

index 1f589cdb98e952ec33d3918f620cb22d16f58e2f..ee868ccba3a1c1a5a7fa904da2f20372dbfb9f66 100644 (file)
@@ -511,6 +511,13 @@ static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_i
                return 0;
        }
 
+       /* Writing output registers in the middle of shaders is slow, so
+        * we don't want to pair output writes with temp writes. */
+       if ((rgb->RGB.OutputWriteMask && !alpha->Alpha.OutputWriteMask)
+               || (!rgb->RGB.OutputWriteMask && alpha->Alpha.OutputWriteMask)) {
+               return 0;
+       }
+
        memcpy(&backup, rgb, sizeof(struct rc_pair_instruction));
 
        if (destructive_merge_instructions(rgb, alpha))