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

Method AllocateDedicatedMemory

include/vk_mem_alloc.h:13636–13781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13634}
13635
13636VkResult VmaAllocator_T::AllocateDedicatedMemory(
13637 VmaPool pool,
13638 VkDeviceSize size,
13639 VmaSuballocationType suballocType,
13640 VmaDedicatedAllocationList& dedicatedAllocations,
13641 uint32_t memTypeIndex,
13642 bool map,
13643 bool isUserDataString,
13644 bool isMappingAllowed,
13645 bool canAliasMemory,
13646 void* pUserData,
13647 float priority,
13648 VkBuffer dedicatedBuffer,
13649 VkImage dedicatedImage,
13650 VmaBufferImageUsage dedicatedBufferImageUsage,
13651 size_t allocationCount,
13652 VmaAllocation* pAllocations,
13653 const void* pNextChain)
13654{
13655 VMA_ASSERT(allocationCount > 0 && pAllocations);
13656
13657 VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
13658 allocInfo.memoryTypeIndex = memTypeIndex;
13659 allocInfo.allocationSize = size;
13660 allocInfo.pNext = pNextChain;
13661
13662#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
13663 VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
13664 if(!canAliasMemory)
13665 {
13666 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
13667 {
13668 if(dedicatedBuffer != VK_NULL_HANDLE)
13669 {
13670 VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE);
13671 dedicatedAllocInfo.buffer = dedicatedBuffer;
13672 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
13673 }
13674 else if(dedicatedImage != VK_NULL_HANDLE)
13675 {
13676 dedicatedAllocInfo.image = dedicatedImage;
13677 VmaPnextChainPushFront(&allocInfo, &dedicatedAllocInfo);
13678 }
13679 }
13680 }
13681#endif // #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
13682
13683#if VMA_BUFFER_DEVICE_ADDRESS
13684 VkMemoryAllocateFlagsInfoKHR allocFlagsInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR };
13685 if(m_UseKhrBufferDeviceAddress)
13686 {
13687 bool canContainBufferWithDeviceAddress = true;
13688 if(dedicatedBuffer != VK_NULL_HANDLE)
13689 {
13690 canContainBufferWithDeviceAddress = dedicatedBufferImageUsage == VmaBufferImageUsage::UNKNOWN ||
13691 dedicatedBufferImageUsage.Contains(VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT);
13692 }
13693 else if(dedicatedImage != VK_NULL_HANDLE)

Callers

nothing calls this directly

Calls 7

VmaPnextChainPushFrontFunction · 0.85
ContainsMethod · 0.80
RegisterMethod · 0.80
GetMemoryMethod · 0.80
RemoveAllocationMethod · 0.80
GetSizeMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected