| 11193 | } |
| 11194 | |
| 11195 | VkResult 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 | |
| 11212 | VkResult VmaDeviceMemoryBlock::BindImageMemory( |
| 11213 | VmaAllocator hAllocator, |
no test coverage detected