Mesa (master): radeonsi: fix si_compute_clear_render_target with render condition enabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 30 22:53:01 UTC 2020


Module: Mesa
Branch: master
Commit: 5afec9bc9fbab57afffb1cede8b8eaad8caac491
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5afec9bc9fbab57afffb1cede8b8eaad8caac491

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Apr 28 11:19:23 2020 -0400

radeonsi: fix si_compute_clear_render_target with render condition enabled

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761>

---

 src/gallium/drivers/radeonsi/si_compute_blit.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c
index a754dc8bb48..d04d58ead20 100644
--- a/src/gallium/drivers/radeonsi/si_compute_blit.c
+++ b/src/gallium/drivers/radeonsi/si_compute_blit.c
@@ -56,8 +56,9 @@ unsigned si_get_flush_flags(struct si_context *sctx, enum si_coherency coher,
    }
 }
 
-#define SI_CS_IMAGE_OP        (1 << 0)
-#define SI_CS_WAIT_FOR_IDLE   (1 << 1)
+#define SI_CS_IMAGE_OP           (1 << 0)
+#define SI_CS_WAIT_FOR_IDLE      (1 << 1)
+#define SI_CS_RENDER_COND_ENABLE (1 << 2)
 
 static void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *info,
                                     void *restore_cs, unsigned flags)
@@ -71,7 +72,10 @@ static void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_in
    /* Set settings for driver-internal compute dispatches. */
    sctx->flags &= ~SI_CONTEXT_START_PIPELINE_STATS;
    sctx->flags |= SI_CONTEXT_STOP_PIPELINE_STATS;
-   sctx->render_cond_force_off = true;
+
+   if (!(flags & SI_CS_RENDER_COND_ENABLE))
+      sctx->render_cond_force_off = true;
+
    /* Skip decompression to prevent infinite recursion. */
    if (sctx->blitter)
       sctx->blitter->running = true;
@@ -715,8 +719,6 @@ void si_compute_clear_render_target(struct pipe_context *ctx, struct pipe_surfac
       memcpy(data + 4, color->ui, sizeof(color->ui));
    }
 
-   sctx->render_cond_force_off = !render_condition_enabled;
-
    si_make_CB_shader_coherent(sctx, dstsurf->texture->nr_samples, true,
                               true /* DCC is not possible with image stores */);
 
@@ -772,7 +774,8 @@ void si_compute_clear_render_target(struct pipe_context *ctx, struct pipe_surfac
    }
 
    si_launch_grid_internal(sctx, &info, saved_cs,
-                           SI_CS_WAIT_FOR_IDLE | SI_CS_IMAGE_OP);
+                           SI_CS_WAIT_FOR_IDLE | SI_CS_IMAGE_OP |
+                           (render_condition_enabled ? SI_CS_RENDER_COND_ENABLE : 0));
 
    ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 1, &saved_image);
    ctx->set_constant_buffer(ctx, PIPE_SHADER_COMPUTE, 0, &saved_cb);



More information about the mesa-commit mailing list