1 /*#pragma settings NoInline*/
3 uniform half4 colorRed, colorGreen;
5 struct S { float x; int y; };
7 struct Nested { S a, b; };
9 struct Compound { float4 f4; int3 i3; };
11 S returns_a_struct() {
18 S constructs_a_struct() {
22 float accepts_a_struct(S s) {
23 return s.x + float(s.y);
26 void modifies_a_struct(inout S s) {
31 half4 main(float2 coords) {
32 S s = returns_a_struct();
33 float x = accepts_a_struct(s);
36 S expected = constructs_a_struct();
39 n1.a = returns_a_struct();
43 modifies_a_struct(n3.b);
45 Compound c1 = Compound(float4(1, 2, 3, 4), int3(5, 6, 7));
46 Compound c2 = Compound(float4(colorGreen.g, 2, 3, 4), int3(5, 6, 7));
47 Compound c3 = Compound(float4(colorGreen.r, 2, 3, 4), int3(5, 6, 7));
49 bool valid = (x == 3) && (s.x == 2) && (s.y == 3) &&
50 (s == expected) && (s == S(2, 3)) && (s != returns_a_struct()) &&
51 (n1 == n2) && (n1 != n3) && (n3 == Nested(S(1, 2), S(2, 3))) &&
52 (c1 == c2) && (c2 != c3);
54 return valid ? colorGreen : colorRed;