From c14283ee2dacb8d462f1c89ddd51ee5e39f26bbf Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 29 Sep 2026 10:58:33 -0400 Subject: [PATCH] [Docs] (Magma): the trim threshold's comment states the bound its argument proves - a growth adds at most twice what the slot held, so the slot stays over a third full --- MobileGL/MG_Backend/DirectVulkan/Renderer/UniformManager.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/UniformManager.h b/MobileGL/MG_Backend/DirectVulkan/Renderer/UniformManager.h index 99dc160a..0b8f5469 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/UniformManager.h +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/UniformManager.h @@ -162,9 +162,10 @@ namespace MobileGL::MG_Backend::DirectVulkan { // count times kDescriptorTrimHeadroom still fits its capacity; a slot that has been quiet for // MOBILEGL_MAGMA_DESCRIPTOR_TRIM_FRAMES consecutive epochs, and holds at least // kDescriptorTrimMinCapacity sets, is trimmed. The headroom is what keeps the trim from - // thrashing: geometric growth leaves a re-grown slot at least a third full (its pools sum to - // under twice the largest, and the largest is under twice the need that added it), so the - // epoch that grew a slot is never quiet for it. The floor keeps a slot sized for ordinary + // thrashing: geometric growth leaves a re-grown slot at least a third full (the pool a growth + // adds is at most twice the largest before it, so at most twice everything the slot held, and + // the epoch that grew it needed more than that), so the epoch that grew a slot is never quiet + // for it. The floor keeps a slot sized for ordinary // frames from being trimmed at all - the trim exists to give back a burst. static constexpr Uint32 kDescriptorTrimHeadroom = 4; static constexpr Uint32 kDescriptorTrimMinCapacity = 1024;