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 | 32c169d | 2016-08-03 17:35:19 -0600 | [diff] [blame] | 3 | precision mediump int;
|
| 4 |
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 5 | uniform sampler2D samp2D;
|
John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 6 | in mediump vec2 coord;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 7 |
|
| 8 | struct lunarStruct1 {
|
| 9 | int i;
|
| 10 | float f;
|
| 11 | };
|
| 12 |
|
| 13 | struct lunarStruct2 {
|
| 14 | int i;
|
| 15 | float f;
|
| 16 | lunarStruct1 s1_1;
|
| 17 | };
|
| 18 |
|
| 19 | struct lunarStruct3 {
|
| 20 | lunarStruct2 s2_1;
|
| 21 | int i;
|
| 22 | float f;
|
| 23 | lunarStruct1 s1_1;
|
| 24 | };
|
| 25 |
|
| 26 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 27 | lunarStruct1 foo;
|
| 28 | lunarStruct2 foo2;
|
| 29 | lunarStruct3 foo3;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 30 |
|
| 31 | void main()
|
| 32 | {
|
| 33 | lunarStruct2 locals2;
|
| 34 |
|
| 35 | if (foo3.s2_1.i > 0)
|
| 36 | locals2 = foo3.s2_1;
|
| 37 | else
|
| 38 | locals2 = foo2;
|
| 39 |
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 40 | gl_FragColor = locals2.s1_1.f * texture(samp2D, coord);
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 41 | }
|