summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2024-03-24 02:35:16 -0400
committerMarge Bot <emma+marge@anholt.net>2024-04-24 19:17:10 +0000
commit82e63db91ffd27a12dd1727a89f64c14c05ddf70 (patch)
tree1071db0a720db70a3ce962e9b27afd106a20c5cb /src/gallium/drivers/radeonsi
parente94813204a5cc3be9759a517966cb071a99d8c11 (diff)
radeonsi: move blitter resource_copy_region implementation to si_gfx_copy_image
for a new performance test. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28725>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c23
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h4
2 files changed, 20 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 6bc6511adea..0e4e3a19fe2 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -947,10 +947,6 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
const struct pipe_box *src_box)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_texture *ssrc = (struct si_texture *)src;
- struct pipe_surface *dst_view, dst_templ;
- struct pipe_sampler_view src_templ, *src_view;
- struct pipe_box dstbox;
/* Handle buffers first. */
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
@@ -962,6 +958,19 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
src_box, SI_OP_SYNC_BEFORE_AFTER))
return;
+ si_gfx_copy_image(sctx, dst, dst_level, dstx, dsty, dstz, src, src_level, src_box);
+}
+
+void si_gfx_copy_image(struct si_context *sctx, struct pipe_resource *dst,
+ unsigned dst_level, unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src, unsigned src_level,
+ const struct pipe_box *src_box)
+{
+ struct si_texture *ssrc = (struct si_texture *)src;
+ struct pipe_surface *dst_view, dst_templ;
+ struct pipe_sampler_view src_templ, *src_view;
+ struct pipe_box dstbox;
+
/* If the blitter isn't available fail here instead of crashing. */
if (!sctx->blitter) {
fprintf(stderr, "si_resource_copy_region failed src_format: %s dst_format: %s\n",
@@ -973,7 +982,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,
+ si_decompress_subresource(&sctx->b, src, PIPE_MASK_RGBAZS, src_level, src_box->z,
src_box->z + src_box->depth - 1, false);
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
@@ -1022,10 +1031,10 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
vi_disable_dcc_if_incompatible_format(sctx, src, src_level, src_templ.format);
/* Initialize the surface. */
- dst_view = ctx->create_surface(ctx, dst, &dst_templ);
+ dst_view = sctx->b.create_surface(&sctx->b, dst, &dst_templ);
/* Initialize the sampler view. */
- src_view = ctx->create_sampler_view(ctx, src, &src_templ);
+ src_view = sctx->b.create_sampler_view(&sctx->b, src, &src_templ);
u_box_3d(dstx, dsty, dstz, abs(src_box->width), abs(src_box->height), abs(src_box->depth),
&dstbox);
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index fe404f023ae..b427116a4b9 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1419,6 +1419,10 @@ 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,
const struct pipe_box *src_box);
+void si_gfx_copy_image(struct si_context *sctx, struct pipe_resource *dst,
+ unsigned dst_level, unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src, unsigned src_level,
+ const struct pipe_box *src_box);
void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex);
void si_flush_implicit_resources(struct si_context *sctx);
bool si_msaa_resolve_blit_via_CB(struct pipe_context *ctx, const struct pipe_blit_info *info);