skia2/resources/sksl/errors/InlineDivideByZero.sksl
Ethan Nicholas c0f9815609 Added detection for non-constant-folded divide by zero errors in
SkSL.

It would previously catch 1 / 0, but fail to detect x / 0.

Bug: skia:11051
Change-Id: I3adb5942cce03a7ad40a13a8ca5d5a7f2029d6ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366720
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
2021-02-06 03:13:16 +00:00

10 lines
202 B
Plaintext

uniform float unknownInput;
int getZero() { return 0; }
void main() {
int inlineTest = 0 / getZero();
inlineTest = (int4(0) / getZero()).x;
inlineTest = int(unknownInput.x) / getZero();
}