| 14808 | } |
| 14809 | |
| 14810 | void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation) |
| 14811 | { |
| 14812 | VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED); |
| 14813 | |
| 14814 | const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex(); |
| 14815 | VmaPool parentPool = allocation->GetParentPool(); |
| 14816 | if(parentPool == VK_NULL_HANDLE) |
| 14817 | { |
| 14818 | // Default pool |
| 14819 | m_DedicatedAllocations[memTypeIndex].Unregister(allocation); |
| 14820 | } |
| 14821 | else |
| 14822 | { |
| 14823 | // Custom pool |
| 14824 | parentPool->m_DedicatedAllocations.Unregister(allocation); |
| 14825 | } |
| 14826 | |
| 14827 | VkDeviceMemory hMemory = allocation->GetMemory(); |
| 14828 | |
| 14829 | /* |
| 14830 | There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory |
| 14831 | before vkFreeMemory. |
| 14832 | |
| 14833 | if(allocation->GetMappedData() != VMA_NULL) |
| 14834 | { |
| 14835 | (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory); |
| 14836 | } |
| 14837 | */ |
| 14838 | |
| 14839 | FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory); |
| 14840 | |
| 14841 | m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize()); |
| 14842 | allocation->Destroy(this); |
| 14843 | m_AllocationObjectAllocator.Free(allocation); |
| 14844 | |
| 14845 | VMA_DEBUG_LOG_FORMAT(" Freed DedicatedMemory MemoryTypeIndex=%" PRIu32, memTypeIndex); |
| 14846 | } |
| 14847 | |
| 14848 | uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits() const |
| 14849 | { |
nothing calls this directly
no test coverage detected