summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-07-19 04:29:30 -0400
committerMarge Bot <emma+marge@anholt.net>2022-08-03 00:57:16 +0000
commit2847106b944f3eb6b1ccbd951575e6696f4dfdee (patch)
tree2a0642480e396087246b76887ad1a43512381e9c
parent9e9cc629120986fc4ffc4677f6c67618dbd8bb09 (diff)
downloadmesa-2847106b944f3eb6b1ccbd951575e6696f4dfdee.tar.gz
radeonsi: add need_fmask_expand parameter into si_decompress_subresource
This is required by MSAA image stores for internal compute blits. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17864>
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c14
-rw-r--r--src/gallium/drivers/radeonsi/si_compute_blit.c3
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h3
3 files changed, 13 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 59c0cda069b..0334ce05a63 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -843,7 +843,8 @@ void si_decompress_textures(struct si_context *sctx, unsigned shader_mask)
* The driver doesn't decompress resources automatically while u_blitter is
* rendering. */
void si_decompress_subresource(struct pipe_context *ctx, struct pipe_resource *tex, unsigned planes,
- unsigned level, unsigned first_layer, unsigned last_layer)
+ unsigned level, unsigned first_layer, unsigned last_layer,
+ bool need_fmask_expand)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_texture *stex = (struct si_texture *)tex;
@@ -878,7 +879,8 @@ void si_decompress_subresource(struct pipe_context *ctx, struct pipe_resource *t
}
}
- si_blit_decompress_color(sctx, stex, level, level, first_layer, last_layer, false, false);
+ si_blit_decompress_color(sctx, stex, level, level, first_layer, last_layer, false,
+ need_fmask_expand);
}
}
@@ -979,7 +981,7 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
/* The driver doesn't decompress resources automatically while
* u_blitter is rendering. */
si_decompress_subresource(ctx, src, PIPE_MASK_RGBAZS, src_level, src_box->z,
- src_box->z + src_box->depth - 1);
+ src_box->z + src_box->depth - 1, false);
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
util_blitter_default_src_texture(sctx->blitter, &src_templ, src, src_level);
@@ -1278,7 +1280,8 @@ static void si_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
vi_disable_dcc_if_incompatible_format(sctx, info->dst.resource, info->dst.level,
info->dst.format);
si_decompress_subresource(ctx, info->src.resource, PIPE_MASK_RGBAZS, info->src.level,
- info->src.box.z, info->src.box.z + info->src.box.depth - 1);
+ info->src.box.z, info->src.box.z + info->src.box.depth - 1,
+ false);
if (unlikely(sctx->thread_trace_enabled))
sctx->sqtt_next_event = EventCmdBlitImage;
@@ -1301,7 +1304,8 @@ static bool si_generate_mipmap(struct pipe_context *ctx, struct pipe_resource *t
/* The driver doesn't decompress resources automatically while
* u_blitter is rendering. */
vi_disable_dcc_if_incompatible_format(sctx, tex, base_level, format);
- si_decompress_subresource(ctx, tex, PIPE_MASK_RGBAZS, base_level, first_layer, last_layer);
+ si_decompress_subresource(ctx, tex, PIPE_MASK_RGBAZS, base_level, first_layer, last_layer,
+ false);
/* Clear dirty_level_mask for the levels that will be overwritten. */
assert(base_level < last_level);
diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c
index d5dc1974a69..27a6c72ff2a 100644
--- a/src/gallium/drivers/radeonsi/si_compute_blit.c
+++ b/src/gallium/drivers/radeonsi/si_compute_blit.c
@@ -531,7 +531,8 @@ static void si_launch_grid_internal_images(struct si_context *sctx,
/* The driver doesn't decompress resources automatically here, so do it manually. */
si_decompress_subresource(&sctx->b, images[i].resource, PIPE_MASK_RGBAZS,
images[i].u.tex.level, images[i].u.tex.first_layer,
- images[i].u.tex.last_layer);
+ images[i].u.tex.last_layer,
+ images[i].access & PIPE_IMAGE_ACCESS_WRITE);
}
/* This must be done before the compute shader. */
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index f833c0b3147..4d0355d1043 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1329,7 +1329,8 @@ 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);
+ unsigned level, unsigned first_layer, unsigned last_layer,
+ bool need_fmask_expand);
void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst,
unsigned dst_level, unsigned dstx, unsigned dsty, unsigned dstz,
struct pipe_resource *src, unsigned src_level,