xref: /aosp_15_r20/external/skia/tests/sksl/shared/SwitchWithFallthroughGroups.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#version 400
2out vec4 sk_FragColor;
3uniform vec4 colorGreen;
4uniform vec4 colorRed;
5bool switch_fallthrough_groups_bi(int value) {
6    bool ok = false;
7    int _tmpSwitchValue1 = value, _tmpSwitchFallthrough0 = 0;
8    for (int _tmpSwitchLoop2 = 0; _tmpSwitchLoop2 < 1; _tmpSwitchLoop2++) {
9        if ((_tmpSwitchValue1 == -1)) {
10            ok = false;
11            _tmpSwitchFallthrough0 = 1;
12        }
13        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 0)) {
14            return false;
15            _tmpSwitchFallthrough0 = 1;
16        }
17        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 1)) {
18            ok = true;
19            _tmpSwitchFallthrough0 = 1;
20        }
21        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 2)) {
22            ;
23            _tmpSwitchFallthrough0 = 1;
24        }
25        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 3)) {
26            break;
27            _tmpSwitchFallthrough0 = 1;
28        }
29        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 4)) {
30            ok = false;
31            _tmpSwitchFallthrough0 = 1;
32        }
33        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 5)) {
34            ;
35            _tmpSwitchFallthrough0 = 1;
36        }
37        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 6)) {
38            ;
39            _tmpSwitchFallthrough0 = 1;
40        }
41        if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 7)) {
42            ;
43            _tmpSwitchFallthrough0 = 1;
44        }
45        break;
46    }
47    return ok;
48}
49vec4 main() {
50    int x = int(colorGreen.y);
51    return switch_fallthrough_groups_bi(x) ? colorGreen : colorRed;
52}
53