radeonsi: change TC cache flushing strategy for textures
authorMarek Olšák <marek.olsak@amd.com>
Mon, 29 Dec 2014 00:25:48 +0000 (01:25 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jan 2015 11:06:43 +0000 (12:06 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_state.c

index 1644ec7a8d3c7a5b6b1b018cbd86a4489afae9c3..573787a991ae6de86bbe756930aa392edbe207a4 100644 (file)
@@ -445,8 +445,6 @@ static void si_set_sampler_views(struct pipe_context *ctx,
                }
        }
 
-       sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
-                        SI_CONTEXT_INV_TC_L2;
        si_update_descriptors(sctx, &samplers->views.desc);
 }
 
@@ -671,8 +669,6 @@ void si_update_vertex_buffers(struct si_context *sctx)
         * on performance (confirmed by testing). New descriptors are always
         * uploaded to a fresh new buffer, so I don't think flushing the const
         * cache is needed. */
-       sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
-                        SI_CONTEXT_INV_TC_L2;
 }
 
 
index 4b146b5c86d73fc0a4d595d97609e5a62d32f950..9e1b3cd6577f328c5fdd7a526c64e02500cd6495 100644 (file)
@@ -2004,6 +2004,12 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
                                 SI_CONTEXT_FLUSH_AND_INV_DB_META;
        }
 
+       /* Only flush TC when changing the framebuffer state, because
+        * the only client not using TC that can change textures is
+        * the framebuffer. */
+       sctx->b.flags |= SI_CONTEXT_INV_TC_L1 |
+                        SI_CONTEXT_INV_TC_L2;
+
        util_copy_framebuffer_state(&sctx->framebuffer.state, state);
 
        sctx->framebuffer.export_16bpc = 0;