Allow jumbo sized memory allocations
This commit is contained in:
@@ -101,6 +101,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
|
|
||||||
MemoryAllocation* MemoryPool::GetFreeMemoryAllocation(size_t size, vk::DeviceSize alignment, uint32_t type, bool createIfAllFull)
|
MemoryAllocation* MemoryPool::GetFreeMemoryAllocation(size_t size, vk::DeviceSize alignment, uint32_t type, bool createIfAllFull)
|
||||||
{
|
{
|
||||||
|
constexpr size_t ALLOC_SIZE = 128_MiB;
|
||||||
MemoryAllocation* alloc = nullptr;
|
MemoryAllocation* alloc = nullptr;
|
||||||
for (auto& allocation : allocations)
|
for (auto& allocation : allocations)
|
||||||
{
|
{
|
||||||
@@ -110,7 +111,7 @@ namespace OpenVulkano::Vulkan
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!alloc && createIfAllFull) alloc = CreateMemoryAllocation(128_MiB, type, true);
|
if(!alloc && createIfAllFull) alloc = CreateMemoryAllocation(std::max(ALLOC_SIZE, size), type, true);
|
||||||
return alloc;
|
return alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user