MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / Unmap

Method Unmap

include/vk_mem_alloc.h:10810–10833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10808}
10809
10810void VmaDeviceMemoryBlock::Unmap(VmaAllocator hAllocator, uint32_t count)
10811{
10812 if (count == 0)
10813 {
10814 return;
10815 }
10816
10817 VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
10818 if (m_MapCount >= count)
10819 {
10820 m_MapCount -= count;
10821 const uint32_t totalMapCount = m_MapCount + m_MappingHysteresis.GetExtraMapping();
10822 if (totalMapCount == 0)
10823 {
10824 m_pMappedData = VMA_NULL;
10825 (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
10826 }
10827 m_MappingHysteresis.PostUnmap();
10828 }
10829 else
10830 {
10831 VMA_ASSERT(0 && "VkDeviceMemory block is being unmapped while it was not previously mapped.");
10832 }
10833}
10834
10835VkResult VmaDeviceMemoryBlock::WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
10836{

Callers 2

SwapBlockAllocationMethod · 0.80
FreeMethod · 0.80

Calls 6

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

Tested by

no test coverage detected