lvp: follow winsys handle size when imported with explicit layout

Per plane size has been decided outside when imported with explicit
layout. The unconditional alignup was added in the lvp sparse support,
which doesn't interact with format modifier path at all.

For later (in fear of breaking things):
1. We better validate against the must satisfied layout e.g. D/S tile
   load/store. For color attachment, unaligned loads are used if the
   alignment exceeds 16 bytes.
2. The additional alignment on the required size should have been
   applied inside the resource_create_unbacked from llvmpipe backend.
3. The alignment requirement better comes from the backend instead of a
   hard-coded value in the frontend.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40426>
This commit is contained in:
Yiwei Zhang 2026-03-19 14:29:15 -07:00 committed by Marge Bot
parent 21bac93406
commit f3ffc27927

View file

@ -170,12 +170,11 @@ lvp_image_init(struct lvp_device *device, struct lvp_image *image,
image->planes[p].bo = device->pscreen->resource_create_unbacked(device->pscreen,
&template,
&image->planes[p].size);
image->planes[p].size = align64(image->planes[p].size, image->alignment);
}
if (!image->planes[p].bo)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
image->planes[p].size = align64(image->planes[p].size, image->alignment);
image->size += image->planes[p].size;
}