2020-09-14 21:30:13 +00:00
|
|
|
|
2020-09-15 20:09:11 +00:00
|
|
|
out vec4 sk_FragColor;
|
2021-09-21 14:56:31 +00:00
|
|
|
uniform vec4 colorGreen;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
bool switch_fallthrough_bi(int value) {
|
|
|
|
switch (value) {
|
|
|
|
case 2:
|
|
|
|
return false;
|
|
|
|
case 1:
|
2020-09-14 21:30:13 +00:00
|
|
|
case 0:
|
2021-09-21 14:56:31 +00:00
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool switch_fallthrough_twice_bi(int value) {
|
|
|
|
switch (value) {
|
|
|
|
case 0:
|
|
|
|
return false;
|
2020-09-14 21:30:13 +00:00
|
|
|
case 1:
|
2021-09-21 14:56:31 +00:00
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
2020-09-14 21:30:13 +00:00
|
|
|
}
|
2021-09-21 14:56:31 +00:00
|
|
|
}
|
|
|
|
vec4 main() {
|
|
|
|
int x = int(colorGreen.y);
|
|
|
|
return switch_fallthrough_bi(x) && switch_fallthrough_twice_bi(x) ? colorGreen : colorRed;
|
2020-09-14 21:30:13 +00:00
|
|
|
}
|