D3D12.X: a changed title texture uploads only the subresources its written pages touch #2396

Open
opened 2026-11-26 05:29:49 +00:00 by github-bot · 0 comments
Owner

@⁠KOLESNiii on GitHub · 2026-11-25 17:43 UTC · original

Part of #2390. Depends on #2395 (per-page hashes).

When a title texture changed, upload_all detiles and uploads every subresource of it (subresources_of_all, crates/xcl/src/hle/d3d12x/title_textures.rs:1116 on main 3f4495a). The comment just above (:1095-1098) measured the cost: "a retail title's video planes and UI targets went up again for every submit, ~25 MB a presented frame where ~3 MB had changed". #486 fixed the case where nothing changed, but not the case where a little did.

Proposal: from the changed pages (#2395), work out which subresources they overlap. GFX10 keeps small mips first and level 0 last, and slices are slice_bytes apart, so xg::Texture's chain already has the offsets. Detile and copy only those subresources. A single mip level of a large texture could also be cut to the changed rows, but that is a follow-up.

Test: a write into one mip's pages of a mipmapped array texture uploads that subresource only, and a GPU readback of the others is unchanged. This complements #1511 / #1513 (detiling speed): they make each detile cheaper, and this does fewer of them.

Found by code reading with Claude Code (Claude Opus 5.5).

**@⁠KOLESNiii** on GitHub · 2026-11-25 17:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/2396) Part of #2390. Depends on #2395 (per-page hashes). When a title texture changed, `upload_all` detiles and uploads every subresource of it (`subresources_of_all`, `crates/xcl/src/hle/d3d12x/title_textures.rs:1116` on `main` 3f4495a). The comment just above (`:1095-1098`) measured the cost: "a retail title's video planes and UI targets went up again for every submit, ~25 MB a presented frame where ~3 MB had changed". #486 fixed the case where nothing changed, but not the case where a little did. **Proposal:** from the changed pages (#2395), work out which subresources they overlap. GFX10 keeps small mips first and level 0 last, and slices are `slice_bytes` apart, so `xg::Texture`'s `chain` already has the offsets. Detile and copy only those subresources. A single mip level of a large texture could also be cut to the changed rows, but that is a follow-up. **Test:** a write into one mip's pages of a mipmapped array texture uploads that subresource only, and a GPU readback of the others is unchanged. This complements #1511 / #1513 (detiling speed): they make each detile cheaper, and this does fewer of them. *Found by code reading with Claude Code (Claude Opus 5.5).*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:49 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.