pvr: Check if the buffer/image was bound before unbinding.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15641>
This commit is contained in:
Rajnesh Kanwal 2022-03-22 15:33:46 +00:00 committed by Marge Bot
parent d876abeaa8
commit 860e3f6ff9
2 changed files with 6 additions and 2 deletions

View file

@ -1579,7 +1579,9 @@ void pvr_DestroyBuffer(VkDevice _device,
if (!buffer)
return;
pvr_unbind_memory(device, buffer->vma);
if (buffer->vma)
pvr_unbind_memory(device, buffer->vma);
vk_object_free(&device->vk, pAllocator, buffer);
}

View file

@ -160,7 +160,9 @@ void pvr_DestroyImage(VkDevice _device,
if (!image)
return;
pvr_unbind_memory(device, image->vma);
if (image->vma)
pvr_unbind_memory(device, image->vma);
vk_image_destroy(&device->vk, pAllocator, &image->vk);
}