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

Open
opened 2026-11-25 17:43:24 +00:00 by KOLESNiii · 0 comments
KOLESNiii commented 2026-11-25 17:43:24 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-25T17:43:24Z.


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).

<!-- greyfinch-sync:ivall/xcl:issue:6610267267 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2396). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-25T17:43:24Z. --- 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).*
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2386
No description provided.