| 15351 | } |
| 15352 | |
| 15353 | void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation) |
| 15354 | { |
| 15355 | VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED); |
| 15356 | |
| 15357 | const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex(); |
| 15358 | VmaPool parentPool = allocation->GetParentPool(); |
| 15359 | if(parentPool == VK_NULL_HANDLE) |
| 15360 | { |
| 15361 | // Default pool |
| 15362 | m_DedicatedAllocations[memTypeIndex].Unregister(allocation); |
| 15363 | } |
| 15364 | else |
| 15365 | { |
| 15366 | // Custom pool |
| 15367 | parentPool->m_DedicatedAllocations.Unregister(allocation); |
| 15368 | } |
| 15369 | |
| 15370 | VkDeviceMemory hMemory = allocation->GetMemory(); |
| 15371 | |
| 15372 | /* |
| 15373 | There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory |
| 15374 | before vkFreeMemory. |
| 15375 | |
| 15376 | if(allocation->GetMappedData() != VMA_NULL) |
| 15377 | { |
| 15378 | (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory); |
| 15379 | } |
| 15380 | */ |
| 15381 | |
| 15382 | FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory); |
| 15383 | |
| 15384 | m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize()); |
| 15385 | allocation->Destroy(this); |
| 15386 | m_AllocationObjectAllocator.Free(allocation); |
| 15387 | |
| 15388 | VMA_DEBUG_LOG_FORMAT(" Freed DedicatedMemory MemoryTypeIndex=%" PRIu32, memTypeIndex); |
| 15389 | } |
| 15390 | |
| 15391 | uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits() const |
| 15392 | { |
nothing calls this directly
no test coverage detected