Give back the ASTC decoder's grown scratch 5 s after its last large texture, not at the next upload.

A scratch grown past 32 MiB for a large texture went back to the usual size only when the next ASTC upload asked for one, so in the 2026-11-13 session the decoder held 224 MiB for the 70 s after the first area load and from a later load to the session's end. Each present now gives it back once no texture needed more for 5 s; nothing is made then, the next request makes the usual scratch, and the buffer is freed once the upload batches recorded so far completed, as before. The present only tries the decoder's lock, which can be held while VMA makes a block. astc_scratch_trim = 0 keeps the scratch until the next upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:44:24 -05:00
parent b81a9561ca
commit 1fa8b61b87
5 changed files with 31 additions and 5 deletions

View File

@@ -364,6 +364,9 @@
# With astc = gpu: 1 keeps the decoder's scratch buffer from one upload batch to the next instead of making it again for
# each, to shorten the hitches when an area loads (0 = one per batch).
# astc_scratch_keep = 1
# With astc_scratch_keep = 1: 1 gives back a scratch grown for a large texture 5 s after the last one needed it (up to
# 192 MiB of video memory after an area load); 0 keeps it until the next ASTC upload, as in 0.10.1.
# astc_scratch_trim = 1
# With astc = gpu: 1 stages a texture's ASTC blocks in the shared staging ranges instead of a buffer of their own
# (0 = a buffer each).
# astc_arena = 1