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

Function vmaAllocateMemoryForImage

include/vk_mem_alloc.h:15846–15883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15844}
15845
15846VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(
15847 VmaAllocator allocator,
15848 VkImage image,
15849 const VmaAllocationCreateInfo* pCreateInfo,
15850 VmaAllocation* pAllocation,
15851 VmaAllocationInfo* pAllocationInfo)
15852{
15853 VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation);
15854
15855 VMA_DEBUG_LOG("vmaAllocateMemoryForImage");
15856
15857 VMA_DEBUG_GLOBAL_MUTEX_LOCK
15858
15859 VkMemoryRequirements vkMemReq = {};
15860 bool requiresDedicatedAllocation = false;
15861 bool prefersDedicatedAllocation = false;
15862 allocator->GetImageMemoryRequirements(image, vkMemReq,
15863 requiresDedicatedAllocation, prefersDedicatedAllocation);
15864
15865 VkResult result = allocator->AllocateMemory(
15866 vkMemReq,
15867 requiresDedicatedAllocation,
15868 prefersDedicatedAllocation,
15869 VK_NULL_HANDLE, // dedicatedBuffer
15870 image, // dedicatedImage
15871 VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage
15872 *pCreateInfo,
15873 VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
15874 1, // allocationCount
15875 pAllocation);
15876
15877 if(pAllocationInfo && result == VK_SUCCESS)
15878 {
15879 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
15880 }
15881
15882 return result;
15883}
15884
15885VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(
15886 VmaAllocator allocator,

Callers 1

allocateImageMemoryMethod · 0.85

Calls 3

AllocateMemoryMethod · 0.80
GetAllocationInfoMethod · 0.80

Tested by 1

allocateImageMemoryMethod · 0.68