Status: Accepted
Owner:
johns...@google.comArea: SkSL
Priority: Medium
Type: Defect
New issue 14385 by
johns...@google.com: SkSL: WGSL requires that constant-eval expressions do not have overflow/NaN
https://bugs.chromium.org/p/skia/issues/detail?id=14385https://www.w3.org/TR/WGSL/#abstract-typesAn evaluation of an expression in one of these types must not overflow or produce infinite, NaN, undefined, or indeterminate results.
https://www.w3.org/TR/WGSL/#floating-point-evaluationIt is a shader-creation error if any const-expression of floating-point type evaluates to NaN or infinity.
--
Currently SkSL's strategy for constant-evaluation of overflows/NaNs is to stop constant-evaluation and leave the input code as-is, passing it along to the GPU.
For other backends, this isn't a problem, and leaves the determination of the final result up to the backend in question.
For WGSL, the compiler rejects the code at compilation time. Therefore, we will need a new strategy.
Using `let` forces us out of compile-time evaluation, and can be used to dodge the error. e.g.:
`return inverseSqrt(-1);` --> error
`let x = -1; return inverseSqrt(x);` --> returns mystery value
--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings