2021-09-21 14:56:31 +00:00
|
|
|
uniform half4 colorGreen, colorRed;
|
2021-05-24 14:52:23 +00:00
|
|
|
|
2021-09-21 14:56:31 +00:00
|
|
|
bool switch_fallthrough(int value) {
|
2021-09-21 18:30:14 +00:00
|
|
|
bool ok = false;
|
2021-09-21 14:56:31 +00:00
|
|
|
switch (value) {
|
2021-09-21 18:30:14 +00:00
|
|
|
case 2: break;
|
2020-09-14 21:30:13 +00:00
|
|
|
case 1:
|
2021-09-21 18:30:14 +00:00
|
|
|
case 0: ok = true; break;
|
|
|
|
default: break;
|
2020-09-14 21:30:13 +00:00
|
|
|
}
|
2021-09-21 18:30:14 +00:00
|
|
|
return ok;
|
2021-09-21 14:56:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool switch_fallthrough_twice(int value) {
|
2021-09-21 18:30:14 +00:00
|
|
|
bool ok = false;
|
2021-09-21 14:56:31 +00:00
|
|
|
switch (value) {
|
2021-09-21 18:30:14 +00:00
|
|
|
case 0: break;
|
2021-09-21 14:56:31 +00:00
|
|
|
case 1:
|
|
|
|
case 2:
|
2021-09-21 18:30:14 +00:00
|
|
|
case 3: ok = true; break;
|
|
|
|
default: break;
|
2021-09-21 14:56:31 +00:00
|
|
|
}
|
2021-09-21 18:30:14 +00:00
|
|
|
return ok;
|
2021-09-21 14:56:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
half4 main(float2 coords) {
|
|
|
|
int x = int(colorGreen.g);
|
|
|
|
return (switch_fallthrough(x) && switch_fallthrough_twice(x)) ? colorGreen : colorRed;
|
2020-09-14 21:30:13 +00:00
|
|
|
}
|