xref: /aosp_15_r20/external/skia/resources/sksl/workarounds/TernaryShortCircuit.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1/*#pragma settings UnfoldShortCircuitAsTernary*/
2
3uniform int i;
4uniform int j;
5
6void main() {
7    bool x = bool(i);
8    bool y = bool(j);
9    bool andXY = x && y;
10    bool orXY = x || y;
11    bool combo = (x && y) || (x || y);
12    bool prec = (i + j == 3) && y;
13    while (andXY && orXY && combo && prec) {
14        sk_FragColor = half4(0);
15        break;
16    }
17}
18