aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_compute_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-17 21:24:14 -0500
committerMarek Olšák <[email protected]>2020-01-20 15:40:08 -0500
commitdf34fa14bb872447fed9076e06ffc504d85e2d1c (patch)
tree33dc024cccffaa33d7b4c7711ed06fbdf24532b6 /src/gallium/drivers/radeonsi/si_compute_blit.c
parent58c929be0ddbbd9291d0dadbf11538170178e791 (diff)
radeonsi: don't invoke decompression inside internal launch_grid
Decompress resources properly but don't do it inside launch_grid to prevent recursion. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Cc: 19.3 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_compute_blit.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_compute_blit.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c
index ce25c3e4d8f..3e544d68500 100644
--- a/src/gallium/drivers/radeonsi/si_compute_blit.c
+++ b/src/gallium/drivers/radeonsi/si_compute_blit.c
@@ -66,6 +66,8 @@ static void si_launch_grid_internal(struct si_context *sctx,
sctx->flags &= ~SI_CONTEXT_START_PIPELINE_STATS;
sctx->flags |= SI_CONTEXT_STOP_PIPELINE_STATS;
sctx->render_cond_force_off = true;
+ /* Skip decompression to prevent infinite recursion. */
+ sctx->blitter->running = true;
/* Dispatch compute. */
sctx->b.launch_grid(&sctx->b, info);
@@ -74,6 +76,7 @@ static void si_launch_grid_internal(struct si_context *sctx,
sctx->flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS;
sctx->flags |= SI_CONTEXT_START_PIPELINE_STATS;
sctx->render_cond_force_off = false;
+ sctx->blitter->running = false;
}
static void si_compute_clear_12bytes_buffer(struct si_context *sctx,
@@ -398,6 +401,12 @@ void si_compute_copy_image(struct si_context *sctx,
sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH |
si_get_flush_flags(sctx, SI_COHERENCY_SHADER, L2_STREAM);
+ /* The driver doesn't decompress resources automatically here. */
+ si_decompress_subresource(ctx, dst, PIPE_MASK_RGBAZS, dst_level,
+ dstz, dstz + src_box->depth - 1);
+ si_decompress_subresource(ctx, src, PIPE_MASK_RGBAZS, src_level,
+ src_box->z, src_box->z + src_box->depth - 1);
+
/* src and dst have the same number of samples. */
si_make_CB_shader_coherent(sctx, src->nr_samples, true,
/* Only src can have DCC.*/
@@ -676,6 +685,11 @@ void si_compute_clear_render_target(struct pipe_context *ctx,
if (width == 0 || height == 0)
return;
+ /* The driver doesn't decompress resources automatically here. */
+ si_decompress_subresource(ctx, dstsurf->texture, PIPE_MASK_RGBA,
+ dstsurf->u.tex.level, dstsurf->u.tex.first_layer,
+ dstsurf->u.tex.last_layer);
+
if (util_format_is_srgb(dstsurf->format)) {
union pipe_color_union color_srgb;
for (int i = 0; i < 3; i++)