The first copy into a texture the title fills goes over zeros
VICTORY_COPY_OVER_TITLE=title: over what title memory holds; =0: over whatever the block of the pool held. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2c982ee5a5
commit
59bccacaf9
2 files changed
+61
-7
No files matched your search
@@ -1024,19 +1024,33 @@ extern "system" fn copy_texture_region(
|
||||
// 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
|
||||
// write is zeros, as in a texture that was an allocation of its own
|
||||
// (`VICTORY_COPY_OVER_TITLE=title`: what title memory holds, which
|
||||
// may be another texture's: specks on the waitress's forehead were
|
||||
// left in run n04). (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<bool> = 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);
|
||||
static OVER: std::sync::OnceLock<u8> = std::sync::OnceLock::new();
|
||||
let over = *OVER.get_or_init(|| match std::env::var("VICTORY_COPY_OVER_TITLE").as_deref() {
|
||||
Ok("0") => 0,
|
||||
Ok("title") => 1,
|
||||
_ => 2,
|
||||
});
|
||||
if over != 0 && crate::texture::title_written(to) && !crate::texture::host_wrote(dst.resource as usize) {
|
||||
// One a list uploaded, or a draw sampled, holds the title's.
|
||||
if over == 2 && !list.used(dst.resource as usize) && !crate::texture::is_staged(dst.resource) {
|
||||
if let Some(host) = crate::host::host() {
|
||||
ensure_state(list, dst.resource, COPY_DEST);
|
||||
let _ = list.first_use(dst.resource as usize);
|
||||
crate::texture::zeros(list, host, to);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user