Textures: detile linear levels a row at a time, tiled ones with per-row and per-column parts #474
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!474
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/474/head"
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?
@NiiRoZz on GitHub · 2026-11-24 00:49 UTC · original
NiiRoZz:nii/movie-speed→main· +76 −5 · 1 files · 1 commits · closed without mergingKept-in-step title textures are detiled on the CPU at every upload, one element at a time (
Chain::detile_level→element_at: three divisions, six table lookups and a bounds-checked copy per element). A retail title's intro movie is three linear R8 planes, 12.4 MB a frame, uploaded whenever the decoder writes them: on main the movie shows its picture (#283) but plays at 7 to 8 presented frames per 2 s, with ~1.75 s of every 2 s spent in the detile. Linear levels are now copied a row at a time, and tiled levels work out their address parts once per row and per column. The bytes are the same.Overlap: three open PRs opened shortly before this one make the same linear-level change: #440 (linear levels a row at a time), #458 (levels a row at a time) and #451 (reused upload memory and faster detiling, which also covers the upload cost listed under Not tested). I had not seen them when this was written. This one differs in also covering tiled levels with per-row and per-column parts and in its equivalence test over every mode; close it if one of those is taken.
What is in it
gpu/tiling.rs: two fast paths indetile_level(linear: whole rows; other modes: the x parts once per level, the y and slice parts once per row), and the testdetile_level_matches_element_at: againstelement_atbyte for byte, for every mode (linear too), element sizes 1 to 16 B, three pipe configurations, mips in and out of the tail, two slices, a base swizzle and a source cut short. With either new path broken on purpose the test fails.Tested
cargo test --release -p xcl --lib tiling: 12 passed.cargo test --workspace -- --test-threads=4: 671 passed, 0 failed, 41 ignored (SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, no wave64). That run was on main3516080plus this change; since then the commit was only rebased onto2997c9awithout conflicts.3516080with and without this change, one run each with the machine to itself: presented frames per 2 s during the intro movie 7–8 → 34–46; read + detile ~1.75 s → ~0.33 s per 2 s; the movie (15.0 s long) took ~19 s, one 4 s stall included.Regression run
Pending: the two 60 s
scripts/smoke.ps1runs (main, this PR's head), with scripted A presses so that the intro movie plays during the run, are queued on the test machine and will be added here.Not tested
AI use
@NiiRoZz on GitHub · 2026-11-24 00:53 UTC · original
Closing as a duplicate: #440, #458 and #451 were opened before this and make the same linear-level change. The equivalence test here (new paths against
element_atfor every mode) is free to take.AI-assisted.
Pull request closed