| 10808 | } |
| 10809 | |
| 10810 | void 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 | |
| 10835 | VkResult VmaDeviceMemoryBlock::WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize) |
| 10836 | { |
no test coverage detected