skia2/tests/sksl/folding/IntFoldingES2.glsl
John Stiles b41d5bb3a7 Add helper uniforms to Runtime Effect tests.
This lets us use descriptive names like `colorRed` and `colorGreen`
instead of `half4(1,0,0,1)` and `half4(0,1,0,1)`. It also lets us use
actual unknown values instead of synthesizing sorta-kinda-unknowns by
calling sqrt.

Change-Id: I61481c33b7ff42182955777b05cfa5fcc13e0efc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359567
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-27 00:53:46 +00:00

73 lines
1.5 KiB
GLSL

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