From d8ceb38ef1b21c95ff2f7e3cd7dad40124d0bfed Mon Sep 17 00:00:00 2001 From: Caterina Shablia Date: Wed, 17 Dec 2025 08:44:31 +0000 Subject: [PATCH] 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 Part-of: --- src/panfrost/vulkan/panvk_vX_image_view.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_image_view.c b/src/panfrost/vulkan/panvk_vX_image_view.c index b052e95439e..860bf1f0b4f 100644 --- a/src/panfrost/vulkan/panvk_vX_image_view.c +++ b/src/panfrost/vulkan/panvk_vX_image_view.c @@ -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);