Protection against incorrect (0 or very large) memory budget returned by some bugged drivers

2 other minor fixes.
This commit is contained in:
Adam Sawicki 2020-03-09 16:58:18 +01:00
parent 36af654b84
commit 6a93b8aa5f
3 changed files with 24 additions and 4 deletions

View file

@ -1163,7 +1163,8 @@ void SetAllocatorCreateInfo(VmaAllocatorCreateInfo& outInfo)
outInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT;
}
#if !defined(VMA_MEMORY_BUDGET) || VMA_MEMORY_BUDGET == 1
if(VK_EXT_memory_budget_enabled && VK_KHR_get_physical_device_properties2_enabled)
if(VK_EXT_memory_budget_enabled && (
GetVulkanApiVersion() >= VK_API_VERSION_1_1 || VK_KHR_get_physical_device_properties2_enabled))
{
outInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT;
}