blob: 3819f9ed4c10b6b474535a143a67c3bcf409760b [file] [log] [blame]
uniform half4 colorGreen, colorRed;
half4 main(float2 c) {
bool ok = true;
// prefix '!'
ok = ok && !(colorGreen.r == 1.0);
uint val = uint(colorGreen.r); // 0
// Unary bitwise negation '~' (scalar):
uint2 mask = uint2(val, ~val);
// Unary bitwise negation '~' (vector, uint):
int2 imask = int2(~mask);
// Unary bitwise negation '~' (vector, int):
mask = ~mask & uint2(~imask);
ok = ok && (mask == uint2(0));
half one = half(colorGreen.r);
half4x4 m = half4x4(one); // identity
// prefix '-'
return ok ? -m * -colorGreen : colorRed;
}