| 11336 | } |
| 11337 | |
| 11338 | uint8_t VmaAllocation_T::SwapBlockAllocation(VmaAllocator hAllocator, VmaAllocation allocation) |
| 11339 | { |
| 11340 | VMA_ASSERT(allocation != VMA_NULL); |
| 11341 | VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); |
| 11342 | VMA_ASSERT(allocation->m_Type == ALLOCATION_TYPE_BLOCK); |
| 11343 | |
| 11344 | if (m_MapCount != 0) |
| 11345 | m_BlockAllocation.m_Block->Unmap(hAllocator, m_MapCount); |
| 11346 | |
| 11347 | m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, allocation); |
| 11348 | std::swap(m_BlockAllocation, allocation->m_BlockAllocation); |
| 11349 | m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, this); |
| 11350 | |
| 11351 | #if VMA_STATS_STRING_ENABLED |
| 11352 | std::swap(m_BufferImageUsage, allocation->m_BufferImageUsage); |
| 11353 | #endif |
| 11354 | return m_MapCount; |
| 11355 | } |
| 11356 | |
| 11357 | VmaAllocHandle VmaAllocation_T::GetAllocHandle() const |
| 11358 | { |
no test coverage detected