skia2/tests/sksl/folding/SwitchCaseFolding.glsl
John Stiles 866db186fa Simplify control flow in switch test to unbreak iOS.
This looks like the GLSL driver in iOS generates wrong results when
returning a value from inside a switch.

Change-Id: I478a045c64c3dae9824f86f52e0c7f8f9685c9af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494476
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-13 14:49:06 +00:00

26 lines
450 B
GLSL

out vec4 sk_FragColor;
uniform vec4 colorRed;
uniform vec4 colorGreen;
vec4 main() {
vec4 color = colorRed;
switch (int(colorGreen.y)) {
case 0:
break;
case 1:
color = colorGreen;
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
break;
}
return color;
}