venus: improve image memory requirement cache for image aliasing

We can strip the alias bit as the memory requirements are identical
between the bound image and the aliased image per spec.

Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34135>
This commit is contained in:
Yiwei Zhang 2025-03-22 15:45:27 -07:00 committed by Marge Bot
parent adcb967c5c
commit 63cac09d74

View file

@ -97,6 +97,14 @@ vn_image_get_image_reqs_key(struct vn_device *dev,
if (!dev->image_reqs_cache.ht)
return false;
/* Strip the alias bit as the memory requirements are identical. */
VkImageCreateInfo local_info;
if (create_info->flags & VK_IMAGE_CREATE_ALIAS_BIT) {
local_info = *create_info;
local_info.flags &= ~VK_IMAGE_CREATE_ALIAS_BIT;
create_info = &local_info;
}
_mesa_sha1_init(&sha1_ctx);
/* Hash relevant fields in the pNext chain */