xref: /aosp_15_r20/external/skia/tests/sksl/shared/OptimizationsStandaloneSettings.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1
2out vec4 sk_FragColor;
3uniform vec4 colorGreen;
4uniform vec4 colorRed;
5bool flatten_known_if_b() {
6    int value = 1;
7    return value == 1;
8}
9bool eliminate_empty_if_else_b() {
10    bool check = false;
11    check = !check;
12    return check;
13}
14bool eliminate_empty_else_b() {
15    bool check = true;
16    if (check) {
17        return true;
18    }
19    return false;
20}
21bool flatten_matching_ternary_b() {
22    return true;
23}
24bool flatten_expr_without_side_effects_b() {
25    bool check = true;
26    return check;
27}
28bool eliminate_no_op_arithmetic_b() {
29    const int ONE = 1;
30    int x = ONE;
31    return x == 1;
32}
33bool flatten_switch_b() {
34    {
35        return true;
36    }
37}
38vec4 main() {
39    return ((((((true && flatten_known_if_b()) && eliminate_empty_if_else_b()) && eliminate_empty_else_b()) && flatten_matching_ternary_b()) && flatten_expr_without_side_effects_b()) && eliminate_no_op_arithmetic_b()) && flatten_switch_b() ? colorGreen : colorRed;
40}
41