What was wrong: each uploaded texture kept an upload buffer of its own
size for life, in system memory: 0.2 GB on main (run textures5),
2.6-2.8 GB once placed textures are made when shaders read them (run
integ2). Making a buffer for every upload instead (066fbbeb, run
textures8) released them, but the menu movie, which rewrites 12.7 MB of
textures every frame, then paid ~5 ms a frame for fresh buffers: texture
preparation 12.7-13.8 ms in textures8 against 8.0-8.4 in textures7.
What changed: every upload is recorded at submission by the submission's
own list (23a4b62b), and `Host::execute` waits for each submission, so a
staging buffer is free again from the next submission on. Detiles take a
buffer of the same size from a pool shared by all textures, or make one;
the buffers one submission used go back to the pool before the next
one's uploads, and the pool keeps at most 64 MiB of free buffers (oldest
dropped). The staging state keeps only the layout, the change tracking
and the last hash. The memory line no longer gives "texture staging".
Evidence: textures8 (one buffer per upload) ended at 7,871 MB of system
memory and 24,771 MB of commit against textures7's 8,254 and 25,130
(206 MB of staging gone), no out-of-memory and no removal in 200 s. Test
`draw::tests::a_texture_owning_its_pages_is_uploaded_on_any_write` now
also checks that a reused buffer carries the new bytes (WARP).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fdf34ab7ba
·
2026-11-25 10:24:28 +01:00
History