blob: c08ea26ab620557f610a3f1c29325830b3cc359c [file] [log] [blame]
John Kessenich11f9fc72013-11-07 01:06:34 +00001#version 440 core
2
John Kessenich568bc3a2013-11-13 05:40:44 +00003layout(std140, row_major) uniform nameless {
John Kessenich11f9fc72013-11-07 01:06:34 +00004 vec3 anonMember1;
John Kessenich568bc3a2013-11-13 05:40:44 +00005 mat3x2 m23;
6 int scalarAfterm23;
John Kessenich11f9fc72013-11-07 01:06:34 +00007 vec4 anonDeadMember2;
8 vec4 anonMember3;
John Kessenich568bc3a2013-11-13 05:40:44 +00009 int scalarBeforeArray;
10 float floatArray[5];
11 int scalarAfterArray;
John Kessenich12f92212013-11-15 01:34:27 +000012 mat2x2 m22[9];
John Kessenich11f9fc72013-11-07 01:06:34 +000013};
14
John Kessenich568bc3a2013-11-13 05:40:44 +000015layout(std140, column_major) uniform c_nameless {
16 vec3 c_anonMember1;
17 mat3x2 c_m23;
18 int c_scalarAfterm23;
19 vec4 c_anonDeadMember2;
20 vec4 c_anonMember3;
21};
22
23layout(std140) uniform named {
John Kessenich11f9fc72013-11-07 01:06:34 +000024 vec3 deadMember1;
John Kessenich568bc3a2013-11-13 05:40:44 +000025 int scalar;
John Kessenich11f9fc72013-11-07 01:06:34 +000026 vec4 member2;
27 vec4 member3;
John Kessenich568bc3a2013-11-13 05:40:44 +000028 vec2 memvec2;
29 float memf1;
30 bool memf2;
31 int memf3;
32 vec2 memvec2a;
John Kessenich12f92212013-11-15 01:34:27 +000033 mat2x2 m22[7];
John Kessenich11f9fc72013-11-07 01:06:34 +000034} ablock;
35
John Kessenich568bc3a2013-11-13 05:40:44 +000036layout(std140) uniform namelessdead {
John Kessenich11f9fc72013-11-07 01:06:34 +000037 int a;
38};
39
John Kessenich568bc3a2013-11-13 05:40:44 +000040layout(std140) uniform namedDead {
John Kessenich11f9fc72013-11-07 01:06:34 +000041 int b;
42} bblock;
43
John Kessenich12f92212013-11-15 01:34:27 +000044struct N1 {
45 float a;
46};
47
48struct N2 {
49 float b;
50 float c;
51 float d;
52};
53
54struct N3 {
55 N1 n1;
56 N2 n2;
57};
58
59layout(std140) uniform nested {
60 N3 foo;
61} nest;
62
John Kessenich11f9fc72013-11-07 01:06:34 +000063struct TS {
64 int a;
65 int dead;
66};
67
68uniform TS s;
69
70uniform float uf1;
71uniform float uf2;
72uniform float ufDead3;
73uniform float ufDead4;
74
John Kessenichec252df2013-11-13 19:07:43 +000075uniform uimage2D image_ui2D;
76uniform sampler2D sampler_2D;
77uniform sampler2DMSArray sampler_2DMSArray;
78
John Kessenich12f92212013-11-15 01:34:27 +000079uniform mat2 dm22[10];
80
John Kessenich43e43ce2013-11-15 20:41:31 +000081struct deep1 {
82 vec2 va[3];
83 bool b;
84};
85
86struct deep2 {
87 int i;
88 deep1 d1[4];
89};
90
91struct deep3 {
92 vec4 iv4;
93 deep2 d2;
94 ivec3 v3;
95};
96
97uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2];
98
John Kessenich11f9fc72013-11-07 01:06:34 +000099const bool control = true;
100
101void deadFunction()
102{
103 vec3 v3 = ablock.deadMember1;
104 vec4 v = anonDeadMember2;
105 float f = ufDead4;
106}
107
108void liveFunction2()
109{
110 vec3 v = anonMember1;
111 float f = uf1;
112}
113
John Kessenichec252df2013-11-13 19:07:43 +0000114void liveFunction1(uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray)
115
John Kessenich11f9fc72013-11-07 01:06:34 +0000116{
117 liveFunction2();
118 float f = uf2;
119 vec4 v = ablock.member3;
120}
121
John Kessenich04884e42013-11-21 00:54:57 +0000122uniform abl {
123 float foo;
124} arrBl[4];
125
John Kessenich5b9f9882013-11-23 00:44:18 +0000126uniform abl2 {
127 float foo;
128} arrBl2[4];
129
John Kessenich11f9fc72013-11-07 01:06:34 +0000130void main()
131{
John Kessenichec252df2013-11-13 19:07:43 +0000132 liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);
John Kessenich11f9fc72013-11-07 01:06:34 +0000133 liveFunction2();
134
135 if (! control)
136 deadFunction();
137
138 float f;
John Kessenich12f92212013-11-15 01:34:27 +0000139 int i;
John Kessenich11f9fc72013-11-07 01:06:34 +0000140 if (control) {
141 liveFunction2();
142 f = anonMember3.z;
143 f = s.a;
John Kessenich568bc3a2013-11-13 05:40:44 +0000144 f = ablock.scalar;
145 f = m23[1].y + scalarAfterm23;
146 f = c_m23[1].y + c_scalarAfterm23;
147 f += scalarBeforeArray;
148 f += floatArray[2];
John Kessenich43e43ce2013-11-15 20:41:31 +0000149 f += floatArray[4];
John Kessenich568bc3a2013-11-13 05:40:44 +0000150 f += scalarAfterArray;
151 f += ablock.memvec2.x;
152 f += ablock.memf1;
153 f += float(ablock.memf2);
154 f += ablock.memf3;
155 f += ablock.memvec2a.y;
John Kessenich12f92212013-11-15 01:34:27 +0000156 f += ablock.m22[i][1][0];
157 f += dm22[3][0][1];
158 f += m22[2][1].y;
159 f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d;
John Kessenich43e43ce2013-11-15 20:41:31 +0000160 f += deepA[i].d2.d1[2].va[1].x;
161 f += deepB[1].d2.d1[i].va[1].x;
162 f += deepB[i].d2.d1[i].va[1].x;
163 deep3 d = deepC[1];
164 deep3 da[2] = deepD;
John Kessenich11f9fc72013-11-07 01:06:34 +0000165 } else
166 f = ufDead3;
John Kessenich04884e42013-11-21 00:54:57 +0000167
John Kessenich5b9f9882013-11-23 00:44:18 +0000168 f += arrBl[2].foo + arrBl[0].foo;
169 f += arrBl2[i].foo;
John Kessenich11f9fc72013-11-07 01:06:34 +0000170}