Minor optimization: Skip call to vkUnmapMemory before vkFreeMemory for dedicated allocations, which is allowed by the spec.

This commit is contained in:
Adam Sawicki 2018-09-17 17:06:42 +02:00
parent 1e425dda03
commit 14d9e1a938

View File

@ -12257,10 +12257,15 @@ void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation)
VkDeviceMemory hMemory = allocation->GetMemory();
/*
There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
before vkFreeMemory.
if(allocation->GetMappedData() != VMA_NULL)
{
(*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
}
*/
FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);