1uniform half4 color; 2 3inline half4 switchy(half4 c) { 4 half4 result; 5 switch (int(c.x)) { 6 case 1: result = c.yyyy; break; 7 default: result = c.zzzz; break; 8 } 9 return result; 10} 11 12void main() { 13 sk_FragColor = switchy(color); 14} 15