MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / Unmap

Method Unmap

include/vk_mem_alloc.h:11132–11156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11130}
11131
11132void VmaDeviceMemoryBlock::Unmap(VmaAllocator hAllocator, uint32_t count)
11133{
11134 if (count == 0)
11135 {
11136 return;
11137 }
11138
11139 VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
11140 if (m_MapCount >= count)
11141 {
11142 m_MapCount -= count;
11143 const uint32_t totalMapCount = m_MapCount + m_MappingHysteresis.GetExtraMapping();
11144 if (totalMapCount == 0)
11145 {
11146 m_pMappedData = VMA_NULL;
11147 m_IsMapped.store(false);
11148 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
11149 }
11150 m_MappingHysteresis.PostUnmap();
11151 }
11152 else
11153 {
11154 VMA_ASSERT(0 && "VkDeviceMemory block is being unmapped while it was not previously mapped.");
11155 }
11156}
11157
11158VkResult VmaDeviceMemoryBlock::WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
11159{

Callers 2

SwapBlockAllocationMethod · 0.80
FreeMethod · 0.80

Calls 6

GetExtraMappingMethod · 0.80
PostUnmapMethod · 0.80
GetTypeMethod · 0.80
BlockAllocUnmapMethod · 0.80
DedicatedAllocUnmapMethod · 0.80
GetBlockMethod · 0.45

Tested by

no test coverage detected