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

Method SwapBlockAllocation

include/vk_mem_alloc.h:11015–11032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11013}
11014
11015uint8_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
11034VmaAllocHandle VmaAllocation_T::GetAllocHandle() const
11035{

Callers 1

DefragmentPassEndMethod · 0.80

Calls 3

UnmapMethod · 0.80
swapFunction · 0.50
SetAllocationUserDataMethod · 0.45

Tested by

no test coverage detected