blob: d14aa1cd4b59acb7c09f271fb62527c244362af6 [file] [log] [blame]
John Kessenichf6eae2a2016-01-22 17:47:22 -07001#version 310 es
John Kessenich39374da2015-05-15 21:32:46 +00002
3layout(location = 7) in vec3 c;
4layout(LocatioN = 3) in vec4 p;
5layout(location = 9) in ivec2 aiv2;
6out vec4 pos;
7out vec3 color;
8flat out int iout;
9
John Kessenich6c292d32016-02-15 20:58:50 -070010layout(row_major) uniform; // default is now row_major
John Kessenich39374da2015-05-15 21:32:46 +000011
12layout(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
19uniform T2 { // layout of this block is shared
20 bool b;
21 mat4 t2m;
22};
23
24layout(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 Kessenich6c292d32016-02-15 20:58:50 -070031uint uiuin;
John Kessenich39374da2015-05-15 21:32:46 +000032
33struct S {
34 vec3 c;
35 float f;
36};
37
38out S s;
39
40void 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}