2020-09-14 21:30:13 +00:00
|
|
|
|
2021-01-27 00:58:22 +00:00
|
|
|
out vec4 sk_FragColor;
|
2021-01-26 21:28:12 +00:00
|
|
|
uniform float unknownInput;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
uniform vec4 colorGreen;
|
2021-01-22 14:51:13 +00:00
|
|
|
bool test_int() {
|
2021-01-26 21:28:12 +00:00
|
|
|
int unknown = int(unknownInput);
|
2021-01-22 14:51:13 +00:00
|
|
|
bool ok = true;
|
|
|
|
ivec4 val = ivec4(unknown);
|
|
|
|
val += ivec4(1);
|
|
|
|
val -= ivec4(1);
|
2021-02-06 00:12:27 +00:00
|
|
|
val = val + ivec4(1);
|
|
|
|
val = val - ivec4(1);
|
2021-01-22 14:51:13 +00:00
|
|
|
ok = ok && val == ivec4(unknown);
|
|
|
|
val *= ivec4(2);
|
|
|
|
val /= ivec4(2);
|
2021-02-06 00:12:27 +00:00
|
|
|
val = val * ivec4(2);
|
|
|
|
val = val / ivec4(2);
|
2021-01-22 14:51:13 +00:00
|
|
|
ok = ok && val == ivec4(unknown);
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
vec4 main() {
|
2021-02-25 16:17:02 +00:00
|
|
|
float _0_unknown = unknownInput;
|
|
|
|
bool _1_ok = true;
|
|
|
|
vec4 _2_val = vec4(_0_unknown);
|
|
|
|
_2_val += vec4(1.0);
|
|
|
|
_2_val -= vec4(1.0);
|
|
|
|
_2_val = _2_val + vec4(1.0);
|
|
|
|
_2_val = _2_val - vec4(1.0);
|
|
|
|
_1_ok = _1_ok && _2_val == vec4(_0_unknown);
|
|
|
|
_2_val *= vec4(2.0);
|
|
|
|
_2_val /= vec4(2.0);
|
|
|
|
_2_val = _2_val * vec4(2.0);
|
|
|
|
_2_val = _2_val / vec4(2.0);
|
|
|
|
_1_ok = _1_ok && _2_val == vec4(_0_unknown);
|
|
|
|
return _1_ok && test_int() ? colorGreen : colorRed;
|
2020-11-05 16:59:10 +00:00
|
|
|
|
2020-09-14 21:30:13 +00:00
|
|
|
}
|