Remove isInf, isNan#2311
Conversation
| </thead> | ||
| <tr algorithm="isNan"> | ||
| <td rowspan=4> | ||
| <tr algorithm="isFinite"> |
There was a problem hiding this comment.
Shouldn't we remove isFinite too?
There was a problem hiding this comment.
Discussed in #2309.
We have agreement on isNan and isFinite. I'd rather land this and then do a second MR for isFinite.
Wgsl removes inNaN from spec (gpuweb/gpuweb#2311) This CL implement isnan based on the rules in IEEE 754-1985
Wgsl removes inNaN from spec (gpuweb/gpuweb#2311) and VertexFormatTest needs to cover NaN input. So we implement a platform-independent isNaNCustom based on the rules in IEEE 754-1985. Bug: dawn:1268 Change-Id: I53aef428c72d34381efc6b3ba0250685fc685965 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78140 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Wgsl removes inNaN from spec (gpuweb/gpuweb#2311) This CL implement isnan based on the rules in IEEE 754-1985
These were removed with gpuweb/gpuweb#2311
These were removed with gpuweb/gpuweb#2311
|
In one of our shaders (in pygfx) there can be nans in the input data (storage buffer). We need to detect these nans and make the shader behave differently if a nan is found. Right now this works (code here): let is_nan = min(w, 1.0) == 1.0 && max(w, -1.0) == -1.0We have three questions related to this:
PS: our use-case is rendering lines, and allowing users to insert gaps by using nans, which is a common trick in dataviz. |
WGSL currently makes no guarantees that non-finite
It's not just fastmath. For backends that do not explicitly state they support non-finites, you can get undefined values, and we've also seen cases where the backend shader compilers have done some very inexplicable things with flow control. We will likely offer a future extension to support non-finites and expose it for devices that have been tested and shown to work correctly.
I can't answer that, I'm afraid. |
|
Thanks for the answers @ben-clayton! |
Fixes: #2270