Stop re-zeroing the texture scratch buffer, and reuse the placed-texture set #63
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!63
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-63"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@romainhedouin on GitHub · 2026-11-25 13:16 UTC · original
romainhedouin:perf/texture-refresh-no-zero-fill→main· +23 −10 · 2 files · 1 commits · closed without mergingTwo small cuts in texture refresh:
resize(size, 0). Every time a texture was bigger than the previous one, the extra part was zero-filled, then immediately overwritten by the copy (which writes every byte, zeros for unreadable pages). The buffer now keeps its length, aswith_tiled_copyalready does, so only a texture bigger than any before is zero-filled. The diagnostics mode that skips copies still hashes zeros.placed_live. It rebuilt a set of every placed texture fromPLACED_TEXTURESwith one hash insert each, whilePLACED_LIVEalready holds exactly that set (both change together under the same lock). It now clonesPLACED_LIVE.placed_live, model benchmark, 20,000 placed textures"Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. Type-checked for Windows (
cargo clippy --target x86_64-pc-windows-msvc, with and without--all-features, no new warnings); not run.🤖 Generated with Claude Code
@ -336,1 +342,4 @@crate::host::copy_mapped(tiled.as_mut_ptr(), self.memory, size, false);// The diagnostics mode without copies writes nothing: it hashes zeros, as before.#[cfg(feature = "diagnostics")]if crate::copystat::mode() == 2 {@gut0to on GitHub · 2026-11-25 15:09 UTC · original
Could a diagnostics-mode regression test prefill the retained scratch buffer with nonzero bytes, run a no-copy refresh, and verify that the hash sees zeros? That explicit fill preserves the old behavior after scratch stops being resized to zero on every refresh. AI-assisted review; I checked the diagnostics-only zero-fill and scratch reuse path.
@gut0to on GitHub · 2026-11-25 15:09 UTC · original · reviewed
AI-assisted review: I checked the changed behavior and the associated test coverage.
@romainhedouin on GitHub · 2026-11-26 22:24 UTC · original
Closing: on
a-publierthe texture read buffer already only grows (with_read, texture.rs:433), and the placed-texture set this PR reused doesn't exist.Pull request closed