Past the hard count of released textures, drop the cheapest ones first, in one walk per batch.

Past RELEASED_HARD (16,384) the sweep dropped the first released entry in release order that was overwritten or unsampled for 2 s, render targets included, whose drop vk_texture.c already ties to a black frame, and it walked the list from its head for every drop. At the end of the 2026-11-13 session the count sat at 16,384 for a minute while 12,811 of 15,734 released entries owned no memory. The entries now go by class: overwritten ones, then ones that come back intact and are past their usual take-back gap, then other intact ones, and only then ones whose content only the GPU made; still only unsampled ones, and the one sampled longest ago when all were sampled lately, as before. One walk takes a batch down to 256 under the bound. tex_hard_order = 0 keeps the rule of 0.10.1.

The drops past the hard count get a reason of their own, so the texture origins line and the reuse line count them apart from the sweep's drops past RELEASED_MAX, with the classes they came from. The class rules are in vk_tex_release.h and checked by tests/tex_release_check.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:35:40 -05:00
parent 7aa29ff12a
commit 2969005edc
5 changed files with 154 additions and 22 deletions

View File

@@ -440,6 +440,10 @@
# Textures the game released that are kept as they are (1 to 16384); past this count only those that lose nothing
# when dropped go. Default: one per 2 MB of the video memory budget, 2048 to 8192. Read at start.
# tex_released_max = 4096
# Past 16384 kept textures some go whatever they cost. 1: the cheapest first: those drawn over, then those that come
# back unchanged from the game's memory (the oldest first), and only then those whose content only the GPU made, which
# would come back empty. 0: the first one in release order that nothing showed for 2 seconds, of any kind (0.10.1).
# tex_hard_order = 1
# Megabytes of this process's commit above which the log says so. Windows counts video memory against the commit;
# with a discrete GPU the video memory in use is left out of the comparison, since it is not in RAM. Textures no longer
# give way at this bound: dropping one lowers both sides of the comparison alike, so nothing they could do brought the