Skip to content

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 into
fxceless:mainfrom
fffluffy-dev:gpu/precise-staging-fence
Open

fffluffy-dev wants to merge 1 commit into
fxceless:mainfrom
fffluffy-dev:gpu/precise-staging-fence

Conversation

@fffluffy-dev

Copy link
Copy Markdown

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.

…g buffer it copies from

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JustDownTV pushed a commit to JustDownTV/victory-gta6 that referenced this pull request Nov 25, 2026
@Seenko Seenko mentioned this pull request Nov 25, 2026
triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
…g buffer it copies from

Port of PalmVIDev fc83669 (fxceless#272, fffluffy-dev). With
submissions sent ahead (relay, late waits), a submission's prelude copies
a texture's staging buffer into its host texture when the card runs it;
the next submission's refresh could detile new contents into that buffer
first, and the texture took part of the newer contents. A detile now waits
for the last submission sent ahead whose prelude copies out of that
staging buffer (Host::wait_for_staging); the frame line's texture refresh
time says how long such waits took.

Adapted to this tree's upload path (main 737fcb7: the copy is recorded in
HostList::prelude when take_upload says so): the prelude marks the staging
buffer queued, and when the submission is sent ahead its fence is noted
(Staging::upload_sent); a submission that is waited for leaves nothing to
wait for. Nothing changes without send-ahead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017V7WBA8CxPD68KngjiMeJb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant