GPU: copy sparse texture updates as synchronous bands #1174

Open
github-bot wants to merge 3 commits from github-bot/gh-1174 into main AGit
Owner

@⁠nicolasveilleux on GitHub · 2026-11-25 22:42 UTC · original
nicolasveilleux:review/fxceless-synchronous-texture-bands → main · +558 −121 · 3 files · 3 commits · draft

Summary

Copy only the affected rows into the GPU texture after a sparse write to a fully mapped, write-watched 2D texture. The optional D3D12 source box is aligned to console tile rows and compression blocks. CPU detiling and staging allocation are unchanged.

Stacked on #80. The first commit is the existing submission-time upload work from #80, with its original authorship. Our change is isolated in c97170f. This is a draft so the two changes can be reviewed separately; please do not merge this stack ahead of #80. This changes GPU transfers, not the CPU detiling work in #92 or #1130.

Opt in with VICTORY_TEXTURE_UPLOAD_BANDS=1. First uploads, dense writes, unsupported or untracked textures, on-demand levels, multiple lists, and asynchronous submissions use the existing full-copy path. No asynchronous overlap or gameplay FPS claims.

Validation

  • On Windows 11 / RTX 2070 Super, the integrated test compares the full GPU readback against a full detile for linear RGBA8, tiled RGBA8, and tiled BC3. It checks the first, sparse, dense and two-list cases.
  • A separate synthetic transfer-only benchmark on the same card, not the integrated path or a frame-time measurement, measured 6.77 ms vs 0.61 ms median through completion for a 64-row update to a 4096×4096 RGBA8 texture (64 MiB vs 1 MiB of upload footprint, 24 paired samples). Dense copies did not benefit.
  • Code and generated inputs only; no game files used.

Separate implementation in the original VIctory repository: https://github.com/Marvisak/VIctory/pull/2358.

**@⁠nicolasveilleux** on GitHub · 2026-11-25 22:42 UTC · [original](https://github.com/fxceless/victory-fork/pull/1174) `nicolasveilleux:review/fxceless-synchronous-texture-bands` → `main` · +558 −121 · 3 files · 3 commits · draft ## Summary Copy only the affected rows into the GPU texture after a sparse write to a fully mapped, write-watched 2D texture. The optional D3D12 source box is aligned to console tile rows and compression blocks. CPU detiling and staging allocation are unchanged. **Stacked on #80.** The first commit is the existing submission-time upload work from #80, with its original authorship. Our change is isolated in [c97170f](https://github.com/nicolasveilleux/victory-fork/commit/c97170fa0076c07fa3150bf468ef5f68dfa5663c). This is a draft so the two changes can be reviewed separately; please do not merge this stack ahead of #80. This changes GPU transfers, not the CPU detiling work in #92 or #1130. Opt in with `VICTORY_TEXTURE_UPLOAD_BANDS=1`. First uploads, dense writes, unsupported or untracked textures, on-demand levels, multiple lists, and asynchronous submissions use the existing full-copy path. No asynchronous overlap or gameplay FPS claims. ## Validation - On Windows 11 / RTX 2070 Super, the integrated test compares the full GPU readback against a full detile for linear RGBA8, tiled RGBA8, and tiled BC3. It checks the first, sparse, dense and two-list cases. - A separate synthetic transfer-only benchmark on the same card, not the integrated path or a frame-time measurement, measured 6.77 ms vs 0.61 ms median through completion for a 64-row update to a 4096×4096 RGBA8 texture (64 MiB vs 1 MiB of upload footprint, 24 paired samples). Dense copies did not benefit. - Code and generated inputs only; no game files used. Separate implementation in the original VIctory repository: https://github.com/Marvisak/VIctory/pull/2358.
texture::upload previously checked Staging::dirty at command-list recording time, before Staging::refresh ran at submission. Once a title-written texture became clean (after an unchanged submission, or after a multi-list submission where Batch::texture_due skipped the second refresh while the second defer_host cleared dirty), the next CPU update skipped CopyTextureRegion and sampled stale host texels until a subsequent use; conversely, a changed texture left dirty=true after submission and forced a redundant GPU copy on the next unchanged submission.

Move CopyTextureRegion into HostList::prelude() right after run_deferred() refreshes staging buffers, so unchanged textures skip GPU copies and changed ones upload on the same submission. Add two D3D12 regression tests covering both cases.
Keep first, dense, unmapped, on-demand, multi-list and asynchronous submissions on the existing full-copy path. Verify the full GPU readback of linear RGBA8, tiled RGBA8 and tiled BC3 on RTX 2070 Super and WARP using generated inputs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:54 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1174/head:github-bot/gh-1174'
git switch 'github-bot/gh-1174'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1174'
git switch 'github-bot/gh-1174'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1174'
git switch 'github-bot/gh-1174'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1174'
git switch 'main'
git merge --squash 'github-bot/gh-1174'
git switch 'main'
git merge --ff-only 'github-bot/gh-1174'
git switch 'main'
git merge 'github-bot/gh-1174'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.