From: Marek Olšák Date: Tue, 28 Apr 2020 15:19:23 +0000 (-0400) Subject: radeonsi: fix si_compute_clear_render_target with render condition enabled X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5afec9bc9fbab57afffb1cede8b8eaad8caac491;p=mesa.git radeonsi: fix si_compute_clear_render_target with render condition enabled Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- 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);