1#version 140
2
3in vec4 k;
4out vec4 o;
5
6in float gl_ClipDistance[5];
7
8layout(row_major) uniform;
9
10uniform sampler2D samp2Da[3];
11
12layout(std140) uniform bn {
13    layout(row_major) mat4 matra[4];
14    layout(column_major) mat4 matca[4];
15    layout(row_major) mat4 matr;
16    layout(column_major) mat4 matc;
17    layout(align=512, offset=1024) mat4 matrdef;
18};
19
20uniform sampler2DRect sampR;
21uniform isamplerBuffer sampB;
22
23float foo();
24
25void main()
26{
27    o.y = gl_ClipDistance[2];
28    o.z = gl_ClipDistance[int(k)];
29    o.w = float(textureSize(sampR) + textureSize(sampB)) / 100.0;
30    o.z = foo();
31}
32
33// Test extra-function initializers
34
35float i1 = gl_FrontFacing ? -2.0 : 2.0;
36float i2 = 102;
37
38float foo()
39{
40    return i1 + i2;
41}
42
43// test arrayed block
44layout(std140) uniform bi {
45    vec3 v[2];
46} bname[4];
47