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

Function vmaAllocateMemoryForBuffer

include/vk_mem_alloc.h:15806–15844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15804}
15805
15806VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(
15807 VmaAllocator allocator,
15808 VkBuffer buffer,
15809 const VmaAllocationCreateInfo* pCreateInfo,
15810 VmaAllocation* pAllocation,
15811 VmaAllocationInfo* pAllocationInfo)
15812{
15813 VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation);
15814
15815 VMA_DEBUG_LOG("vmaAllocateMemoryForBuffer");
15816
15817 VMA_DEBUG_GLOBAL_MUTEX_LOCK
15818
15819 VkMemoryRequirements vkMemReq = {};
15820 bool requiresDedicatedAllocation = false;
15821 bool prefersDedicatedAllocation = false;
15822 allocator->GetBufferMemoryRequirements(buffer, vkMemReq,
15823 requiresDedicatedAllocation,
15824 prefersDedicatedAllocation);
15825
15826 VkResult result = allocator->AllocateMemory(
15827 vkMemReq,
15828 requiresDedicatedAllocation,
15829 prefersDedicatedAllocation,
15830 buffer, // dedicatedBuffer
15831 VK_NULL_HANDLE, // dedicatedImage
15832 VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage
15833 *pCreateInfo,
15834 VMA_SUBALLOCATION_TYPE_BUFFER,
15835 1, // allocationCount
15836 pAllocation);
15837
15838 if(pAllocationInfo && result == VK_SUCCESS)
15839 {
15840 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
15841 }
15842
15843 return result;
15844}
15845
15846VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
15847 VmaAllocator allocator,

Callers 1

allocateBufferMemoryMethod · 0.85

Calls 3

AllocateMemoryMethod · 0.80
GetAllocationInfoMethod · 0.80

Tested by 1

allocateBufferMemoryMethod · 0.68