1/*#pragma settings RewriteSwitchStatements*/ 2 3uniform half4 colorGreen, colorRed; 4 5bool switch_fallthrough_groups(int value) { 6 bool ok = false; 7 switch (value) { 8 case -1: ok = false; 9 case 0: return false; 10 11 case 1: ok = true; 12 case 2: 13 case 3: break; 14 15 case 4: ok = false; 16 case 5: 17 case 6: 18 case 7: 19 default: break; 20 } 21 return ok; 22} 23 24half4 main(float2 coords) { 25 int x = int(colorGreen.g); 26 return switch_fallthrough_groups(x) ? colorGreen : colorRed; 27} 28