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

Function vmaAllocateMemory

include/vk_mem_alloc.h:16275–16307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16273}
16274
16275VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(
16276 VmaAllocator allocator,
16277 const VkMemoryRequirements* pVkMemoryRequirements,
16278 const VmaAllocationCreateInfo* pCreateInfo,
16279 VmaAllocation* pAllocation,
16280 VmaAllocationInfo* pAllocationInfo)
16281{
16282 VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation);
16283
16284 VMA_DEBUG_LOG("vmaAllocateMemory");
16285
16286 VMA_DEBUG_GLOBAL_MUTEX_LOCK
16287
16288 VkResult result = allocator->AllocateMemory(
16289 *pVkMemoryRequirements,
16290 false, // requiresDedicatedAllocation
16291 false, // prefersDedicatedAllocation
16292 VK_NULL_HANDLE, // dedicatedBuffer
16293 VK_NULL_HANDLE, // dedicatedImage
16294 VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage
16295 VMA_NULL, // pMemoryAllocateNext
16296 *pCreateInfo,
16297 VMA_SUBALLOCATION_TYPE_UNKNOWN,
16298 1, // allocationCount
16299 pAllocation);
16300
16301 if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
16302 {
16303 allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
16304 }
16305
16306 return result;
16307}
16308
16309VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateDedicatedMemory(
16310 VmaAllocator allocator,

Callers 6

TestJsonFunction · 0.85
TestInvalidAllocationsFunction · 0.85
BenchmarkAlgorithmsCaseFunction · 0.85
TestPool_SameSizeFunction · 0.85
TestAliasingFunction · 0.85

Calls 2

AllocateMemoryMethod · 0.80
GetAllocationInfoMethod · 0.80

Tested by 6

TestJsonFunction · 0.68
TestInvalidAllocationsFunction · 0.68
BenchmarkAlgorithmsCaseFunction · 0.68
TestPool_SameSizeFunction · 0.68
TestAliasingFunction · 0.68