xref: /aosp_15_r20/external/skia/resources/sksl/runtime/ArrayNarrowingConversions.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard Worker#version 300
2*c8dee2aaSAndroid Build Coastguard Worker
3*c8dee2aaSAndroid Build Coastguard Workeruniform half4 colorGreen, colorRed;
4*c8dee2aaSAndroid Build Coastguard Worker
5*c8dee2aaSAndroid Build Coastguard Workerhalf4 main(float2 coords) {
6*c8dee2aaSAndroid Build Coastguard Worker    highp   int   i2[2] = int   [2](1, 2);
7*c8dee2aaSAndroid Build Coastguard Worker    mediump int   s2[2] = int   [2](1, 2);
8*c8dee2aaSAndroid Build Coastguard Worker    highp   float f2[2] = float [2](1, 2);
9*c8dee2aaSAndroid Build Coastguard Worker    mediump float h2[2] = float [2](1, 2);
10*c8dee2aaSAndroid Build Coastguard Worker
11*c8dee2aaSAndroid Build Coastguard Worker    i2 = s2;
12*c8dee2aaSAndroid Build Coastguard Worker    s2 = i2;
13*c8dee2aaSAndroid Build Coastguard Worker    f2 = h2;
14*c8dee2aaSAndroid Build Coastguard Worker    h2 = f2;
15*c8dee2aaSAndroid Build Coastguard Worker
16*c8dee2aaSAndroid Build Coastguard Worker    const highp   int   ci2[2] = int   [2](1, 2);
17*c8dee2aaSAndroid Build Coastguard Worker    const mediump int   cs2[2] = int   [2](1, 2);
18*c8dee2aaSAndroid Build Coastguard Worker    const highp   float cf2[2] = float [2](1, 2);
19*c8dee2aaSAndroid Build Coastguard Worker    const mediump float ch2[2] = float [2](1, 2);
20*c8dee2aaSAndroid Build Coastguard Worker
21*c8dee2aaSAndroid Build Coastguard Worker    return (i2 == s2 && f2 == h2 && ci2 == cs2 && cf2 == ch2 && i2 == cs2 && h2 == cf2)
22*c8dee2aaSAndroid Build Coastguard Worker                ? colorGreen
23*c8dee2aaSAndroid Build Coastguard Worker                : colorRed;
24*c8dee2aaSAndroid Build Coastguard Worker}
25