Texture uploads wait for no mapping, ask no guards and hash cheaply; the sweep looks at a part; bakes pass once for what is new

A bake's uploads waited for the lock the runtime holds while it remaps, and a staging buffer a draw kept waited at every later
refresh (29 to 239 ms a frame, all threads, run n04): gone, a read through the kernel gets every page. A staging buffer made for
one upload asks neither the write watch nor the guards (VICTORY_TEXTURE_ONCE=0: as before). blake3 makes way for a 128-bit digest
(0.035 against 0.2 ms a megabyte). While textures are kept for minutes the sweep looks at 8,192 a time (VICTORY_TEXTURE_SWEEP=whole).
The pass before a bake is made again only for something new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 05:14:38 -06:00
1 parent 917e1a7103
commit 2dfba4dbd8
5 files changed
+215 -38

No files matched your search

@@ -1358,6 +1358,14 @@ impl HostHeap {
(if max == 0 { Vec::new() } else { textures.due(frame, max) }, textures.census(frame))
}
/// A number that changes when a slot is written or made due anew, and
/// whether memory was noted since a pass last took the notes.
pub(crate) fn texture_news(&self) -> (u64, bool) {
let writes = self.textures.lock().unwrap_or_else(|e| e.into_inner()).writes;
let noted = |ranges: &Mutex<Vec<(u64, u64)>>| !ranges.lock().unwrap_or_else(|e| e.into_inner()).is_empty();
(writes, noted(&REMAPPED) || noted(&PAGE_WRITTEN))
}
/// Every title slot of the queue that is due at `frame`, and whether
/// it was uploaded before (in part, or whole and waiting for another
/// look): for the card accounting line