John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 1 | #version 310 es
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 | precision mediump float;
|
| 3 | in lowp float lowfin;
|
| 4 | in mediump float mediumfin;
|
| 5 | in highp vec4 highfin;
|
| 6 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 7 | highp int uniform_high;
|
| 8 | mediump int uniform_medium;
|
| 9 | lowp int uniform_low;
|
| 10 | bvec2 ub2;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 11 |
|
| 12 | out mediump vec4 mediumfout;
|
| 13 |
|
| 14 | highp float global_highp;
|
| 15 |
|
| 16 | lowp vec2 foo(mediump vec3 mv3)
|
| 17 | {
|
| 18 | return highfin.xy;
|
| 19 | }
|
| 20 |
|
| 21 | bool boolfun(bvec2 bv2)
|
| 22 | {
|
| 23 | return bv2 == bvec2(false, true);
|
| 24 | }
|
| 25 |
|
John Kessenich | 32cfd49 | 2016-02-02 12:37:46 -0700 | [diff] [blame] | 26 | struct S {
|
| 27 | highp float a;
|
| 28 | lowp float b;
|
| 29 | };
|
| 30 |
|
| 31 | in S s;
|
| 32 |
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 33 | void main()
|
| 34 | {
|
| 35 | lowp int sum = uniform_medium + uniform_high;
|
| 36 |
|
| 37 | sum += uniform_high;
|
| 38 | sum += uniform_low;
|
| 39 |
|
| 40 | // test maxing precisions of args to get precision of builtin
|
| 41 | lowp float arg1 = 3.2;
|
| 42 | mediump float arg2 = 1023908.2;
|
| 43 | lowp float d = distance(lowfin, mediumfin);
|
| 44 |
|
| 45 | global_highp = length(highfin);
|
| 46 |
|
| 47 | highp vec4 local_highp = vec4(global_highp);
|
| 48 |
|
| 49 | mediumfout = vec4(sin(d)) + arg2 + local_highp;
|
| 50 |
|
| 51 | sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x;
|
| 52 |
|
| 53 | mediumfout += vec4(sum);
|
| 54 |
|
| 55 | if (boolfun(ub2))
|
| 56 | ++mediumfout;
|
John Kessenich | 32cfd49 | 2016-02-02 12:37:46 -0700 | [diff] [blame] | 57 |
|
| 58 | mediumfout *= s.a;
|
| 59 | mediumfout *= s.b;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 60 | }
|