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 |
|
| 3 | layout(location = 7) in vec3 c;
|
| 4 | layout(LocatioN = 3) in vec4 p;
|
| 5 | layout(location = 9) in ivec2 aiv2;
|
| 6 | out vec4 pos;
|
| 7 | out vec3 color;
|
| 8 | flat out int iout;
|
| 9 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 10 | layout(row_major) uniform; // default is now row_major
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 11 |
|
| 12 | layout(std140) uniform Transform { // layout of this block is std140
|
| 13 | mat4 M1; // row_major
|
| 14 | layout(column_major) mat4 M2; // column major
|
| 15 | mat3 N1; // row_major
|
| 16 | int iuin;
|
| 17 | } tblock;
|
| 18 |
|
| 19 | uniform T2 { // layout of this block is shared
|
| 20 | bool b;
|
| 21 | mat4 t2m;
|
| 22 | };
|
| 23 |
|
| 24 | layout(column_major) uniform T3 { // shared and column_major
|
| 25 | mat4 M3; // column_major
|
| 26 | layout(row_major) mat4 M4; // row major
|
| 27 | mat2x3 N2; // column_major
|
| 28 | uvec3 uv3a[4];
|
| 29 | };
|
| 30 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 31 | uint uiuin;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 32 |
|
| 33 | struct S {
|
| 34 | vec3 c;
|
| 35 | float f;
|
| 36 | };
|
| 37 |
|
| 38 | out S s;
|
| 39 |
|
| 40 | void main()
|
| 41 | {
|
| 42 | pos = p * (tblock.M1 * tblock.M2 * M4 * M3 * t2m);
|
| 43 | color = c * tblock.N1;
|
| 44 | iout = tblock.iuin + int(uiuin) + aiv2.y;
|
| 45 | s.c = c;
|
| 46 | s.f = p.x;
|
| 47 | if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5))
|
| 48 | ++s.c;
|
| 49 | }
|