Repository navigation
Conversation
…ow and per-column parts `Chain::detile_level` computed every element's address from scratch (`element_at`: block index, six table lookups, divisions) and copied it with a bounds check. Kept-in-step title textures are detiled on the CPU at every upload. A retail title's intro movie is decoded on the CPU into three linear R8 planes (3840x2160 + 2 x 1920x1080, 12.4 MB a frame) that are uploaded again whenever the decoder writes them: on main 85bdf21..3516080 detiling took ~1.75 s of every 2 s of the movie, and it played at 7-8 presented frames per 2 s. - Linear levels (mode 0, no base swizzle, not in a mip tail): each row is copied whole, `pitch` elements apart (the case gw1337x profiled in ivall#283; also closed PR ivall#334). - Other levels: the address is a block row part plus a block column part, and the XOR of an x part and a y (and slice) part; the x parts are worked out once per level, the y parts once per row. Same bytes as before: a new test compares with `element_at` for every mode (linear too), each element size, three pipe configurations, mips in and out of the tail, two slices, a base swizzle and a source cut short. Synthetic release timing, the three planes: linear 107-113 ms → 1.4-2.0 ms; 64KB_R_X 112-116 ms → 22-33 ms. Retail movie on main 3516080 (RTX 5090, exclusive runs): 7-8 → 34-46 presented frames per 2 s; read + detile 1.75 s → ~0.33 s per 2 s. What remains is the staging upload (~1.3 s per 2 s, ~1.1 GB: each plane is uploaded about three times per presented frame). AI-assisted.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kept-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