pan/layout: Fix WSI.Import test

We were leaving the depth to zero, but the layout code expects a depth
of at least one.

Add an assert() in pan_image_layout_init() to catch this in the future.

Fixes: 916f75a2a6 ("pan/layout: Test WSI import behavior on all supported format/mods")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35555>
This commit is contained in:
Boris Brezillon 2025-06-23 20:49:54 +02:00
parent f87cd970e3
commit b06f6b81a6
2 changed files with 5 additions and 0 deletions

View file

@ -528,6 +528,10 @@ pan_image_layout_init(
assert(props->extent_px.depth == 1 || props->nr_samples == 1);
/* Make sure the extent/sample_count is not zero. */
assert(props->extent_px.width && props->extent_px.height &&
props->extent_px.depth && props->nr_samples);
struct pan_image_extent mip_extent_px = {
.width = util_format_get_plane_width(props->format, plane_idx,
props->extent_px.width),

View file

@ -716,6 +716,7 @@ TEST(WSI, Import)
.extent_px = {
.width = IMAGE_WIDTH,
.height = IMAGE_HEIGHT,
.depth = 1,
},
.nr_samples = 1,
.dim = MALI_TEXTURE_DIMENSION_2D,