skia2/tests/sksl/folding/VectorVectorFolding.glsl
John Stiles ece1d794b9 Mangle function names in GLSL.
This will be implemented in Metal and SPIR-V in followup CLs.

Change-Id: I397b4db40b15dd54cf1d8a17f414c3fe184b48d2
Bug: skia:10851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387638
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-22 17:18:26 +00:00

38 lines
990 B
GLSL

out vec4 sk_FragColor;
uniform float unknownInput;
uniform vec4 colorRed;
uniform vec4 colorGreen;
bool test_int_b() {
int unknown = int(unknownInput);
bool ok = true;
ivec4 val = ivec4(unknown);
val += ivec4(1);
val -= ivec4(1);
val = val + ivec4(1);
val = val - ivec4(1);
ok = ok && val == ivec4(unknown);
val *= ivec4(2);
val /= ivec4(2);
val = val * ivec4(2);
val = val / ivec4(2);
ok = ok && val == ivec4(unknown);
return ok;
}
vec4 main() {
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_b() ? colorGreen : colorRed;
}