xref: /aosp_15_r20/external/skia/resources/sksl/folding/ArraySizeFolding.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorRed, colorGreen;
2
3bool check_array_is_int_2(int[2] x) {
4    return true;
5}
6
7bool test() {
8    const int two = 2;
9    const int4 vecTwo = int4(2);
10    int a[int4(1, 2, 3, 4).y];
11    int b[int(max(-5.5, 2.0))];
12    int c[two];
13    int d[vecTwo.yz01.x];
14    int e[two * vecTwo.x101.w];
15    int f[int2(float2x2(1, 2, 3, 4)[0]).y];
16    return check_array_is_int_2(a) &&
17           check_array_is_int_2(b) &&
18           check_array_is_int_2(c) &&
19           check_array_is_int_2(d) &&
20           check_array_is_int_2(e) &&
21           check_array_is_int_2(f);
22}
23
24bool check_array_is_float_3(float[3] x) {
25    return true;
26}
27
28bool test_param(float a[5*5-22], float b[1+1+1]) {
29    return check_array_is_float_3(a) && check_array_is_float_3(b);
30}
31
32half4 main(float2 coords) {
33    float f[3], g[3];
34    return test() && test_param(f, g) ? colorGreen : colorRed;
35}
36
37