blob: bf911fd21278e21f9ce56af98763f64281269046 [file] [log] [blame]
John Kessenichf6eae2a2016-01-22 17:47:22 -07001#version 140
John Kessenich39374da2015-05-15 21:32:46 +00002
3uniform vec4 bigColor;
John Kessenichf6eae2a2016-01-22 17:47:22 -07004in vec4 BaseColor;
John Kessenich39374da2015-05-15 21:32:46 +00005uniform float d;
6
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}