From 1d8e3d10735b18d6d382e6b315cf45141b3301f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0l=C3=A9gl?= Date: Tue, 24 Nov 2026 01:40:12 +0100 Subject: [PATCH] perf(kyty): allocate device memory in 64 MiB VMA blocks VMA allocates memory for large heaps in 256 MiB blocks by default. Freed allocations leave partly used blocks behind: in 007 on a 16 GB card the allocator held 4.2-4.7 GiB of block memory that no allocation used, and device-local usage stayed 1.9-2.3 GiB over the memory budget, with the excess placed in GTT. Use 64 MiB blocks for large heaps. VMA's heuristic now gives allocations above 32 MiB memory of their own. --- core/kyty/graphics/host_gpu/vma.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/kyty/graphics/host_gpu/vma.cpp b/core/kyty/graphics/host_gpu/vma.cpp index 7039856f62f..172c9dc5415 100644 --- a/core/kyty/graphics/host_gpu/vma.cpp +++ b/core/kyty/graphics/host_gpu/vma.cpp @@ -162,6 +162,7 @@ bool GraphicContext::CreateAllocator() { if (memory_budget_ext_enabled) { info.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT; } + info.preferredLargeHeapBlockSize = 64ull * 1024 * 1024; const auto result = static_cast(vmaCreateAllocator(&info, &allocator)); if (result != vk::Result::eSuccess) {