panvk: do not access the image in image view's destructor

Vulkan allows destroying an image without destroying the views of
this image first. These views can not be used in any way and the
only thing that the user can do with such a view is destroy it.
This also means that the driver can not refer to the image inside
the image view's destructor.

Fixes cb3f6481 ("panvk: Create MS shadow images and views")

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38972>
This commit is contained in:
Caterina Shablia 2025-12-17 08:44:31 +00:00 committed by Marge Bot
parent bf2aa05b60
commit d8ceb38ef1

View file

@ -437,12 +437,9 @@ panvk_per_arch(DestroyImageView)(VkDevice _device, VkImageView _view,
if (!view)
return;
if (view->vk.image->create_flags &
VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT) {
for (uint32_t i = 0; i < ARRAY_SIZE(view->ms_views); ++i) {
panvk_per_arch(DestroyImageView)(_device, view->ms_views[i],
pAllocator);
}
for (uint32_t i = 0; i < ARRAY_SIZE(view->ms_views); ++i) {
panvk_per_arch(DestroyImageView)(_device, view->ms_views[i],
pAllocator);
}
panvk_pool_free_mem(&view->mem);