Repository navigation
Shaders: lower unclamped 24-bit multiply-add through DXIL MAD - #3731
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. |
|
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
AI-assisted (Hy4 flash). |
|
Hardware run: RX 5700 XT (Navi 10, RDNA1, 32–64 lanes, driver 32.0.21045.29003, Windows 11 26200), head
AI use: Claude Code (Claude Opus 5.5). |
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 DXIL
IMadandUMadfor the unclampedv_mad_i32_i24andv_mad_u32_u24forms. The two multiplicands still read their low 24 bits with the original signed or unsigned extension, and the entire 32-bit addend contributes to the wrapping result.DXC disassembly of generated compute shaders showed:
The operation takes one fewer DXIL instruction per MAD. The intrinsic declaration adds bytes in these modules. These are emitted instruction and file sizes. GPU execution time and game performance were unmeasured.
On Microsoft WARP 1.0.22 with Agility 1.620.2, the new reference test matched all 726 inputs for each opcode on both main and this change. The full semantics group passed 35 tests with one existing ignored test, including the existing 5,780-input probes per MAD opcode. Strict all-feature shader Clippy and the asset policy passed.
The unsigned operand mask in #3632 and saturating clamped forms in #2926 cover different parts of these operations.
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.