radeonsi: don't execute LDS stores for TCS outputs that are never read
[mesa.git] / src / gallium / drivers / radeonsi / si_clear.c
index 096680ccdacfa5c38c444d354a841c690680837b..ced753f023da5c4292953f3214f06a3d3fa13436 100644 (file)
@@ -503,6 +503,10 @@ static void si_do_fast_color_clear(struct si_context *sctx, unsigned *buffers,
          if (sctx->family == CHIP_STONEY)
             continue;
 
+         /* Disable fast clear if tex is encrypted */
+         if (tex->buffer.flags & RADEON_FLAG_ENCRYPTED)
+            continue;
+
          /* ensure CMASK is enabled */
          si_alloc_separate_cmask(sctx->screen, tex);
          if (!tex->cmask_buffer)
@@ -685,7 +689,7 @@ static void si_clear_render_target(struct pipe_context *ctx, struct pipe_surface
    struct si_context *sctx = (struct si_context *)ctx;
    struct si_texture *sdst = (struct si_texture *)dst->texture;
 
-   if (dst->texture->nr_samples <= 1 && !sdst->surface.dcc_offset) {
+   if (dst->texture->nr_samples <= 1 && !vi_dcc_enabled(sdst, dst->u.tex.level)) {
       si_compute_clear_render_target(ctx, dst, color, dstx, dsty, width, height,
                                      render_condition_enabled);
       return;