gallium/util: Fix an assert in util_resource_copy_region

The assert can fail when copying from uncompressed to compressed with
dst_level!=0 which is valid.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36197>
This commit is contained in:
Konstantin Seurer
2025-07-10 22:31:12 +02:00
committed by Marge Bot
parent f1fdd26482
commit 70c4f2f91f
2 changed files with 2 additions and 4 deletions
+2 -2
View File
@@ -283,8 +283,8 @@ util_resource_copy_region(struct pipe_context *pipe,
/* check that region boxes are not out of bounds */
assert(src_box.x + src_box.width <= (int)u_minify(src->width0, src_level));
assert(src_box.y + src_box.height <= (int)u_minify(src->height0, src_level));
assert(dst_box.x + dst_box.width <= (int)u_minify(dst->width0, dst_level));
assert(dst_box.y + dst_box.height <= (int)u_minify(dst->height0, dst_level));
assert(dst_box.x + dst_box.width <= (int)util_align_npot(u_minify(dst->width0, dst_level), dst_bw));
assert(dst_box.y + dst_box.height <= (int)util_align_npot(u_minify(dst->height0, dst_level), dst_bh));
/* check that total number of src, dest bytes match */
assert((src_box.width / src_bw) * (src_box.height / src_bh) * src_bs ==
@@ -1,5 +1,3 @@
# src/gallium/auxiliary/util/u_surface.c:285: util_resource_copy_region: Assertion `dst_box.x + dst_box.width <= (int)u_minify(dst->width0, dst_level)' failed.
test_copy_texture_bc_rgba,Crash
# src/gallium/frontends/lavapipe/lvp_private.h:773: lvp_image_aspects_to_plane: Assertion `!(aspectMask & ~image->vk.aspects)' failed.
test_get_resource_tiling,Crash