• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 140
2in vec4 bigColor;
3in vec4 bigColor1_1;
4in vec4 bigColor1_2;
5in vec4 bigColor1_3;
6in vec4 bigColor2;
7in vec4 bigColor3;
8in vec4 bigColor4;
9in vec4 bigColor5;
10in vec4 bigColor6;
11in vec4 bigColor7;
12in vec4 bigColor8;
13
14in vec4 BaseColor;
15
16in float d;
17in float d2;
18in float d3;
19in float d4;
20in float d5;
21in float d6;
22in float d7;
23in float d8;
24in float d9;
25in float d10;
26in float d11;
27in float d12;
28in float d14;
29in float d15;
30in float d16;
31in float d17;
32in float d18;
33flat in int Count;
34
35void main()
36{
37    vec4 color = BaseColor;
38
39    // Not a real loop
40    while (true) {
41        if (color.x < 0.33) {
42            color += vec4(0.33);
43            break;
44        }
45        if (color.x < 0.66) {
46            color += vec4(0.66);
47            break;
48        }
49
50        color += vec4(0.33);
51        break;
52    }
53
54    // While
55    while (color.x < d) {
56        color += bigColor;
57    }
58
59    // While (latchy)
60    while (color.z < d) {
61        color += bigColor1_1;
62        if (color.w < d)
63            continue;
64
65        color += bigColor1_1;
66    }
67
68    // While (constant)
69    while (color.x < 42.0) {
70        ++color;
71    }
72
73    // While (complicated-conditional)
74    while (color.w < d2 && color.y < d3) {
75        color += bigColor1_2;
76    }
77
78    // While (multi-exit)
79    while (color.z < d3) {
80        color += bigColor1_3;
81        if (color.y < d4)
82            break;
83        color += bigColor1_3;
84    }
85
86    // For (dynamic)
87    for (int i = 0; i < Count; ++i) {
88        color += bigColor2;
89    }
90
91    // Do while
92    do {
93        color += bigColor3;
94    } while (color.x < d2);
95
96    // For (static)
97    for (int i = 0; i < 42; ++i) {
98        color.z += d3;
99    }
100
101    // For (static) flow-control
102    for (int i = 0; i < 100; ++i) {
103        if (color.z < 20.0)
104            color.x++;
105        else
106            color.y++;
107        if (color.w < 20.0)
108            if (color.z > color.y)
109                0;              // do nothing
110    }
111
112    // For (static) flow-control with latch merge
113    for (int i = 0; i < 120; ++i) {
114        if (color.z < 20.0)
115            color.x++;
116        else
117            color.y++;
118    }
119
120    // For (static) latchy
121    for (int i = 0; i < 42; ++i) {
122        color.z += d3;
123        if (color.x < d4)
124            continue;
125        ++color.w;
126    }
127
128    // For (static) multi-exit
129    for (int i = 0; i < 42; ++i) {
130        color.z += d3;
131        if (color.x < d4)
132            break;
133        ++color.w;
134    }
135
136    // Latchy
137    do {
138        color += bigColor4;
139        if (color.x < d4)
140            continue;
141        if (color.y < d4)
142            color.y += d4;
143        else
144            color.x += d4;
145    } while (color.z < d4);
146
147    // Do while flow control
148    do {
149        color += bigColor5;
150        if (color.y < d5)
151            color.y += d5;
152    } while (color.x < d5);
153
154    // If then loop
155    if (color.x < d6) {
156        while (color.y < d6)
157            color += bigColor6;
158    } else {
159        while (color.z < d6)
160            color.z += bigColor6.z;
161    }
162
163    // If then multi-exit
164    if (color.x < d6) {
165        while (color.y < d6) {
166            color += bigColor6;
167            if (d7 < 1.0)
168                break;
169        }
170
171    } else {
172        while (color.z < d6)
173            color.z += bigColor6.z;
174    }
175
176
177    // Multi-exit
178    do {
179       if (d7 < 0.0)
180           break;
181
182       color += bigColor7;
183
184       if (d7 < 1.0) {
185           color.z++;
186           break;
187       }
188
189       color += BaseColor;
190
191    } while (true);
192
193
194    // Multi-exit2
195    do {
196        // invariant conditional break at the top of the loop. This could be a
197        // situation where unswitching the loop has no real increases in code
198        // size.
199       if (d8 < 0.0)
200           break;
201
202       color += bigColor7;
203
204       if (d8 < 1.0) {
205           color.z++;
206           if (d8 < 2.0) {
207               color.y++;
208           } else {
209               color.x++;
210           }
211           break;
212       }
213
214       color += BaseColor;
215
216    } while (color.z < d8);
217
218    // Deep exit
219    while (color.w < d9) {
220        if (d9 > d8) {
221            if (color.x <= d7) {
222                if (color.z == 5.0)
223                    color.w++;
224                else
225                    break;
226            }
227        }
228
229    }
230
231    // No end loop-back.
232    while (color.z < d10) {
233        color.y++;
234        if (color.y < d11) {
235            color.z++;
236            if (color.w < d12)
237                color.w++;
238            else
239                color.x++;
240            continue;
241        }
242
243        color++;
244        break;
245    }
246
247    // Multi-continue
248    while (color.x < 10.0) {
249        color += bigColor8;
250
251        if (color.z < d8)
252            if (color.w < d6)
253                continue;
254
255        color.y += bigColor8.x;
256    }
257
258    color++;
259    gl_FragColor = color;
260
261    // Early Return
262    while (color.x < d14) {
263        if (color.y < d15) {
264            return;
265        }
266        else
267            color++;
268    }
269
270    color++;
271
272    while (color.w < d16) {
273        color.w++;
274    }
275
276
277    // While (complicated-conditional)
278    while (color.w < d2 && color.y < d3) {
279        color += bigColor1_2;
280        if (color.z < d3)
281            return;
282    }
283
284
285    do {
286        if (color.y < d18)
287            return;
288        color++;
289    } while (color.x < d17);
290
291    // Early Discard
292    while (color.y < d16) {
293        if (color.w < d16) {
294            discard;
295        } else
296            color++;
297    }
298
299    color++;
300
301    gl_FragColor = color;
302}
303