radeonsi/gfx10: fix corruption for chips with harvested TCCs
authorMarek Olšák <marek.olsak@amd.com>
Tue, 24 Sep 2019 20:56:57 +0000 (16:56 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 30 Sep 2019 17:36:20 +0000 (13:36 -0400)
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_pipe.h

index 2c3471d..1906bdf 100644 (file)
@@ -1684,7 +1684,9 @@ si_make_CB_shader_coherent(struct si_context *sctx, unsigned num_samples,
                       SI_CONTEXT_INV_VCACHE;
 
        if (sctx->chip_class >= GFX10) {
-               if (shaders_read_metadata)
+               if (sctx->screen->info.tcc_harvested)
+                       sctx->flags |= SI_CONTEXT_INV_L2;
+               else if (shaders_read_metadata)
                        sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
        } else if (sctx->chip_class == GFX9) {
                /* Single-sample color is coherent with shaders on GFX9, but
@@ -1710,7 +1712,9 @@ si_make_DB_shader_coherent(struct si_context *sctx, unsigned num_samples,
                       SI_CONTEXT_INV_VCACHE;
 
        if (sctx->chip_class >= GFX10) {
-               if (shaders_read_metadata)
+               if (sctx->screen->info.tcc_harvested)
+                       sctx->flags |= SI_CONTEXT_INV_L2;
+               else if (shaders_read_metadata)
                        sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
        } else if (sctx->chip_class == GFX9) {
                /* Single-sample depth (not stencil) is coherent with shaders