GPU: keep a compositor for each output format #3695

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3695 into main
andrewpozdnakov7-jpg commented 2026-11-28 08:32:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:32:51Z.


PresentX keeps a compositor for each output format it successfully creates. Returning to an earlier format can reuse its pipeline states and descriptor heaps. There is at most one compositor for each of the four formats that the swap chain accepts.

I alternated RGBA8 and BGRA8 across six generated layered frames on signed app-local WARP 1.0.22 and Agility 1.620.2. Both revisions read back the expected dimensions and blend pixel in every frame. The compositor creation callback ran six times on main and twice with this change. D3DCompile calls fell from twelve to four.

The committed regression starts with a compositor failure and recovery, presents BGRA8, then returns to RGBA8. Main calls the creation callback again at the last step and fails the regression. The patched test reads the earlier RGBA8 blend without creating another compositor. It passed with the D3D12 debug switch off and on. Strict GPU Clippy and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5538341714 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3695). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:32:51Z. --- PresentX keeps a compositor for each output format it successfully creates. Returning to an earlier format can reuse its pipeline states and descriptor heaps. There is at most one compositor for each of the four formats that the swap chain accepts. I alternated RGBA8 and BGRA8 across six generated layered frames on signed app-local WARP 1.0.22 and Agility 1.620.2. Both revisions read back the expected dimensions and blend pixel in every frame. The compositor creation callback ran six times on main and twice with this change. D3DCompile calls fell from twelve to four. The committed regression starts with a compositor failure and recovery, presents BGRA8, then returns to RGBA8. Main calls the creation callback again at the last step and fails the regression. The patched test reads the earlier RGBA8 blend without creating another compositor. It passed with the D3D12 debug switch off and on. Strict GPU Clippy and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 08:36:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:36:13Z.


Windows CI passed on 231040f, including both Clippy configurations and the workspace tests. Six alternating RGBA8/BGRA8 frames on WARP used two compositors instead of six, with matching output in every frame. The committed regression checks that the previously prepared RGBA8 compositor is reused after switching back.

The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236689554 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3695#issuecomment-7236689554). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:36:13Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46126333538/job/140921636819) passed on `231040f`, including both Clippy configurations and the workspace tests. Six alternating RGBA8/BGRA8 frames on WARP used two compositors instead of six, with matching output in every frame. The committed regression checks that the previously prepared RGBA8 compositor is reused after switching back. The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
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/3695:upstream-pr/3695'
git switch 'upstream-pr/3695'

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