blob: 139638d2fe8dcba1ff917bec77fab66e829cf505 [file] [log] [blame]
John Kessenichf6eae2a2016-01-22 17:47:22 -07001#version 140
John Kessenich39374da2015-05-15 21:32:46 +00002
John Kessenich6c292d32016-02-15 20:58:50 -07003varying vec4 bigColor;
4varying vec4 BaseColor;
5varying float d;
John Kessenich39374da2015-05-15 21:32:46 +00006
7float h = 0.0;
8
9float foo(vec4 bar)
10{
11 return bar.x + bar.y;
12}
13
14void bar()
15{
16}
17
18float unreachableReturn()
19{
20 if (d < 4.2)
21 return 1.2;
22 else
23 return 4.5;
24 // might be another return inserted here by builders, has to be correct type
25}
26
27float missingReturn()
28{
29 if (d < 4.5) {
30 h = d;
31 return 3.9;
32 }
33}
34
35void main()
36{
37 vec4 color = vec4(foo(BaseColor));
38
39 bar();
40 float f = unreachableReturn();
41 float g = missingReturn();
42
43 gl_FragColor = color * f * h;
44}