John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 1 | #version 140
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 3 | varying vec4 bigColor;
|
| 4 | varying vec4 BaseColor;
|
| 5 | varying float d;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 6 |
|
| 7 | float h = 0.0;
|
| 8 |
|
| 9 | float foo(vec4 bar)
|
| 10 | {
|
| 11 | return bar.x + bar.y;
|
| 12 | }
|
| 13 |
|
| 14 | void bar()
|
| 15 | {
|
| 16 | }
|
| 17 |
|
| 18 | float 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 |
|
| 27 | float missingReturn()
|
| 28 | {
|
| 29 | if (d < 4.5) {
|
| 30 | h = d;
|
| 31 | return 3.9;
|
| 32 | }
|
| 33 | }
|
| 34 |
|
| 35 | void 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 | }
|