skia2/tests/sksl/folding/VectorVectorFolding.glsl

101 lines
2.2 KiB
Plaintext
Raw Normal View History

out vec4 sk_FragColor;
uniform float unknownInput;
uniform vec4 colorRed;
uniform vec4 colorGreen;
bool test_int() {
int unknown = int(unknownInput);
bool ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = true;
ok = ivec4(unknown) == ivec4(unknown);
ok = ok && ivec4(unknown) == ivec4(unknown);
ok = ok;
ok = ok;
ok = ok;
ok = ok && ivec4(unknown) == ivec4(unknown);
ok = ok && ivec4(unknown) == ivec4(unknown);
ok = ok && ivec4(unknown) == ivec4(unknown);
ivec4 val = ivec4(unknown);
val += ivec4(1);
val -= ivec4(1);
ok = ok && val == ivec4(unknown);
val *= ivec4(2);
val /= ivec4(2);
ok = ok && val == ivec4(unknown);
return ok;
}
vec4 main() {
float _1_unknown = unknownInput;
bool _2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = true;
_2_ok = vec4(_1_unknown) == vec4(_1_unknown);
_2_ok = _2_ok && vec4(_1_unknown) == vec4(_1_unknown);
_2_ok = _2_ok;
_2_ok = _2_ok;
_2_ok = _2_ok;
_2_ok = _2_ok && vec4(_1_unknown) == vec4(_1_unknown);
_2_ok = _2_ok && vec4(_1_unknown) == vec4(_1_unknown);
_2_ok = _2_ok && vec4(_1_unknown) == vec4(_1_unknown);
vec4 _3_val = vec4(_1_unknown);
_3_val += vec4(1.0);
_3_val -= vec4(1.0);
_2_ok = _2_ok && _3_val == vec4(_1_unknown);
_3_val *= vec4(2.0);
_3_val /= vec4(2.0);
_2_ok = _2_ok && _3_val == vec4(_1_unknown);
return _2_ok && test_int() ? colorGreen : colorRed;
}