1uniform half4 colorGreen, colorRed; 2 3half4 main(float2) { 4 bool ok = true; 5 6 // Unary bitwise negation '~' (scalar): 7 uint val = uint(colorGreen.r); // 0 8 uint2 mask = uint2(val, ~val); 9 10 // Unary bitwise negation '~' (vector, uint): 11 int2 imask = int2(~mask); 12 13 // Unary bitwise negation '~' (vector, int): 14 mask = ~mask & uint2(~imask); 15 ok = ok && (mask == uint2(0)); 16 17 return ok ? colorGreen : colorRed; 18} 19