Repository navigation
Conversation
Preserve NaN classification and representable payload bits when expanding an R16_FLOAT corner on the CPU. Use the same ties-to-even rounding in the normal and subnormal conversion paths.
|
Duplicate of #315? |
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.
Fixes #245.
The CPU rectangle fallback converts the generated fourth vertex's half-float attributes back to binary16. Round halfway values to the nearest even mantissa in both the normal and subnormal paths. Keep NaNs quiet and preserve their sign and the payload bits that fit in binary16.
Verification
R16_FLOATrectangle tests reproduced both reports on2119b0e. The midpoint above 1.0 rounded upward, and a quiet NaN became infinity. All six standaloneprimitive.rstests passed with the patch._Float16checked 353,946 binary32 inputs, including signed finite binary16 values, adjacent midpoints and their neighbors, and generated binary32 bit patterns. Numeric conversions matched. NaNs passed the separate quiet/sign checks.rustfmt --checkandgit diff --checkpassed.This verifies the CPU fallback. No native D3D12 or application run was performed.