mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
pvr: Unmap mapped memory on free
From the Vulkan spec (§11.2.13. Freeing Device Memory): If a memory object is mapped at the time it is freed, it is implicitly unmapped. Signed-off-by: Matt Coster <matt.coster@imgtec.com> Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22762>
This commit is contained in:
parent
926ddc319c
commit
11b1a37553
1 changed files with 7 additions and 0 deletions
|
|
@ -2112,6 +2112,13 @@ void pvr_FreeMemory(VkDevice _device,
|
|||
if (!mem)
|
||||
return;
|
||||
|
||||
/* From the Vulkan spec (§11.2.13. Freeing Device Memory):
|
||||
* If a memory object is mapped at the time it is freed, it is implicitly
|
||||
* unmapped.
|
||||
*/
|
||||
if (mem->bo->map)
|
||||
device->ws->ops->buffer_unmap(mem->bo);
|
||||
|
||||
device->ws->ops->buffer_destroy(mem->bo);
|
||||
|
||||
vk_object_free(&device->vk, pAllocator, mem);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue