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; }