Stop re-zeroing the texture scratch buffer, and reuse the placed-texture set #63
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by romainhedouin on 2026-11-25T13:16:13Z.
Two 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
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:09:03Z.
Review: COMMENTED
AI-assisted review: I checked the changed behavior and the associated test coverage.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:09:03Z.
Code review location:
crates/victory-gpu/src/texture.rs; line 345Could 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.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by romainhedouin on 2026-11-26T22:24:32Z.
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