GPU: fills of upload memory wait for flights by default (the café's blurred oval, #1025) #1202

Open
tippythetaidum wants to merge 1 commit from upstream-pr/1205 into main
tippythetaidum commented 2026-11-26 00:01:13 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by tippythetaidum on 2026-11-26T00:01:13Z.


Fixes the blurred oval of #1025.

What

Fills of upload memory and read-only buffer copies that read title memory a flight may write now wait for that flight again by default. VICTORY_FILL_WAIT=0 turns reading ahead back on. Until now, reading ahead was the default and VICTORY_FILL_WAIT=1 turned it off.

The whole change is the default in fill_ahead::on, a small parser for the switch with a unit test, and the doc comment, log line and README entry that name the switch.

Why

Reading ahead is built to let the first stale fill through and only then wait. That one submission is visible:

  • Where: in the opening café flashback, every run reads a fixed 2 KiB block ahead of the flight that changes it, as the scene begins. Shaders write the block and later draws read it as constants. The address was 0xdc07ea300 in six runs and the next 2 KiB in a seventh, and each run logs the "a fill of upload memory read 2048 bytes ... ahead of a flight whose shaders changed them" warning.
  • What it does: a blurred oval then stays over the middle of the picture until the next scene. That's d0dev's report in #1025 and ours.
RTX 5080, release builds, same save Oval
default (reading ahead), 7 runs 6
VICTORY_FILL_WAIT=1, 2 runs, same exe as the last oval run 0
VICTORY_FILL_WAIT=1, 1 run, mesh f5e50eb2108c425b drawn again 0

On the console the card reads those bytes only after the work before them, so waiting is its behaviour.

What it costs: about one frame per second here (a median of 4.7 against 5.7 fps). The two medians come from different stretches of the runs, so it's a rough figure. Anyone who prefers speed can set VICTORY_FILL_WAIT=0.

Tested

  • cargo test -p victory-gpu --lib fill_ahead: the new fills_wait_unless_the_switch_is_zero passes.
  • cargo clippy -p victory-gpu --all-targets: nothing new. The ten warnings it shows are the ones main already has (placed_filler_twins, depth_written, is_multiple_of and others).
  • The in-game runs above used VICTORY_FILL_WAIT=1 on a build of main d827419 plus open pull requests. This branch is on today's main dc4c0fc and changes only the default, so with the switch unset it behaves as those =1 runs did.

#860 holds back only the 64 KiB pieces a miss touched, and its hold starts after the miss, so the first one would still get through. With fills waiting by default, #860's narrower holds matter only with VICTORY_FILL_WAIT=0.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616319675 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1205). Originally posted by [tippythetaidum](https://github.com/tippythetaidum) on 2026-11-26T00:01:13Z. --- Fixes the blurred oval of #1025. ## What Fills of upload memory and read-only buffer copies that read title memory a flight may write now wait for that flight again by default. `VICTORY_FILL_WAIT=0` turns reading ahead back on. Until now, reading ahead was the default and `VICTORY_FILL_WAIT=1` turned it off. The whole change is the default in `fill_ahead::on`, a small parser for the switch with a unit test, and the doc comment, log line and README entry that name the switch. ## Why Reading ahead is built to let the first stale fill through and only then wait. That one submission is visible: - **Where:** in the opening café flashback, every run reads a fixed 2 KiB block ahead of the flight that changes it, as the scene begins. Shaders write the block and later draws read it as constants. The address was `0xdc07ea300` in six runs and the next 2 KiB in a seventh, and each run logs the "a fill of upload memory read 2048 bytes ... ahead of a flight whose shaders changed them" warning. - **What it does:** a blurred oval then stays over the middle of the picture until the next scene. That's d0dev's report in #1025 and ours. | RTX 5080, release builds, same save | Oval | |---|---| | default (reading ahead), 7 runs | 6 | | `VICTORY_FILL_WAIT=1`, 2 runs, same exe as the last oval run | 0 | | `VICTORY_FILL_WAIT=1`, 1 run, mesh `f5e50eb2108c425b` drawn again | 0 | On the console the card reads those bytes only after the work before them, so waiting is its behaviour. **What it costs:** about one frame per second here (a median of 4.7 against 5.7 fps). The two medians come from different stretches of the runs, so it's a rough figure. Anyone who prefers speed can set `VICTORY_FILL_WAIT=0`. ## Tested - `cargo test -p victory-gpu --lib fill_ahead`: the new `fills_wait_unless_the_switch_is_zero` passes. - `cargo clippy -p victory-gpu --all-targets`: nothing new. The ten warnings it shows are the ones `main` already has (`placed_filler_twins`, `depth_written`, `is_multiple_of` and others). - The in-game runs above used `VICTORY_FILL_WAIT=1` on a build of `main` `d827419` plus open pull requests. This branch is on today's `main` `dc4c0fc` and changes only the default, so with the switch unset it behaves as those `=1` runs did. ## Related #860 holds back only the 64 KiB pieces a miss touched, and its hold starts after the miss, so the first one would still get through. With fills waiting by default, #860's narrower holds matter only with `VICTORY_FILL_WAIT=0`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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/1205:upstream-pr/1205'
git switch 'upstream-pr/1205'

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