Shaders: skip f32 flushes in packed f16 min and max #3739
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3739"
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-28T13:36:15Z.
Use the existing min/max helper for values already free of f32 subnormals in
v_pk_min_f16andv_pk_max_f16. Both halves widen their f16 inputs before the comparison. Even the smallest f16 subnormal is normal in f32, so the f32 subnormal checks are redundant. f16-to-f32 conversion.For one packed min or max in a generated compute shader, DXIL went from 178 to 154 instructions and from 3,268 to 3,144 bytes. With per-half negation, it went from 180 to 156 instructions and from 3,288 to 3,168 bytes.
Microsoft WARP 1.0.22 with Agility 1.620.2 produced the same 524,288 output words on both revisions. The generated inputs cover every half bit pattern, both result halves, cross-selected source halves, per-half negation and clamp. The existing f16 model and packed input selector tests passed. Strict all-feature shader Clippy and the asset policy passed.
#3738 applies the same reasoning in the separate unpacked lowering. This change covers packed min/max. 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-28T13:40:12Z.
Windows CI passed on
6e47acf, including the workspace tests and both Clippy configurations. The integration with #2825 also verified that the widened f16 path gives identical WARP results and that the native modules are byte-identical. 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.
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.