mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
anv/device: Implicitly unmap memory objects in FreeMemory
From the Vulkan spec version 1.0.32 docs for vkFreeMemory:
"If a memory object is mapped at the time it is freed, it is implicitly
unmapped."
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org>
(cherry picked from commit b1217eada9)
This commit is contained in:
parent
08a9f69a8b
commit
c0934035a5
1 changed files with 9 additions and 0 deletions
|
|
@ -1161,6 +1161,9 @@ VkResult anv_AllocateMemory(
|
|||
|
||||
mem->type_index = pAllocateInfo->memoryTypeIndex;
|
||||
|
||||
mem->map = NULL;
|
||||
mem->map_size = 0;
|
||||
|
||||
*pMem = anv_device_memory_to_handle(mem);
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
|
@ -1182,6 +1185,9 @@ void anv_FreeMemory(
|
|||
if (mem == NULL)
|
||||
return;
|
||||
|
||||
if (mem->map)
|
||||
anv_UnmapMemory(_device, _mem);
|
||||
|
||||
if (mem->bo.map)
|
||||
anv_gem_munmap(mem->bo.map, mem->bo.size);
|
||||
|
||||
|
|
@ -1251,6 +1257,9 @@ void anv_UnmapMemory(
|
|||
return;
|
||||
|
||||
anv_gem_munmap(mem->map, mem->map_size);
|
||||
|
||||
mem->map = NULL;
|
||||
mem->map_size = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue