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

Method BindImageMemory

include/vk_mem_alloc.h:11212–11227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11210}
11211
11212VkResult VmaDeviceMemoryBlock::BindImageMemory(
11213 VmaAllocator hAllocator,
11214 VmaAllocation hAllocation,
11215 VkDeviceSize allocationLocalOffset,
11216 VkImage hImage,
11217 const void* pNext)
11218{
11219 VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
11220 hAllocation->GetBlock() == this);
11221 VMA_ASSERT(allocationLocalOffset < hAllocation->GetSize() &&
11222 "Invalid allocationLocalOffset. Did you forget that this offset is relative to the beginning of the allocation, not the whole memory block?");
11223 const VkDeviceSize memoryOffset = hAllocation->GetOffset() + allocationLocalOffset;
11224 // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
11225 VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex);
11226 return hAllocator->BindVulkanImage(m_hMemory, memoryOffset, hImage, pNext);
11227}
11228
11229#if VMA_EXTERNAL_MEMORY_WIN32
11230VkResult VmaDeviceMemoryBlock::CreateWin32Handle(const VmaAllocator hAllocator, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* pHandle) noexcept

Callers 1

vmaCreateAliasingImage2Function · 0.80

Calls 6

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

Tested by

no test coverage detected