MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / SwapBlockAllocation

Method SwapBlockAllocation

include/vk_mem_alloc.h:11338–11355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11336}
11337
11338uint8_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
11357VmaAllocHandle VmaAllocation_T::GetAllocHandle() const
11358{

Callers 1

DefragmentPassEndMethod · 0.80

Calls 2

UnmapMethod · 0.80
SetAllocationUserDataMethod · 0.45

Tested by

no test coverage detected