* blitting if any decompression is needed.
* The driver doesn't decompress resources automatically while u_blitter is
* rendering. */
-static void si_decompress_subresource(struct pipe_context *ctx,
- struct pipe_resource *tex,
- unsigned planes, unsigned level,
- unsigned first_layer, unsigned last_layer)
+void si_decompress_subresource(struct pipe_context *ctx,
+ struct pipe_resource *tex,
+ unsigned planes, unsigned level,
+ unsigned first_layer, unsigned last_layer)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_texture *stex = (struct si_texture*)tex;
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);
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,
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.*/
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++)
void si_blitter_end(struct si_context *sctx);
void si_init_blit_functions(struct si_context *sctx);
void si_decompress_textures(struct si_context *sctx, unsigned shader_mask);
+void si_decompress_subresource(struct pipe_context *ctx,
+ struct pipe_resource *tex,
+ unsigned planes, unsigned level,
+ unsigned first_layer, unsigned last_layer);
void si_resource_copy_region(struct pipe_context *ctx,
struct pipe_resource *dst,
unsigned dst_level,