Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
[platform/upstream/glslang.git] / Test / structAssignment.frag
1 #version 130\r
2 \r
3 uniform sampler2D sampler;\r
4 varying mediump vec2 coord;\r
5 \r
6 struct lunarStruct1 {\r
7     int i;\r
8     float f;\r
9 };\r
10 \r
11 struct lunarStruct2 {\r
12     int i;\r
13     float f;\r
14         lunarStruct1 s1_1;\r
15 };\r
16 \r
17 struct lunarStruct3 {\r
18         lunarStruct2 s2_1;\r
19     int i;\r
20     float f;\r
21         lunarStruct1 s1_1;\r
22 };\r
23 \r
24 \r
25 uniform lunarStruct1 foo;\r
26 uniform lunarStruct2 foo2;\r
27 uniform lunarStruct3 foo3;\r
28 \r
29 void main()\r
30 {\r
31         lunarStruct2 locals2;\r
32 \r
33         if (foo3.s2_1.i > 0)\r
34                 locals2 = foo3.s2_1;\r
35         else\r
36                 locals2 = foo2;\r
37 \r
38         gl_FragColor =  locals2.s1_1.f * texture2D(sampler, coord);\r
39 }\r