GPU: copy sparse texture updates as synchronous bands #1171

Open
nicolasveilleux wants to merge 3 commits from upstream-pr/1174 into main
nicolasveilleux commented 2026-11-25 22:42:15 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by nicolasveilleux on 2026-11-25T22:42:15Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6615246482 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1174). Originally posted by [nicolasveilleux](https://github.com/nicolasveilleux) on 2026-11-25T22:42:15Z. --- ## 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1174:upstream-pr/1174'
git switch 'upstream-pr/1174'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1174'
git switch 'upstream-pr/1174'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1174'
git switch 'upstream-pr/1174'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1174'
git switch 'main'
git merge --squash 'upstream-pr/1174'
git switch 'main'
git merge --ff-only 'upstream-pr/1174'
git switch 'main'
git merge 'upstream-pr/1174'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
fxceless/victory-fork!1171
No description provided.