From 4b826da3771e29520b741bb73cae384086d93310 Mon Sep 17 00:00:00 2001 From: local Date: Wed, 25 Nov 2026 04:14:51 -0600 Subject: [PATCH] The first copy into a texture the title fills goes over what title memory holds What the copy does not write was whatever the block of the pool held: the atlas of baked decorations (a 2048x2048 BC3 texture of which a bake writes 256x256 at most) drew other textures' bytes over the waitress's face. VICTORY_COPY_OVER_TITLE=0: as before. With a measurement of what a cold texture costs. Co-Authored-By: Claude Opus 5.5 --- crates/victory-gpu/src/list.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/victory-gpu/src/list.rs b/crates/victory-gpu/src/list.rs index 140b755..84aa3a3 100644 --- a/crates/victory-gpu/src/list.rs +++ b/crates/victory-gpu/src/list.rs @@ -1023,6 +1023,25 @@ extern "system" fn copy_texture_region( // A depth texture shaders also write: what they wrote, first (the // source above too). list.twin_use(dst.resource, false, true); + // The first copy into a texture of the title's: what it does not + // write is what title memory holds, as on the console. (The host + // copy is cut from a block and held whatever lay there, and no + // upload is made once a copy wrote it: the atlas the title copies + // its baked decorations into, a 2048x2048 BC3 texture of which a + // bake writes 256x256 at most, was drawn over a character's face + // with other textures' bytes wherever nothing was baked, runs n01 and + // textures-1.) + static OVER: std::sync::OnceLock = std::sync::OnceLock::new(); + if *OVER.get_or_init(|| std::env::var_os("VICTORY_COPY_OVER_TITLE").is_none_or(|v| v != "0")) + && crate::texture::title_written(to) + && !crate::texture::host_wrote(dst.resource as usize) + { + crate::texture::upload(list, dst.resource, to); + // (Done before the title's copy writes over it.) + if list.used(dst.resource as usize) { + ensure_state(list, dst.resource, COPY_SOURCE); + } + } // A destination made level by level gets the level's memory ahead // of this list (`crate::tiles`): the title's bake copies each level // of its result into a block-compressed texture of that kind, and