Added VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes

This commit is contained in:
Adam Sawicki 2020-10-23 16:10:49 +02:00
parent 3dadc82bce
commit 76411c95c0
2 changed files with 54 additions and 1 deletions

View file

@ -1179,6 +1179,19 @@ void SetAllocatorCreateInfo(VmaAllocatorCreateInfo& outInfo)
heapSizeLimit[0] = 512ull * 1024 * 1024;
outInfo.pHeapSizeLimit = heapSizeLimit.data();
*/
// External memory test
VkPhysicalDeviceMemoryProperties memProps = {};
vkGetPhysicalDeviceMemoryProperties(g_hPhysicalDevice, &memProps);
static VkExternalMemoryHandleTypeFlagsKHR externalMemoryHandleTypes[VK_MAX_MEMORY_TYPES] = {};
for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i)
{
if(memProps.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
{
externalMemoryHandleTypes[i] = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
}
}
outInfo.pTypeExternalMemoryHandleTypes = externalMemoryHandleTypes;
}
static void PrintPhysicalDeviceProperties(const VkPhysicalDeviceProperties& properties)