panvk: fix memory requirement query for aliased disjoint image

The spec allows to create aliased disjoint image for a specific plane of
a multi-planar image, and the format can be R8. When querying memory
requirement of such image, VkImagePlaneMemoryRequirementsInfo is not
required to be chained although it has the disjoint bit.

This change fixes to look for aspect info from plane memory info only
when that's chained. The implementation can be passive here as the spec
VU has sufficient guarantees for the validity around. See below VU for
details:
- VUID-VkImageMemoryRequirementsInfo2-image-01589
- VUID-VkImageMemoryRequirementsInfo2-image-01590
- VUID-VkImageMemoryRequirementsInfo2-image-02279
- VUID-VkImageMemoryRequirementsInfo2-image-02280

Meanwhile, the existing disjoint check for size info is kept as is for
the special handling of VK_FORMAT_D32_SFLOAT_S8_UINT.

Test: dEQP-VK.ycbcr.plane_view.memory_alias.* pass with venus-on-panvk

Fixes: 412c286331 ("panvk: Enable multiplane images and image views")
Reviewed-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34134>
This commit is contained in:
Yiwei Zhang 2025-03-22 17:56:28 -07:00 committed by Marge Bot
parent 121d163b21
commit 5dcb9f918d

View file

@ -446,7 +446,7 @@ panvk_GetImageMemoryRequirements2(VkDevice device,
vk_find_struct_const(pInfo->pNext, IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO);
const bool disjoint = is_disjoint(image);
const VkImageAspectFlags aspects =
disjoint ? plane_info->planeAspect : image->vk.aspects;
plane_info ? plane_info->planeAspect : image->vk.aspects;
uint8_t plane = panvk_plane_index(image->vk.format, aspects);
const uint64_t size =
disjoint ? image->planes[plane].layout.data_size :