1cb93a386Sopenharmony_ci/*#pragma settings NoInline*/
2cb93a386Sopenharmony_ci
3cb93a386Sopenharmony_ciuniform half4 colorGreen, colorRed, colorWhite;
4cb93a386Sopenharmony_ci
5cb93a386Sopenharmony_civoid out_half (out half  v) { v = colorWhite.r; }
6cb93a386Sopenharmony_civoid out_half2(out half2 v) { v = half2(colorWhite.g); }
7cb93a386Sopenharmony_civoid out_half3(out half3 v) { v = half3(colorWhite.b); }
8cb93a386Sopenharmony_civoid out_half4(out half4 v) { v = half4(colorWhite.a); }
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_civoid out_half2x2(out half2x2 v) { v = half2x2(colorWhite.r); }
11cb93a386Sopenharmony_civoid out_half3x3(out half3x3 v) { v = half3x3(colorWhite.g); }
12cb93a386Sopenharmony_civoid out_half4x4(out half4x4 v) { v = half4x4(colorWhite.b); }
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_civoid out_int (out int  v) { v = int(colorWhite.r); }
15cb93a386Sopenharmony_civoid out_int2(out int2 v) { v = int2(colorWhite.g); }
16cb93a386Sopenharmony_civoid out_int3(out int3 v) { v = int3(colorWhite.b); }
17cb93a386Sopenharmony_civoid out_int4(out int4 v) { v = int4(colorWhite.a); }
18cb93a386Sopenharmony_ci
19cb93a386Sopenharmony_civoid out_float (out float  v) { v = float(colorWhite.r); }
20cb93a386Sopenharmony_civoid out_float2(out float2 v) { v = float2(colorWhite.g); }
21cb93a386Sopenharmony_civoid out_float3(out float3 v) { v = float3(colorWhite.b); }
22cb93a386Sopenharmony_civoid out_float4(out float4 v) { v = float4(colorWhite.a); }
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_civoid out_float2x2(out float2x2 v) { v = float2x2(colorWhite.r); }
25cb93a386Sopenharmony_civoid out_float3x3(out float3x3 v) { v = float3x3(colorWhite.g); }
26cb93a386Sopenharmony_civoid out_float4x4(out float4x4 v) { v = float4x4(colorWhite.b); }
27cb93a386Sopenharmony_ci
28cb93a386Sopenharmony_civoid out_bool (out bool  v) { v = bool(colorWhite.r); }
29cb93a386Sopenharmony_civoid out_bool2(out bool2 v) { v = bool2(colorWhite.g); }
30cb93a386Sopenharmony_civoid out_bool3(out bool3 v) { v = bool3(colorWhite.b); }
31cb93a386Sopenharmony_civoid out_bool4(out bool4 v) { v = bool4(colorWhite.a); }
32cb93a386Sopenharmony_ci
33cb93a386Sopenharmony_cihalf4 main(float2 coords) {
34cb93a386Sopenharmony_ci    half4 result;
35cb93a386Sopenharmony_ci
36cb93a386Sopenharmony_ci    half     h;    out_half (h);
37cb93a386Sopenharmony_ci    half2    h2;   out_half2(h2);
38cb93a386Sopenharmony_ci    half3    h3;   out_half3(h3);
39cb93a386Sopenharmony_ci    half4    h4;   out_half4(h4);
40cb93a386Sopenharmony_ci                   out_half(h3[1]);
41cb93a386Sopenharmony_ci                   out_half2(h3.xz);
42cb93a386Sopenharmony_ci                   out_half4(h4.zwxy);
43cb93a386Sopenharmony_ci
44cb93a386Sopenharmony_ci    half2x2  h2x2; out_half2x2(h2x2);
45cb93a386Sopenharmony_ci    half3x3  h3x3; out_half3x3(h3x3);
46cb93a386Sopenharmony_ci    half4x4  h4x4; out_half4x4(h4x4);
47cb93a386Sopenharmony_ci                   out_half3(h3x3[1]);
48cb93a386Sopenharmony_ci                   out_half(h4x4[3].w);
49cb93a386Sopenharmony_ci                   out_half(h2x2[0][0]);
50cb93a386Sopenharmony_ci
51cb93a386Sopenharmony_ci    int      i;    out_int (i);
52cb93a386Sopenharmony_ci    int2     i2;   out_int2(i2);
53cb93a386Sopenharmony_ci    int3     i3;   out_int3(i3);
54cb93a386Sopenharmony_ci    int4     i4;   out_int4(i4);
55cb93a386Sopenharmony_ci                   out_int3(i4.xyz);
56cb93a386Sopenharmony_ci                   out_int(i2[1]);
57cb93a386Sopenharmony_ci
58cb93a386Sopenharmony_ci    float    f;    out_float (f);
59cb93a386Sopenharmony_ci    float2   f2;   out_float2(f2);
60cb93a386Sopenharmony_ci    float3   f3;   out_float3(f3);
61cb93a386Sopenharmony_ci    float4   f4;   out_float4(f4);
62cb93a386Sopenharmony_ci                   out_float2(f3.xy);
63cb93a386Sopenharmony_ci                   out_float(f2[0]);
64cb93a386Sopenharmony_ci
65cb93a386Sopenharmony_ci    float2x2 f2x2; out_float2x2(f2x2);
66cb93a386Sopenharmony_ci    float3x3 f3x3; out_float3x3(f3x3);
67cb93a386Sopenharmony_ci    float4x4 f4x4; out_float4x4(f4x4);
68cb93a386Sopenharmony_ci                   out_float(f2x2[0][0]);
69cb93a386Sopenharmony_ci
70cb93a386Sopenharmony_ci    bool     b;    out_bool (b);
71cb93a386Sopenharmony_ci    bool2    b2;   out_bool2(b2);
72cb93a386Sopenharmony_ci    bool3    b3;   out_bool3(b3);
73cb93a386Sopenharmony_ci    bool4    b4;   out_bool4(b4);
74cb93a386Sopenharmony_ci                   out_bool2(b4.xw);
75cb93a386Sopenharmony_ci                   out_bool(b3[2]);
76cb93a386Sopenharmony_ci
77cb93a386Sopenharmony_ci    bool ok = true;
78cb93a386Sopenharmony_ci    ok = ok && 1 == (h * h2.x * h3.x * h4.x * h2x2[0][0] * h3x3[0][0] * h4x4[0][0]);
79cb93a386Sopenharmony_ci    ok = ok && 1 == (f * f2.x * f3.x * f4.x * f2x2[0][0] * f3x3[0][0] * f4x4[0][0]);
80cb93a386Sopenharmony_ci    ok = ok && 1 == (i * i2.x * i3.x * i4.x);
81cb93a386Sopenharmony_ci    ok = ok &&      (b && b2.x && b3.x && b4.x);
82cb93a386Sopenharmony_ci
83cb93a386Sopenharmony_ci    return ok ? colorGreen : colorRed;
84cb93a386Sopenharmony_ci}
85