John Kessenich | 0e7674a | 2015-06-26 12:24:28 -0600 | [diff] [blame] | 1 | #version 310 es
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 | precision mediump float;
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 3 | flat in int c, d;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 4 | in float x;
|
| 5 | out float color;
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 6 | in vec4 v;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 7 |
|
| 8 | vec4 foo1(vec4 v1, vec4 v2, int i1)
|
| 9 | {
|
| 10 | switch (i1)
|
| 11 | {
|
| 12 | case 0:
|
| 13 | return v1;
|
| 14 | case 2:
|
| 15 | case 1:
|
| 16 | return v2;
|
| 17 | case 3:
|
| 18 | return v1 * v2;
|
| 19 | }
|
| 20 |
|
| 21 | return vec4(0.0);
|
| 22 | }
|
| 23 |
|
| 24 | vec4 foo2(vec4 v1, vec4 v2, int i1)
|
| 25 | {
|
| 26 | switch (i1)
|
| 27 | {
|
| 28 | case 0:
|
| 29 | return v1;
|
| 30 | case 2:
|
| 31 | return vec4(1.0);
|
| 32 | case 1:
|
| 33 | return v2;
|
| 34 | case 3:
|
| 35 | return v1 * v2;
|
| 36 | }
|
| 37 |
|
| 38 | return vec4(0.0);
|
| 39 | }
|
| 40 |
|
| 41 | void main()
|
| 42 | {
|
| 43 | float f;
|
| 44 | int a[2];
|
| 45 | int local = c;
|
| 46 |
|
| 47 | switch(++local)
|
| 48 | {
|
| 49 | }
|
| 50 |
|
| 51 | switch (c) {
|
| 52 | case 1:
|
| 53 | f = sin(x);
|
| 54 | break;
|
| 55 | case 2:
|
| 56 | f = cos(x);
|
| 57 | break;
|
| 58 | default:
|
| 59 | f = tan(x);
|
| 60 | }
|
| 61 |
|
| 62 | switch (c) {
|
| 63 | case 1:
|
| 64 | f += sin(x);
|
| 65 | case 2:
|
| 66 | f += cos(x);
|
| 67 | break;
|
| 68 | default:
|
| 69 | f += tan(x);
|
| 70 | }
|
| 71 |
|
| 72 | switch (c) {
|
| 73 | case 1:
|
| 74 | f += sin(x);
|
| 75 | break;
|
| 76 | case 2:
|
| 77 | f += cos(x);
|
| 78 | break;
|
| 79 | }
|
| 80 |
|
| 81 | switch (c) {
|
| 82 | case 1:
|
| 83 | f += sin(x);
|
| 84 | break;
|
| 85 | case 2:
|
| 86 | switch (d) {
|
| 87 | case 1:
|
| 88 | f += x * x * x;
|
| 89 | break;
|
| 90 | case 2:
|
| 91 | f += x * x;
|
| 92 | break;
|
| 93 | }
|
| 94 | break;
|
| 95 | default:
|
| 96 | f += tan(x);
|
| 97 | }
|
| 98 |
|
| 99 | for (int i = 0; i < 10; ++i) {
|
| 100 | switch (c) {
|
| 101 | case 1:
|
| 102 | f += sin(x);
|
| 103 | for (int j = 20; j < 30; ++j) {
|
| 104 | ++f;
|
| 105 | if (f < 100.2)
|
| 106 | break;
|
| 107 | }
|
| 108 | break;
|
| 109 | case 2:
|
| 110 | f += cos(x);
|
| 111 | break;
|
| 112 | break;
|
| 113 | default:
|
| 114 | f += tan(x);
|
| 115 | }
|
| 116 |
|
| 117 | if (f < 3.43)
|
| 118 | break;
|
| 119 | }
|
| 120 |
|
| 121 | switch (c) {
|
| 122 | case 1:
|
| 123 | f += sin(x);
|
| 124 | break;
|
| 125 | case 2:
|
| 126 | // test no statements at end
|
| 127 | }
|
| 128 |
|
| 129 | color = f + float(local);
|
| 130 |
|
| 131 | color += foo1(v,v,c).y;
|
| 132 | color += foo2(v,v,c).z;
|
John Kessenich | 8d64d44 | 2015-06-12 22:34:37 +0000 | [diff] [blame] | 133 |
|
| 134 | switch (c) {
|
| 135 | case 0: break;
|
| 136 | default:
|
| 137 | }
|
| 138 |
|
| 139 | switch (c) {
|
| 140 | default:
|
| 141 | }
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 142 | }
|