1#version 310 es
2
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
10layout(row_major) uniform; // default is now row_major
11
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    layout(align=16, offset=2048) uvec3 uv3a[4];
29};
30
31in uint uiuin;
32
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}
50