• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 440 core
2
3layout(std140, row_major) uniform nameless {
4    vec3 anonMember1;
5    mat3x2 m23;
6    int scalarAfterm23;
7    vec4 anonDeadMember2;
8    vec4 anonMember3;
9    int scalarBeforeArray;
10    float floatArray[5];
11    int scalarAfterArray;
12    mat2x2 m22[9];
13};
14
15layout(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 {
24    vec3 deadMember1;
25    int scalar;
26    vec4 member2;
27    vec4 member3;
28    vec2 memvec2;
29    float memf1;
30    bool  memf2;
31    int   memf3;
32    vec2 memvec2a;
33    mat2x2 m22[7];
34} ablock;
35
36layout(std140) uniform namelessdead {
37    int a;
38};
39
40layout(std140) uniform namedDead {
41    int b;
42} bblock;
43
44struct 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
63layout(std140) uniform nested2 {
64    vec4 padding; // offset 0, size 16
65    N3 a;       // offset 16, size 32
66    N1 b[4];    // offset 48, size 64
67    N1 c[2];    // offset 112, size 32
68    N1 d[4];    // offset 144, size 64
69} nest2;
70
71struct TS {
72    int a;
73    int dead;
74};
75
76uniform TS s;
77
78uniform float uf1;
79uniform float uf2;
80uniform float ufDead3;
81uniform float ufDead4;
82
83uniform writeonly uimage2D image_ui2D;
84uniform sampler2D sampler_2D;
85uniform sampler2DMSArray sampler_2DMSArray;
86
87uniform mat2 dm22[10];
88
89struct deep1 {
90    vec2 va[3];
91    bool b;
92};
93
94struct deep2 {
95    int i;
96    deep1 d1[4];
97};
98
99struct deep3 {
100    vec4 iv4;
101    deep2 d2;
102    ivec3 v3;
103};
104
105in float attributeFloat;
106layout(location = 2) in vec2 attributeFloat2;
107in vec3 attributeFloat3;
108in vec4 attributeFloat4;
109in mat4 attributeMat4;
110in float attributeFloatArray[3];
111
112uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2];
113
114const bool control = true;
115
116void deadFunction()
117{
118    vec3 v3 = ablock.deadMember1;
119    vec4 v = anonDeadMember2;
120    float f = ufDead4;
121}
122
123void liveFunction2()
124{
125    vec3 v = anonMember1;
126    float f = uf1;
127}
128
129void liveFunction1(writeonly uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray)
130
131{
132    liveFunction2();
133    float f = uf2;
134    vec4 v = ablock.member3;
135}
136
137uniform abl {
138    float foo;
139} arrBl[4];
140
141uniform abl2 {
142    float foo;
143} arrBl2[4];
144
145buffer buf1 {
146    float scalar;
147    float runtimeArray[];
148} buf1i;
149
150buffer buf2 {
151    float scalar;
152    N2 runtimeArray[];
153} buf2i;
154
155buffer buf3 {
156    float scalar;
157    float runtimeArray[];
158} buf3i;
159
160buffer buf4 {
161    float scalar;
162    N2 runtimeArray[];
163} buf4i;
164
165struct VertexInfo {
166    float position[3];
167    float normal[3];
168};
169
170struct TriangleInfo {
171    VertexInfo v[3];
172};
173
174buffer VertexCollection {
175    TriangleInfo t[5];
176    uint padding[10];
177};
178
179out float outval;
180
181void main()
182{
183    liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);
184    liveFunction2();
185
186    if (! control)
187        deadFunction();
188
189    float f;
190    int i;
191    if (control) {
192        liveFunction2();
193        f = anonMember3.z;
194        f = s.a;
195        f = ablock.scalar;
196        f = m23[1].y + scalarAfterm23;
197        f = c_m23[1].y + c_scalarAfterm23;
198        f += scalarBeforeArray;
199        f += floatArray[2];
200        f += floatArray[4];
201        f += scalarAfterArray;
202        f += ablock.memvec2.x;
203        f += ablock.memf1;
204        f += float(ablock.memf2);
205        f += ablock.memf3;
206        f += ablock.memvec2a.y;
207        f += ablock.m22[i][1][0];
208        f += dm22[3][0][1];
209        f += m22[2][1].y;
210        f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d;
211        f += deepA[i].d2.d1[2].va[1].x;
212        f += deepB[1].d2.d1[i].va[1].x;
213        f += deepB[i].d2.d1[i].va[1].x;
214        deep3 d = deepC[1];
215        deep3 da[2] = deepD;
216        deep1 db = deepA[i].d2.d1[i];
217    } else
218        f = ufDead3;
219
220    f += arrBl[2].foo + arrBl[0].foo;
221    f += arrBl2[i].foo;
222
223    f += attributeFloat;
224    f += attributeFloat2.x;
225    f += attributeFloat3.x;
226    f += attributeFloat4.x;
227    f += attributeMat4[0][1];
228    f += attributeFloatArray[2];
229    f += buf1i.runtimeArray[3];
230    f += buf2i.runtimeArray[3].c;
231    f += buf3i.runtimeArray[gl_InstanceID];
232    f += buf4i.runtimeArray[gl_InstanceID].c;
233
234    N3 n = nest2.a;
235    N1 b[4] = nest2.b;
236    f += nest2.c[1].a;
237    f += nest2.d[gl_InstanceID].a;
238
239    f += t[0].v[0].position[0];
240    f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID];
241    f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID];
242    TriangleInfo tlocal[5] = t;
243
244    outval = f;
245}
246