0.2.0-dev Download ZIP
38 lines ·2.2 KB Raw
| 1 | diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h |
| 2 | index c5b78fa384219dd326aa0aa804702c14478e055b..c854099c692e2c2d8bde52c848414e8c12fdd059 100644 |
| 3 | --- a/thirdparty/vulkan/vk_mem_alloc.h |
| 4 | +++ b/thirdparty/vulkan/vk_mem_alloc.h |
| 5 | @@ -479,6 +479,8 @@ typedef enum VmaAllocatorCreateFlagBits |
| 6 | */ |
| 7 | VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT = 0x00000200, |
| 8 | |
| 9 | + VMA_ALLOCATOR_CREATE_IGNORE_MAX_MEMORY_ALLOCATION_COUNT_BIT = 0x00000400, |
| 10 | + |
| 11 | VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF |
| 12 | } VmaAllocatorCreateFlagBits; |
| 13 | /// See #VmaAllocatorCreateFlagBits. |
| 14 | @@ -10308,6 +10310,7 @@ public: |
| 15 | bool m_UseKhrMaintenance4; |
| 16 | bool m_UseKhrMaintenance5; |
| 17 | bool m_UseKhrExternalMemoryWin32; |
| 18 | + bool m_IgnoreMaxMemoryAllocationCount; |
| 19 | const VkDevice m_hDevice; |
| 20 | const VkInstance m_hInstance; |
| 21 | const bool m_AllocationCallbacksSpecified; |
| 22 | @@ -12991,6 +12994,7 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : |
| 23 | m_UseKhrMaintenance4((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT) != 0), |
| 24 | m_UseKhrMaintenance5((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT) != 0), |
| 25 | m_UseKhrExternalMemoryWin32((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT) != 0), |
| 26 | + m_IgnoreMaxMemoryAllocationCount((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_IGNORE_MAX_MEMORY_ALLOCATION_COUNT_BIT) != 0), |
| 27 | m_hDevice(pCreateInfo->device), |
| 28 | m_hInstance(pCreateInfo->instance), |
| 29 | m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL), |
| 30 | @@ -14490,7 +14494,7 @@ VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAlloc |
| 31 | AtomicTransactionalIncrement<VMA_ATOMIC_UINT32> deviceMemoryCountIncrement; |
| 32 | const uint64_t prevDeviceMemoryCount = deviceMemoryCountIncrement.Increment(&m_DeviceMemoryCount); |
| 33 | #if VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT |
| 34 | - if(prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount) |
| 35 | + if(!m_IgnoreMaxMemoryAllocationCount && prevDeviceMemoryCount >= m_PhysicalDeviceProperties.limits.maxMemoryAllocationCount) |
| 36 | { |
| 37 | return VK_ERROR_TOO_MANY_OBJECTS; |
| 38 | } |