skia2/tests/sksl/folding/IntFoldingES2.glsl
John Stiles c332739531 Remove 0/x arithmetic simplification.
If x is a known compile-time constant value, it can already be optimized
to a final value.
If x is not known, it could be zero, and 0/0 should result in a NaN.

Change-Id: I643a7c6da0a43ec366235c4df39fc78d3b361de7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441580
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-24 19:18:41 +00:00

73 lines
1.8 KiB
GLSL

out vec4 sk_FragColor;
uniform vec4 colorRed;
uniform vec4 colorGreen;
uniform float unknownInput;
vec4 main() {
int _0_unknown = int(unknownInput);
bool _1_ok = true;
int _2_x = 34;
_1_ok = _1_ok && _2_x == 34;
_2_x = 30;
_1_ok = _1_ok && _2_x == 30;
_2_x = 64;
_1_ok = _1_ok && _2_x == 64;
_2_x = 16;
_1_ok = _1_ok && _2_x == 16;
_2_x = 1;
_1_ok = _1_ok && _2_x == 1;
_2_x = -2;
_1_ok = _1_ok && _2_x == -2;
_2_x = 3;
_1_ok = _1_ok && _2_x == 3;
_2_x = -4;
_1_ok = _1_ok && _2_x == -4;
_2_x = 5;
_1_ok = _1_ok && _2_x == 5;
_2_x = -6;
_1_ok = _1_ok && _2_x == -6;
_2_x = 7;
_1_ok = _1_ok && _2_x == 7;
_2_x = -8;
_1_ok = _1_ok && _2_x == -8;
_2_x = 9;
_1_ok = _1_ok && _2_x == 9;
_2_x = -10;
_1_ok = _1_ok && _2_x == -10;
_2_x = 11;
_1_ok = _1_ok && _2_x == 11;
_2_x = -12;
_1_ok = _1_ok && _2_x == -12;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = 0;
_1_ok = _1_ok && _2_x == 0;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = 0;
_1_ok = _1_ok && _2_x == 0;
_2_x = _0_unknown;
_1_ok = _1_ok && _2_x == _0_unknown;
_2_x = 0 / _0_unknown;
_1_ok = _1_ok && _2_x == 0;
_2_x += 1;
_1_ok = _1_ok && _2_x == 1;
_1_ok = _1_ok && _2_x == 1;
_2_x -= 2;
_1_ok = _1_ok && _2_x == -1;
_1_ok = _1_ok && _2_x == -1;
_1_ok = _1_ok && _2_x == -1;
_2_x *= 2;
_1_ok = _1_ok && _2_x == -2;
_1_ok = _1_ok && _2_x == -2;
_2_x /= 2;
_1_ok = _1_ok && _2_x == -1;
return _1_ok ? colorGreen : colorRed;
}