GPU: reuse compiled shaders for the PresentX compositor #3693
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3693"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:05:23Z.
PresentX rebuilds the compositor when the swap-chain format changes. Its fixed fullscreen vertex and pixel programs use the same bytecode for each format. Keep the first successfully compiled pair in memory and use it to create the format-specific pipeline states. A failed compile still returns its error and can be retried.
On signed app-local WARP 1.0.22 and Agility 1.620.2, six layered frames alternated between RGBA8 and BGRA8. Both revisions created six compositors and read the expected blend pixel and dimensions on every frame. The number of D3DCompile calls fell from 12 to 2. In 11 alternating measurement pairs, the median time for 48 compositor creations after warmup fell from 283.90 ms to 45.46 ms. That measurement includes pipeline and descriptor creation and excludes presentation.
The compositor bytecode reuse, pipeline creation, primary-plane fallback and swap-chain retry tests passed, as did strict GPU Clippy and the asset policy.
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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:08:34Z.
Windows CI passed at
47b34fa, including Clippy in both configurations and the workspace tests. The six-frame WARP comparison used the expected blended pixel on RGBA8 and BGRA8 in every frame. The compiled programs were built twice in total instead of twelve times.The next step is maintainer review. The measured improvement is in compositor construction during format changes.
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding this change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:36:50Z.
I combined this PR with #3695 in 291544e. The compositor retains format-specific pipeline states and descriptor heaps, and the vertex and pixel bytecode is shared by all of them.
I drew eight generated frames on signed app-local WARP, visiting RGBA8, BGRA8, R10G10B10A2 and RGBA16F twice each. Every pixel matched the expected output. The test counted four compositor creations and still held four at the end. The two shader stages compiled once each. The same result held with the D3D12 debug switch off and on, and the fallback-and-reuse regression, focused compositor tests, strict GPU Clippy and asset policy passed.
A maintainer can use the combined branch if both changes land together. Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the changes into another commit.AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.