skia2/tests/sksl/folding/VectorVectorFolding.glsl
John Stiles bfc9be0f77 Migrate SkSL test inputs to the resources/ directory.
This will allow us to load these inputs for unit testing in `dm`.

Change-Id: Id256ba7c30d3ec94b98048e47af44cf9efe580d5
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357282
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 18:57:29 +00:00

97 lines
2.1 KiB
GLSL

bool test_int() {
int unknown = int(sqrt(1.0));
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 = sqrt(1.0);
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() ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
}