nvc0: do not invalidate compute constbufs on Kepler
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 22 May 2016 18:27:23 +0000 (20:27 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 23 May 2016 18:56:29 +0000 (20:56 +0200)
Constbufs are only aliased on Fermi and this will reduce the number of
flushes when we switch between 3d and compute.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c

index 7a9abe58754854a9db1bd84bc75e26a815985e98..a77486db54ccfd6f023f5e2b2d2e746f990aa801 100644 (file)
@@ -486,10 +486,12 @@ nvc0_constbufs_validate(struct nvc0_context *nvc0)
       }
    }
 
-   /* Invalidate all COMPUTE constbufs because they are aliased with 3D. */
-   nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF;
-   nvc0->constbuf_dirty[5] |= nvc0->constbuf_valid[5];
-   nvc0->state.uniform_buffer_bound[5] = 0;
+   if (nvc0->screen->base.class_3d < NVE4_3D_CLASS) {
+      /* Invalidate all COMPUTE constbufs because they are aliased with 3D. */
+      nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF;
+      nvc0->constbuf_dirty[5] |= nvc0->constbuf_valid[5];
+      nvc0->state.uniform_buffer_bound[5] = 0;
+   }
 }
 
 static void