-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add data packing builtin functions #1189
Conversation
Partly addresses #988 |
HTML preview is at https://gistpreview.github.io/?55aec7912b75ea316e79597eef8a5053 |
@@ -3267,6 +3272,9 @@ This kind of collision occurs for pairs of adjacent integers with a magnitude of | |||
|
|||
Issue: (dneto) Default rounding mode is an implementation choice. Is that what we want? | |||
|
|||
Issue: Check behaviour of the f32 to f16 conversion for numbers just beyond the max normal f16 values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I just saw SwiftShader convert a finite f32 value larger than the largest f16 finite value into a f16 NaN. That's not permitted in the Vulkan spec, but let me verify my findings first.
* Add placeholder for unpacking builtin functions * Expand the description of floating point conversions now that we have to handle edge cases for f32 -> f16. I put in the behaviour of an NVIDIA GPU for the concerning edge case, but added an Issue to review this for portability.
Make this consistent with the proposed channel format names
Rebased and addressed @dj2's comment. The main issue is the addition of general language about converting on floating point type value to another floating point type value. The interesting case if f32 to f16 as it introduces cases where finite source numbers should map to either infinite f16 or max normal f16 values. It's not clear what the dividing line is. I've added an "Issue" to verify behaviour and revisit in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an investigation somewhere showing how these map to shading languages?
Discussed at 2020-11-03 meeting. |
Resolved: Accept PR (although @kvark mentioned a small error) |
UGH. I made a mistake claiming these were already present 1-1 in all the backends. I had checked Metal but skimped on HLSL. (!)
I'll add details here. |
|
I filed #1201 to track the edge case behaviour of conversion from f32 to f16 |
Discussed at the 2020-11-10 meeting. Resolved: Accept with @dneto0 's changes. |
The "changes" are really implementor's notes. The behaviour is already fully specified in the WGSL spect text in the PR. |
The current interpolation tests will not attempt to validate an interpolation with just the type (e.g. `@interpolate(flat)`). This is due to the `,` always being appended so `@interpolate(flat, )` is generated which is not a valid value. This PR updates the generation to only add the `,` if there is a sampling value to be appended. Issue: gpuweb#1135
we have to handle edge cases for f32 -> f16.
I put in the behaviour of an NVIDIA GPU for the concerning edge
case, but added an Issue to review this for portability.