etnaviv: use correct blit box sizes when copying resource

The padded width/height is stored in samples, while the blit box
dimensions need to be specified in pixels. Use the unpadded
width/height of the resource levels to generate the blit box
dimensions used to copy a resource. The blit code already extends
those sizes to the padded sizes when necessary and possible.

This commit needed to be reverted previously, as it triggered
a bug in the RS blit path. This bug has been fixed so now we
can reapply this change to get the blit dimensions corrected.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28598>
This commit is contained in:
Lucas Stach
2024-04-05 11:04:49 +02:00
committed by Marge Bot
parent 2964812aac
commit 34b6ae96c0

View File

@@ -229,9 +229,9 @@ etna_copy_resource(struct pipe_context *pctx, struct pipe_resource *dst,
blit.src.level = blit.dst.level = level;
blit.src.box.width = blit.dst.box.width =
MIN2(src_priv->levels[level].padded_width, dst_priv->levels[level].padded_width);
MIN2(src_priv->levels[level].width, dst_priv->levels[level].width);
blit.src.box.height = blit.dst.box.height =
MIN2(src_priv->levels[level].padded_height, dst_priv->levels[level].padded_height);
MIN2(src_priv->levels[level].height, dst_priv->levels[level].height);
unsigned depth = MIN2(src_priv->levels[level].depth, dst_priv->levels[level].depth);
if (dst->array_size > 1) {
assert(depth == 1); /* no array of 3d texture */