render3d/vk: the kept descriptor sets start over after 256 textures are freed

gvk_sc_make's cache (program + bound textures -> a set in the kept pool) evicted
nothing until the pool's 8192 sets filled. A texture freed - a photograph's
thumbnail, a wall frame, any picture a screen loads - left its entries and their
sets behind for good, since its handle's generation moved on and the key could
never match again: 262 KB over 12 minutes of the user's play, and bound only by
the pool, hours away.

gvk_tex_release counts the releases (gvk_sc_dead); at GVK_SC_DEAD_MAX (256) the
next frame's start resets the kept pool and empties the cache (gvk_kpool_reset,
which waits for the frame in flight), and each draw still in use makes its set
again the first time it is drawn - the budget is the live combinations plus at
most 256 textures' dead ones. The declared reason on gvk_sc_make was the
swapchain's, copied; it now says what the cache is and what bounds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 13:41:35 +03:00
parent f38581754a
commit 99f8749949
3 changed files with 9 additions and 1 deletions

View file

@ -169,6 +169,7 @@ export state Render3dState {
gvk_family: int = -1
gvk_mp: bytes = null # VkPhysicalDeviceMemoryProperties
gvk_device_name: string = ""
gvk_sc_dead: int = 0 # textures released since the kept-set cache was emptied
gvk_read_px: bytes = null # gvk_read_screen's read-back, gvk_read_cap bytes, made again only at a new size
gvk_read_cap: int = 0
gvk_renderer_name: string = "" # "<device> (Vulkan)", made once with the device