xref: /aosp_15_r20/external/skia/tests/sksl/shared/SwitchWithFallthroughAndVarDecls.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#version 400
2out vec4 sk_FragColor;
3uniform vec4 colorGreen;
4uniform vec4 colorRed;
5vec4 main() {
6    bool ok;
7    {
8        bool a;
9        const int ONE = 1;
10        int b;
11        int c;
12        int _tmpSwitchValue1 = int(colorGreen.y), _tmpSwitchFallthrough0 = 0;
13        for (int _tmpSwitchLoop2 = 0; _tmpSwitchLoop2 < 1; _tmpSwitchLoop2++) {
14            if ((_tmpSwitchValue1 == 0)) {
15                ;
16                _tmpSwitchFallthrough0 = 1;
17            }
18            if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 1)) {
19                ;
20                _tmpSwitchFallthrough0 = 1;
21            }
22            if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 2)) {
23                b = ONE;
24                _tmpSwitchFallthrough0 = 1;
25            }
26            if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 3)) {
27                {
28                    float d = float(b);
29                    c = int(d);
30                }
31                _tmpSwitchFallthrough0 = 1;
32            }
33            if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 4)) {
34                a = bool(c);
35                _tmpSwitchFallthrough0 = 1;
36            }
37            if ((_tmpSwitchFallthrough0 > 0) || (_tmpSwitchValue1 == 5)) {
38                ok = a;
39                _tmpSwitchFallthrough0 = 1;
40            }
41        }
42    }
43    return ok ? colorGreen : colorRed;
44}
45