From 55894a9bd17b7d717baf14a34b3611cff2d15124 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Fri, 25 Oct 2024 08:56:49 +0200 Subject: [PATCH] Allow jumbo sized memory allocations --- openVulkanoCpp/Vulkan/Resources/MemoryPool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openVulkanoCpp/Vulkan/Resources/MemoryPool.cpp b/openVulkanoCpp/Vulkan/Resources/MemoryPool.cpp index 15e9921..e925044 100644 --- a/openVulkanoCpp/Vulkan/Resources/MemoryPool.cpp +++ b/openVulkanoCpp/Vulkan/Resources/MemoryPool.cpp @@ -101,6 +101,7 @@ namespace OpenVulkano::Vulkan MemoryAllocation* MemoryPool::GetFreeMemoryAllocation(size_t size, vk::DeviceSize alignment, uint32_t type, bool createIfAllFull) { + constexpr size_t ALLOC_SIZE = 128_MiB; MemoryAllocation* alloc = nullptr; for (auto& allocation : allocations) { @@ -110,7 +111,7 @@ namespace OpenVulkano::Vulkan break; } } - if(!alloc && createIfAllFull) alloc = CreateMemoryAllocation(128_MiB, type, true); + if(!alloc && createIfAllFull) alloc = CreateMemoryAllocation(std::max(ALLOC_SIZE, size), type, true); return alloc; }