GPU: use one warm-up key for reordered graphics shader stages #2984
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2986"
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-26T02:19:18Z.
The graphics pre-build writes the vertex or mesh shader before the pixel shader. A guest stream can describe the same pipeline with those two subobjects reversed. The host already uses the same stage order to build the pipeline, but the warm-up key came from the stream order. This can miss the prebuilt entry and split usage across two early keys.
Normalize the two supported graphics stages when reading the stream. Pre-build and guest creation then name that pipeline the same way.
On main
63bcca43c6a00a758510398fa43096ce7e4f7df0, the syntheticPrebuild::graphicsand guestCreatePipelineStatetest found a different key for each reversed vertex/pixel and mesh/pixel pair. Both orders agree after this change. A different pixel shader still changes the key. Six paired runs. Full Windows/WARP GPU diagnostics passed (247 passed, 1 ignored), along with strict GPU Clippy in both feature configurations and asset policy.AI-assisted.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:22:53Z.
Review: COMMENTED
Verified: canonicalizing [pixel, vertex|mesh] to producer-first order at read_stream makes the runtime key equal the prebuild key regardless of subobject order in the stream — the swap is a no-op for forward order and other stage mixes. The test is the right shape: same pipeline through runtime create in both orders plus a control pixel proving keys still differ when content does.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:27:59Z.
Review: COMMENTED
Verified: the swap normalizes [pixel, vertex|mesh] streams inside read_stream, so runtime creation and the pre-build produce the same key regardless of subobject order. The test covers both orderings for vertex and mesh, asserts reversed==canonical, and keeps distinct stages/distinct pixel code keyed apart.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:58:39Z.
Review: APPROVED
Code review on
7ce9941a(static source inspection):crates/victory-gpu/src/pipeline.rs:564-572canonicalizes reversed vertex–pixel and mesh–pixel stage pairs in the parser shared by runtime pipeline creation and prebuild (:512,:641).pipeline/make.rs:111-118), and host pipeline construction selects shaders by stage (pipeline/host.rs:401-428), preserving behavior without introducing shared-state mutation.pipeline/library.rs:473-480).Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T02:45:29Z.
Verified across process restarts with a real D3D12 pipeline library on an RTX 5080 and Microsoft WARP, with #2952 (
2cdb5e3) present in both builds. I prebuilt canonical VS+PS and MS+PS streams, exercised them once through guest creation / first use, saved the cache, then reopened it in a fresh process. The table shows the four guest creations per adapter (both stream orders for each stage pair).7ce9941The old reversed streams could already load the canonical host PSO on first use. The change lets those streams also find the guest prebuild and prior-use records at creation. Both adapters showed the same counts.
The color-only PSOs stayed distinct from two D32_FLOAT variants: omitted depth state (enabled by the DSV) and explicitly disabled depth at the same DSV format. For both VS+PS and MS+PS, each new variant compiled once, then its opposite stage order loaded it. That gave four distinct PSO creations and four loads per adapter.
I also carried an old cache whose early list had only reversed-order uses into the updated build. On the first updated run, both streams found their prebuilt entries and loaded their PSOs at first use. On the next process start, both started early too. This was a synthetic stream/cache test using SDK-compiled shaders seeded at the translation boundary, guest
CreatePipelineState, and the production prebuild, worker and library paths.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:37:05Z.
Automated triage for the maintainers.
Needs work. The change in
read_stream(victory-gpu/src/pipeline.rs) swaps a two-shader stream that lists the pixel shader before the vertex or mesh shader, so the guest pipeline's warm-up key matches the pre-build's. The code is small and the test shows the keys now agree. A commenter confirms the effect on a synthetic cache.What is missing is evidence that the title ever produces such a stream. All the tests here are synthetic; if the title always writes the producer stage first, this changes nothing at run time. Please add a log line or count from a real run showing pixel-first streams (stage order and count only, no game data). If they do occur, consider normalizing by stage rank instead of special-casing a two-element
[pixel, vertex|mesh]slice, so amplification + mesh + pixel streams are covered too.CI: passing.
Generated by Claude Code
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.