| 11130 | } |
| 11131 | |
| 11132 | void 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 | |
| 11158 | VkResult VmaDeviceMemoryBlock::WriteMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize) |
| 11159 | { |
no test coverage detected