Shaders: reuse the DXIL emit plan when collecting shader flags #3791
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3791"
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-28T20:45:03Z.
Build the DXIL emission plan once and use it for both instruction-usage flags and bitcode writing. The analysis runs after the instructions and branches are final. The remaining work appends entry metadata and its values.
In four generated branch-heavy modules, 17 paired Windows release measurements put analysis plus writing at 0.798x to 0.826x the previous time. The largest fixture emitted the same 185,872 bytes with 1,036 to 543 allocations and 83 to 62 reallocations.
Nine generated full translations also emitted byte-identical DXIL and passed the signed validator. In five alternating pairs pinned to one CPU, the per-module median elapsed-time ratios were 0.943x to 0.991x. The metadata/plan regression, the bitcode tests, both strict shader Clippy configurations 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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T20:50:15Z.
Windows CI passed on
3e0fbaa, including both Clippy configurations and the workspace tests. The local Windows A/B check emitted 9 byte-identical complete DXIL modules, all accepted by the signed Microsoft DXIL validator. Their median elapsed times were 0.943–0.991× baseline across five alternating pairs. The four branch-heavy bitcode fixtures emitted identical bytes with median times of 0.798–0.826× baseline. In the largest case (185,872 bytes), the fixture counted 1,036 → 543 allocations and 83 → 62 reallocations.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.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T23:09:00Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
3e0fbaa42fa4a6b9ffb12dcf0b9493a81f2cbdd0, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-shader --lib -- emit::bitcode::tests::planned_module_may_append_metadata_before_emission --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 305 filtered, exit 0.git grep -Ffor the test name on the base returned no match (test is new on this PR);git diff --check HEAD^ HEADclean (2 files, +49/-23).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
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.