John Kessenich | 7c1aa10 | 2015-10-15 13:29:11 -0600 | [diff] [blame] | 1 | #version 400
|
| 2 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 3 | flat in ivec4 uiv4;
|
| 4 | in vec4 uv4;
|
| 5 | bool ub;
|
| 6 | bool uba;
|
| 7 | bvec4 ub41, ub42;
|
| 8 | in float uf;
|
| 9 | flat in int ui;
|
John Kessenich | 7c1aa10 | 2015-10-15 13:29:11 -0600 | [diff] [blame] | 10 |
|
| 11 | out float of1;
|
| 12 | out vec4 of4;
|
| 13 |
|
| 14 | bool foo() { ++of1; return of1 > 10.0; }
|
| 15 |
|
| 16 | void main()
|
| 17 | {
|
| 18 | of1 = 0.0;
|
| 19 | of4 = vec4(0.0);
|
| 20 |
|
| 21 | if (ub || ui > 2) // not worth short circuiting
|
| 22 | ++of1;
|
| 23 |
|
| 24 | if (ub && !uba) // not worth short circuiting
|
| 25 | ++of1;
|
| 26 |
|
| 27 | if (ub || foo()) // must short circuit
|
| 28 | ++of1;
|
| 29 |
|
| 30 | if (ub && foo()) // must short circuit
|
| 31 | ++of1;
|
| 32 |
|
| 33 | if (foo() || ub) // not worth short circuiting
|
| 34 | ++of1;
|
| 35 |
|
| 36 | if (foo() && ub) // not worth short circuiting
|
| 37 | ++of1;
|
| 38 |
|
| 39 | if (ub || ++of1 > 1.0) // must short circuit
|
| 40 | ++of4;
|
| 41 |
|
| 42 | if (++of1 > 1.0 || ub) // not worth short circuiting
|
| 43 | ++of4;
|
| 44 |
|
| 45 | if (ub || sin(uf) * 4.0 > of1) // worth short circuiting
|
| 46 | ++of1;
|
| 47 |
|
| 48 | if (ub && sin(uf) * 4.0 > of1) // worth short circuiting
|
| 49 | ++of1;
|
| 50 | }
|