Count a loose window once against the GPU memory budget #1247

Open
UwUCammie wants to merge 3 commits from upstream-pr/1250 into main
UwUCammie commented 2026-11-26 02:20:52 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-26T02:20:52Z.


One extra 4 MiB window at a 4 MiB cap counted as two refusals. The upload-heap attempt and the staged-buffer fallback each asked for room, even though both were trying to place the same window.

Reserve the bytes once across the two attempts, return them if neither succeeds, and check the configured cap before asking DXGI for its budget. Once the mapping probe has failed, subsequent windows go directly to the staged path.

Tested on an RX 7900 XT with RADV 26.3.1, Wine and vkd3d-proton. The physical regression failed on the base with two refusals instead of one. It passed on this branch with VICTORY_WINDOW_UPLOAD=0 and =1, including reusing the space after release. The reservation test also passed at the exact cap and on integer overflow.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6618100962 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1250). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-26T02:20:52Z. --- One extra 4 MiB window at a 4 MiB cap counted as two refusals. The upload-heap attempt and the staged-buffer fallback each asked for room, even though both were trying to place the same window. Reserve the bytes once across the two attempts, return them if neither succeeds, and check the configured cap before asking DXGI for its budget. Once the mapping probe has failed, subsequent windows go directly to the staged path. Tested on an RX 7900 XT with RADV 26.3.1, Wine and vkd3d-proton. The physical regression failed on the base with two refusals instead of one. It passed on this branch with `VICTORY_WINDOW_UPLOAD=0` and `=1`, including reusing the space after release. The reservation test also passed at the exact cap and on integer overflow.
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/1250:upstream-pr/1250'
git switch 'upstream-pr/1250'

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