virgl/texture: Align destination box to block depth

In the case of a 3D texture, make sure to align to the block depth.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26005>
This commit is contained in:
Corentin Noël 2023-11-02 11:10:39 +01:00 committed by Marge Bot
parent b280ea863d
commit 685fef1876

View file

@ -151,6 +151,9 @@ static void *texture_transfer_map_resolve(struct pipe_context *ctx,
util_format_get_blockwidth(resource->format));
dst_box.height = align(dst_box.height,
util_format_get_blockheight(resource->format));
if (resource->target == PIPE_TEXTURE_3D)
dst_box.depth = align(dst_box.depth,
util_format_get_blockdepth(resource->format));
}
virgl_init_temp_resource_from_box(&templ, resource, &dst_box, level, 0, fmt);