skia2/tests/sksl/shared/SwizzleConstants.glsl
John Stiles 0ac6c15075 Reduce self-assignment expressions (x = x) into just x.
Change-Id: I44356aa781f208f4941dbeb617a30318e36c1081
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367062
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-10 20:00:05 +00:00

35 lines
998 B
GLSL

out vec4 sk_FragColor;
uniform vec4 testInputs;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec4 main() {
vec4 v = testInputs;
v = vec4(v.x, 1.0, 1.0, 1.0);
v = vec4(v.xy, 1.0, 1.0);
v = vec4(v.x, 1.0, 1.0, 1.0);
v = vec4(0.0, v.y, 1.0, 1.0);
v = vec4(v.xyz, 1.0);
v = vec4(v.xy, 1.0, 1.0);
v = vec4(v.x, 0.0, v.z, 1.0);
v = vec4(v.x, 1.0, 0.0, 1.0);
v = vec4(1.0, v.yz, 1.0);
v = vec4(0.0, v.y, 1.0, 1.0);
v = vec4(1.0, 1.0, v.z, 1.0);
v = vec4(v.xyz, 1.0);
v = vec4(v.xy, 0.0, v.w);
v = vec4(v.xy, 1.0, 0.0);
v = vec4(v.x, 1.0, v.zw);
v = vec4(v.x, 0.0, v.z, 1.0);
v = vec4(v.x, 1.0, 1.0, v.w);
v = vec4(v.x, 1.0, 0.0, 1.0);
v = vec4(1.0, v.yzw);
v = vec4(0.0, v.yz, 1.0);
v = vec4(0.0, v.y, 1.0, v.w);
v = vec4(1.0, v.y, 1.0, 1.0);
v = vec4(0.0, 0.0, v.zw);
v = vec4(0.0, 0.0, v.z, 1.0);
v = vec4(0.0, 1.0, 1.0, v.w);
return v == vec4(0.0, 1.0, 1.0, 1.0) ? colorGreen : colorRed;
}