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

Method BindBufferMemory

include/vk_mem_alloc.h:11195–11210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11193}
11194
11195VkResult VmaDeviceMemoryBlock::BindBufferMemory(
11196 VmaAllocator hAllocator,
11197 VmaAllocation hAllocation,
11198 VkDeviceSize allocationLocalOffset,
11199 VkBuffer hBuffer,
11200 const void* pNext)
11201{
11202 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
11203 hAllocation->GetBlock() == this);
11204 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
11205 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
11206 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
11207 // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
11208 VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
11209 return hAllocator->BindVulkanBuffer(m_hMemory, memoryOffset, hBuffer, pNext);
11210}
11211
11212VkResult VmaDeviceMemoryBlock::BindImageMemory(
11213 VmaAllocator hAllocator,

Callers 1

vmaCreateAliasingBuffer2Function · 0.80

Calls 6

GetTypeMethod · 0.80
GetOffsetMethod · 0.80
BindVulkanBufferMethod · 0.80
GetMemoryMethod · 0.80
GetBlockMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected