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