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

Function vmaCreateAliasingImage2

include/vk_mem_alloc.h:16632–16673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16630}
16631
16632VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingImage2(
16633 VmaAllocator VMA_NOT_NULL allocator,
16634 VmaAllocation VMA_NOT_NULL allocation,
16635 VkDeviceSize allocationLocalOffset,
16636 const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo,
16637 VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage)
16638{
16639 VMA_ASSERT(allocator && pImageCreateInfo && pImage && allocation);
16640
16641 *pImage = VK_NULL_HANDLE;
16642
16643 VMA_DEBUG_LOG("vmaCreateImage2");
16644
16645 if (pImageCreateInfo->extent.width == 0 ||
16646 pImageCreateInfo->extent.height == 0 ||
16647 pImageCreateInfo->extent.depth == 0 ||
16648 pImageCreateInfo->mipLevels == 0 ||
16649 pImageCreateInfo->arrayLayers == 0)
16650 {
16651 return VK_ERROR_INITIALIZATION_FAILED;
16652 }
16653
16654 VMA_DEBUG_GLOBAL_MUTEX_LOCK
16655
16656 // 1. Create VkImage.
16657 VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
16658 allocator->m_hDevice,
16659 pImageCreateInfo,
16660 allocator->GetAllocationCallbacks(),
16661 pImage);
16662 if (res >= 0)
16663 {
16664 // 2. Bind image with memory.
16665 res = allocator->BindImageMemory(allocation, allocationLocalOffset, *pImage, VMA_NULL);
16666 if (res >= 0)
16667 {
16668 return VK_SUCCESS;
16669 }
16670 (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
16671 }
16672 return res;
16673}
16674
16675VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(
16676 VmaAllocator VMA_NOT_NULL allocator,

Callers 1

vmaCreateAliasingImageFunction · 0.85

Calls 2

BindImageMemoryMethod · 0.80

Tested by

no test coverage detected