mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-30 02:04:35 +00:00
Fill out the VmaAllocationInfo parameter passed to vmaAllocateMemory, vmaAllocateMemoryForBuffer, and vmaAllocateMemoryForImage.
This commit is contained in:
parent
816b55748a
commit
f6bbb2053b
@ -5112,16 +5112,18 @@ VkResult vmaAllocateMemory(
|
|||||||
|
|
||||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||||
|
|
||||||
return allocator->AllocateMemory(
|
VkResult result = allocator->AllocateMemory(
|
||||||
*pVkMemoryRequirements,
|
*pVkMemoryRequirements,
|
||||||
*pVmaMemoryRequirements,
|
*pVmaMemoryRequirements,
|
||||||
VMA_SUBALLOCATION_TYPE_UNKNOWN,
|
VMA_SUBALLOCATION_TYPE_UNKNOWN,
|
||||||
pAllocation);
|
pAllocation);
|
||||||
|
|
||||||
if(pAllocationInfo)
|
if(pAllocationInfo && result == VK_SUCCESS)
|
||||||
{
|
{
|
||||||
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult vmaAllocateMemoryForBuffer(
|
VkResult vmaAllocateMemoryForBuffer(
|
||||||
@ -5140,16 +5142,18 @@ VkResult vmaAllocateMemoryForBuffer(
|
|||||||
VkMemoryRequirements vkMemReq = {};
|
VkMemoryRequirements vkMemReq = {};
|
||||||
vkGetBufferMemoryRequirements(allocator->m_hDevice, buffer, &vkMemReq);
|
vkGetBufferMemoryRequirements(allocator->m_hDevice, buffer, &vkMemReq);
|
||||||
|
|
||||||
return allocator->AllocateMemory(
|
VkResult result = allocator->AllocateMemory(
|
||||||
vkMemReq,
|
vkMemReq,
|
||||||
*pMemoryRequirements,
|
*pMemoryRequirements,
|
||||||
VMA_SUBALLOCATION_TYPE_BUFFER,
|
VMA_SUBALLOCATION_TYPE_BUFFER,
|
||||||
pAllocation);
|
pAllocation);
|
||||||
|
|
||||||
if(pAllocationInfo)
|
if(pAllocationInfo && result == VK_SUCCESS)
|
||||||
{
|
{
|
||||||
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult vmaAllocateMemoryForImage(
|
VkResult vmaAllocateMemoryForImage(
|
||||||
@ -5165,17 +5169,19 @@ VkResult vmaAllocateMemoryForImage(
|
|||||||
|
|
||||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||||
|
|
||||||
return AllocateMemoryForImage(
|
VkResult result = AllocateMemoryForImage(
|
||||||
allocator,
|
allocator,
|
||||||
image,
|
image,
|
||||||
pMemoryRequirements,
|
pMemoryRequirements,
|
||||||
VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
|
VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
|
||||||
pAllocation);
|
pAllocation);
|
||||||
|
|
||||||
if(pAllocationInfo)
|
if(pAllocationInfo && result == VK_SUCCESS)
|
||||||
{
|
{
|
||||||
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vmaFreeMemory(
|
void vmaFreeMemory(
|
||||||
|
Loading…
Reference in New Issue
Block a user