radeonsi: remove compressed and subsampled gfx copy from resource_copy_region
This is unused because the compute copy is always used in these cases. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
This commit is contained in:
parent
f313dc2a07
commit
cf1e562fdd
|
@ -936,9 +936,7 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
|
||||||
struct si_texture *sdst = (struct si_texture *)dst;
|
struct si_texture *sdst = (struct si_texture *)dst;
|
||||||
struct pipe_surface *dst_view, dst_templ;
|
struct pipe_surface *dst_view, dst_templ;
|
||||||
struct pipe_sampler_view src_templ, *src_view;
|
struct pipe_sampler_view src_templ, *src_view;
|
||||||
unsigned dst_width, dst_height, src_width0, src_height0;
|
struct pipe_box dstbox;
|
||||||
unsigned dst_width0, dst_height0, src_force_level = 0;
|
|
||||||
struct pipe_box sbox, dstbox;
|
|
||||||
|
|
||||||
/* Handle buffers first. */
|
/* Handle buffers first. */
|
||||||
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
|
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
|
||||||
|
@ -964,63 +962,14 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
|
||||||
si_decompress_subresource(ctx, src, PIPE_MASK_RGBAZS, src_level, src_box->z,
|
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);
|
||||||
|
|
||||||
dst_width = u_minify(dst->width0, dst_level);
|
|
||||||
dst_height = u_minify(dst->height0, dst_level);
|
|
||||||
dst_width0 = dst->width0;
|
|
||||||
dst_height0 = dst->height0;
|
|
||||||
src_width0 = src->width0;
|
|
||||||
src_height0 = src->height0;
|
|
||||||
|
|
||||||
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
|
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
|
||||||
util_blitter_default_src_texture(sctx->blitter, &src_templ, src, src_level);
|
util_blitter_default_src_texture(sctx->blitter, &src_templ, src, src_level);
|
||||||
|
|
||||||
if (util_format_is_compressed(src->format) || util_format_is_compressed(dst->format)) {
|
assert(!util_format_is_compressed(src->format) && !util_format_is_compressed(dst->format));
|
||||||
unsigned blocksize = ssrc->surface.bpe;
|
assert(!util_format_is_subsampled_422(src->format));
|
||||||
|
|
||||||
if (blocksize == 8)
|
if (!util_blitter_is_copy_supported(sctx->blitter, dst, src)) {
|
||||||
src_templ.format = PIPE_FORMAT_R16G16B16A16_UINT; /* 64-bit block */
|
switch (ssrc->surface.bpe) {
|
||||||
else
|
|
||||||
src_templ.format = PIPE_FORMAT_R32G32B32A32_UINT; /* 128-bit block */
|
|
||||||
dst_templ.format = src_templ.format;
|
|
||||||
|
|
||||||
dst_width = util_format_get_nblocksx(dst->format, dst_width);
|
|
||||||
dst_height = util_format_get_nblocksy(dst->format, dst_height);
|
|
||||||
dst_width0 = util_format_get_nblocksx(dst->format, dst_width0);
|
|
||||||
dst_height0 = util_format_get_nblocksy(dst->format, dst_height0);
|
|
||||||
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
|
||||||
src_height0 = util_format_get_nblocksy(src->format, src_height0);
|
|
||||||
|
|
||||||
dstx = util_format_get_nblocksx(dst->format, dstx);
|
|
||||||
dsty = util_format_get_nblocksy(dst->format, dsty);
|
|
||||||
|
|
||||||
sbox.x = util_format_get_nblocksx(src->format, src_box->x);
|
|
||||||
sbox.y = util_format_get_nblocksy(src->format, src_box->y);
|
|
||||||
sbox.z = src_box->z;
|
|
||||||
sbox.width = util_format_get_nblocksx(src->format, src_box->width);
|
|
||||||
sbox.height = util_format_get_nblocksy(src->format, src_box->height);
|
|
||||||
sbox.depth = src_box->depth;
|
|
||||||
src_box = &sbox;
|
|
||||||
|
|
||||||
src_force_level = src_level;
|
|
||||||
} else if (!util_blitter_is_copy_supported(sctx->blitter, dst, src)) {
|
|
||||||
if (util_format_is_subsampled_422(src->format)) {
|
|
||||||
src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
|
||||||
dst_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
|
||||||
|
|
||||||
dst_width = util_format_get_nblocksx(dst->format, dst_width);
|
|
||||||
dst_width0 = util_format_get_nblocksx(dst->format, dst_width0);
|
|
||||||
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
|
||||||
|
|
||||||
dstx = util_format_get_nblocksx(dst->format, dstx);
|
|
||||||
|
|
||||||
sbox = *src_box;
|
|
||||||
sbox.x = util_format_get_nblocksx(src->format, src_box->x);
|
|
||||||
sbox.width = util_format_get_nblocksx(src->format, src_box->width);
|
|
||||||
src_box = &sbox;
|
|
||||||
} else {
|
|
||||||
unsigned blocksize = ssrc->surface.bpe;
|
|
||||||
|
|
||||||
switch (blocksize) {
|
|
||||||
case 1:
|
case 1:
|
||||||
dst_templ.format = PIPE_FORMAT_R8_UNORM;
|
dst_templ.format = PIPE_FORMAT_R8_UNORM;
|
||||||
src_templ.format = PIPE_FORMAT_R8_UNORM;
|
src_templ.format = PIPE_FORMAT_R8_UNORM;
|
||||||
|
@ -1043,11 +992,10 @@ void si_resource_copy_region(struct pipe_context *ctx, struct pipe_resource *dst
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unhandled format %s with blocksize %u\n",
|
fprintf(stderr, "Unhandled format %s with blocksize %u\n",
|
||||||
util_format_short_name(src->format), blocksize);
|
util_format_short_name(src->format), ssrc->surface.bpe);
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* SNORM blitting has precision issues on some chips. Use the SINT
|
/* SNORM blitting has precision issues on some chips. Use the SINT
|
||||||
* equivalent instead, which doesn't force DCC decompression.
|
* equivalent instead, which doesn't force DCC decompression.
|
||||||
|
@ -1060,20 +1008,18 @@ 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);
|
vi_disable_dcc_if_incompatible_format(sctx, src, src_level, src_templ.format);
|
||||||
|
|
||||||
/* Initialize the surface. */
|
/* Initialize the surface. */
|
||||||
dst_view = si_create_surface_custom(ctx, dst, &dst_templ, dst_width0, dst_height0, dst_width,
|
dst_view = ctx->create_surface(ctx, dst, &dst_templ);
|
||||||
dst_height);
|
|
||||||
|
|
||||||
/* Initialize the sampler view. */
|
/* Initialize the sampler view. */
|
||||||
src_view =
|
src_view = ctx->create_sampler_view(ctx, src, &src_templ);
|
||||||
si_create_sampler_view_custom(ctx, src, &src_templ, src_width0, src_height0, src_force_level);
|
|
||||||
|
|
||||||
u_box_3d(dstx, dsty, dstz, abs(src_box->width), abs(src_box->height), abs(src_box->depth),
|
u_box_3d(dstx, dsty, dstz, abs(src_box->width), abs(src_box->height), abs(src_box->depth),
|
||||||
&dstbox);
|
&dstbox);
|
||||||
|
|
||||||
/* Copy. */
|
/* Copy. */
|
||||||
si_blitter_begin(sctx, SI_COPY);
|
si_blitter_begin(sctx, SI_COPY);
|
||||||
util_blitter_blit_generic(sctx->blitter, dst_view, &dstbox, src_view, src_box, src_width0,
|
util_blitter_blit_generic(sctx->blitter, dst_view, &dstbox, src_view, src_box, src->width0,
|
||||||
src_height0, PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL, false, false);
|
src->height0, PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL, false, false);
|
||||||
si_blitter_end(sctx);
|
si_blitter_end(sctx);
|
||||||
|
|
||||||
pipe_surface_reference(&dst_view, NULL);
|
pipe_surface_reference(&dst_view, NULL);
|
||||||
|
|
Loading…
Reference in New Issue