Repository navigation
Shaders: skip f32 flushes in packed f16 min and max - #3739
Open
andrewpozdnakov7-jpg wants to merge 1 commit into
Open
andrewpozdnakov7-jpg wants to merge 1 commit into
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
Contributor
Author
|
Windows CI passed on The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add AI-assisted with OpenAI Codex. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 <andrewpozdnakov7-jpg@users.noreply.github.com>if folding the change into another commit.AI-assisted with OpenAI Codex.