| 11013 | } |
| 11014 | |
| 11015 | uint8_t VmaAllocation_T::SwapBlockAllocation(VmaAllocator hAllocator, VmaAllocation allocation) |
| 11016 | { |
| 11017 | VMA_ASSERT(allocation != VMA_NULL); |
| 11018 | VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK); |
| 11019 | VMA_ASSERT(allocation->m_Type == ALLOCATION_TYPE_BLOCK); |
| 11020 | |
| 11021 | if (m_MapCount != 0) |
| 11022 | m_BlockAllocation.m_Block->Unmap(hAllocator, m_MapCount); |
| 11023 | |
| 11024 | m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, allocation); |
| 11025 | std::swap(m_BlockAllocation, allocation->m_BlockAllocation); |
| 11026 | m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, this); |
| 11027 | |
| 11028 | #if VMA_STATS_STRING_ENABLED |
| 11029 | std::swap(m_BufferImageUsage, allocation->m_BufferImageUsage); |
| 11030 | #endif |
| 11031 | return m_MapCount; |
| 11032 | } |
| 11033 | |
| 11034 | VmaAllocHandle VmaAllocation_T::GetAllocHandle() const |
| 11035 | { |
no test coverage detected