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

Method GetImageMemoryRequirements

include/vk_mem_alloc.h:13868–13898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13866}
13867
13868void VmaAllocator_T::GetImageMemoryRequirements(
13869 VkImage hImage,
13870 VkMemoryRequirements& memReq,
13871 bool& requiresDedicatedAllocation,
13872 bool& prefersDedicatedAllocation) const
13873{
13874#if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
13875 if(m_UseKhrDedicatedAllocation || m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0))
13876 {
13877 VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
13878 memReqInfo.image = hImage;
13879
13880 VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
13881
13882 VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
13883 VmaPnextChainPushFront(&memReq2, &memDedicatedReq);
13884
13885 (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
13886
13887 memReq = memReq2.memoryRequirements;
13888 requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
13889 prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
13890 }
13891 else
13892#endif // #if VMA_DEDICATED_ALLOCATION || VMA_VULKAN_VERSION >= 1001000
13893 {
13894 (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq);
13895 requiresDedicatedAllocation = false;
13896 prefersDedicatedAllocation = false;
13897 }
13898}
13899
13900VkResult VmaAllocator_T::FindMemoryTypeIndex(
13901 uint32_t memoryTypeBits,

Callers 2

vmaCreateImageFunction · 0.80

Calls 1

VmaPnextChainPushFrontFunction · 0.85

Tested by

no test coverage detected