i965: Respect the no_8 flag on Gen6, not just Gen7+.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Jan 2015 04:46:17 +0000 (20:46 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 12 Jan 2015 08:41:07 +0000 (00:41 -0800)
When doing repclears, we only want to use the SIMD16 program, not the
SIMD8 one.  Kristian added this to the Gen7+ code, but apparently we
missed it in the Gen6 code.  This patch copies that code over.

Approximately doubles the performance in a clear microbenchmark from
mesa-demos (clearspd -width 500 -height 500 +color) on Sandybridge.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
References: https://code.google.com/p/chrome-os-partner/issues/detail?id=34681

src/mesa/drivers/dri/i965/gen6_wm_state.c

index e57b7f6f9bd29de3fdccc393050391566a7dcd8b..8e673a42044af48a1841b21784c2b9f60a9dc729 100644 (file)
@@ -135,10 +135,10 @@ upload_wm_state(struct brw_context *brw)
       _mesa_get_min_invocations_per_fragment(ctx, brw->fragment_program, false);
    assert(min_inv_per_frag >= 1);
 
-   if (prog_data->prog_offset_16) {
+   if (prog_data->prog_offset_16 || prog_data->no_8) {
       dw5 |= GEN6_WM_16_DISPATCH_ENABLE;
 
-      if (min_inv_per_frag == 1) {
+      if (!prog_data->no_8 && min_inv_per_frag == 1) {
          dw5 |= GEN6_WM_8_DISPATCH_ENABLE;
          dw4 |= (prog_data->base.dispatch_grf_start_reg <<
                  GEN6_WM_DISPATCH_START_GRF_SHIFT_0);