Shaders: specialize common constant float class masks #3743
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3743"
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-28T14:04:12Z.
When the low ten bits of a float class mask are known, common masks can use a direct predicate. The zero and full masks become constants. NaN, signed zero, finite, infinity, nonfinite and non-NaN masks each use one comparison on the sign-cleared bits. Other masks continue through the general classifier. Both CMP and CMPX use the same lane-mask writer. AMD RDNA 2 instruction reference.
The WARP and Agility comparison matched all 1,327,788 output words between builds and against a separate exponent-and-fraction model. The fixture covered all half bit patterns, generated f32 cases, VOP3 literals including unused upper bits, and CMPX with the original inactive-lane result retained. The committed immediate-mask regression also passed, along with strict all-feature shader Clippy and the asset policy.
#3742 improves the general classifier. This PR addresses the masks known during emission. Counts describe generated DXIL. Game performance was unmeasured.
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-28T14:08:08Z.
Windows CI passed on
5397722, including the workspace tests and both Clippy configurations. The integration with #1327 retained the raw source-modifier handling and matched all 2,655,576 generated WARP results. Combined result.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-28T14:21:43Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
5397722685330fa66d142a4d7c1f3c0259931d80, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-shader --lib -- emit::semantics_tests::immediate_class_masks_match_raw_f32_classification --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, +56/-0).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.