GPU: wait for a sent-ahead submission before detiling into the staging buffer it copies from #272

Open
fffluffy-dev wants to merge 1 commit from upstream-pr/272 into main
fffluffy-dev commented 2026-11-24 23:06:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fffluffy-dev on 2026-11-24T23:06:11Z.


With VICTORY_LATE_WAIT/VICTORY_RELAY, a submission still on the card may be copying from a texture's staging buffer when the next preparation detiles new contents into it. A submission is now marked as reading a staging buffer only when it recorded a real CopyTextureRegion from it, and a detile waits for that fence only when contents changed, so unchanged textures never wait (a wait on every texture step, as in #141, would wait at almost every submission). Device removal is checked before and after the wait; the wait time is reported.

Validation (cargo-xwin, x86_64-pc-windows-msvc, tests under Wine): victory-gpu 111 passed, 1 ignored; victory-formats 24-25 passed; cargo clippy --workspace --all-targets -D warnings clean with and without --all-features; cargo xtask policy ok. Not measured on a real frame.

AI use: written with Codex and Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593214311 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/272). Originally posted by [fffluffy-dev](https://github.com/fffluffy-dev) on 2026-11-24T23:06:11Z. --- With `VICTORY_LATE_WAIT`/`VICTORY_RELAY`, a submission still on the card may be copying from a texture's staging buffer when the next preparation detiles new contents into it. A submission is now marked as reading a staging buffer only when it recorded a real `CopyTextureRegion` from it, and a detile waits for that fence only when contents changed, so unchanged textures never wait (a wait on every texture step, as in #141, would wait at almost every submission). Device removal is checked before and after the wait; the wait time is reported. Validation (cargo-xwin, x86_64-pc-windows-msvc, tests under Wine): victory-gpu 111 passed, 1 ignored; victory-formats 24-25 passed; `cargo clippy --workspace --all-targets -D warnings` clean with and without `--all-features`; `cargo xtask policy` ok. Not measured on a real frame. **AI use:** written with Codex and Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.
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/272:upstream-pr/272'
git switch 'upstream-pr/272'

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/272'
git switch 'upstream-pr/272'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/272'
git switch 'upstream-pr/272'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/272'
git switch 'main'
git merge --squash 'upstream-pr/272'
git switch 'main'
git merge --ff-only 'upstream-pr/272'
git switch 'main'
git merge 'upstream-pr/272'
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!272
No description provided.