radeonsi: don't flush and wait for CB after depth-only rendering
authorMarek Olšák <marek.olsak@amd.com>
Sat, 24 Jun 2017 20:39:01 +0000 (22:39 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 26 Jun 2017 21:35:19 +0000 (23:35 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 0f39ede0c7e19d6e1429d8d2ac27a77db801a360..b236bed306542bafe612a0b6293693e57f098dd5 100644 (file)
@@ -2535,8 +2535,11 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
         * (after FMASK decompression). Shader write -> FB read transitions
         * cannot happen for MSAA textures, because MSAA shader images are
         * not supported.
+        *
+        * Only flush and wait for CB if there is actually a bound color buffer.
         */
-       if (sctx->framebuffer.nr_samples <= 1) {
+       if (sctx->framebuffer.nr_samples <= 1 &&
+           sctx->framebuffer.state.nr_cbufs) {
                sctx->b.flags |= SI_CONTEXT_INV_VMEM_L1 |
                                 SI_CONTEXT_INV_GLOBAL_L2 |
                                 SI_CONTEXT_FLUSH_AND_INV_CB;