• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2out vec4 sk_FragColor;
3uniform vec4 colorRed;
4uniform vec4 colorGreen;
5struct S {
6    float x;
7    int y;
8};
9struct Nested {
10    S a;
11    S b;
12};
13struct Compound {
14    vec4 f4;
15    ivec3 i3;
16};
17S returns_a_struct_S() {
18    S s;
19    s.x = 1.0;
20    s.y = 2;
21    return s;
22}
23S constructs_a_struct_S() {
24    return S(2.0, 3);
25}
26float accepts_a_struct_fS(S s) {
27    return s.x + float(s.y);
28}
29void modifies_a_struct_vS(inout S s) {
30    s.x++;
31    s.y++;
32}
33vec4 main() {
34    S s = returns_a_struct_S();
35    float x = accepts_a_struct_fS(s);
36    modifies_a_struct_vS(s);
37    S expected = constructs_a_struct_S();
38    Nested n1;
39    Nested n2;
40    Nested n3;
41    n1.a = returns_a_struct_S();
42    n1.b = n1.a;
43    n2 = n1;
44    n3 = n2;
45    modifies_a_struct_vS(n3.b);
46    Compound c1 = Compound(vec4(1.0, 2.0, 3.0, 4.0), ivec3(5, 6, 7));
47    Compound c2 = Compound(vec4(colorGreen.y, 2.0, 3.0, 4.0), ivec3(5, 6, 7));
48    Compound c3 = Compound(vec4(colorGreen.x, 2.0, 3.0, 4.0), ivec3(5, 6, 7));
49    bool valid = (((((((((x == 3.0 && s.x == 2.0) && s.y == 3) && s == expected) && s == S(2.0, 3)) && s != returns_a_struct_S()) && n1 == n2) && n1 != n3) && n3 == Nested(S(1.0, 2), S(2.0, 3))) && c1 == c2) && c2 != c3;
50    return valid ? colorGreen : colorRed;
51}
52