Copy equal-length tile pieces with a constant length when detiling #37
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!37
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-37"
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 12:33 UTC · original
romainhedouin:perf/detile-runs→main· +33 −2 · 1 files · 1 commits · closed without mergingTextures the title changes are detiled on the CPU, before they go to the GPU. For the common tile modes a texture row is a long series of 8, 16 or 32-byte pieces, and each piece was copied with a general
memcpycall of variable length. Now, when all pieces of a row have the same length (all but the last, which the width can cut short), they are copied with that length as a constant, so each copy is a few moves. The last piece and any other case take the old path. Tiling (the reverse) gets the same.Output is byte-for-byte identical to the old code in 339 comparisons (several element sizes, BC1/BC7, every addressable tile mode, odd widths, all mips, padded pitches, 3D).
cargo test -p victory-formatspasses; clippy for Windows reports no new warnings. No signature changes.🤖 Generated with Claude Code
@lcg007xd-c on GitHub · 2026-11-25 21:21 UTC · original · approved these changes
Verified on Linux (Rust 1.98.1)
cargo test -p victory-formats --libon1e2006c: 24 passed, 0 failed, 4 ignored. The same with the PR merged into current main (--no-commit).cargo clippy -p victory-formats --target x86_64-pc-windows-msvc: 0 warnings, same as main.git merge --no-commit --no-ffinto main: clean. It also merges cleanly on top of #21, which edits the samewalkfunction.detileand thentilewith padded row and depth pitches, and hashes the results and both buffers. 4,144 cases give the same hash on main and on the PR (55cb57aecc5c86ff).That's a 1.3–2× speedup on x86_64, the same direction as the Mac numbers.
Review notes
copy_runs::<N>withN != 0is only called onwhole, and every run inwholehas lengthsame == N. Single-run rows (wholeempty) and mixed lengths go throughN = 0as before, and the last, shorter run is always copied with its own length.Not verified
Reviewed with Claude Code.
@romainhedouin on GitHub · 2026-11-26 22:25 UTC · original
Closing:
a-publieralready copies equal-length tile pieces with a constant length, throughcopy_runs::<N, DETILE>for 8, 16 and 32 bytes, tiling included (texture.rs:783). Thanks for the equivalence check and the x86 numbers.Pull request closed