Skip to content

Commit 14d9e1a

Browse files
Minor optimization: Skip call to vkUnmapMemory before vkFreeMemory for dedicated allocations, which is allowed by the spec.
1 parent 1e425dd commit 14d9e1a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/vk_mem_alloc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12257,10 +12257,15 @@ void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation)
1225712257

1225812258
VkDeviceMemory hMemory = allocation->GetMemory();
1225912259

12260+
/*
12261+
There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
12262+
before vkFreeMemory.
12263+
1226012264
if(allocation->GetMappedData() != VMA_NULL)
1226112265
{
1226212266
(*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
1226312267
}
12268+
*/
1226412269

1226512270
FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);
1226612271

0 commit comments

Comments
 (0)