1 #Basic test of gs 2d input arrays
5 GL_ARB_geometry_shader4
10 attribute vec4 vertex;
11 attribute float offset;
13 varying float gs_input[6];
14 varying float gs_offset;
18 for (int i = 0; i < 6; i++)
19 gs_input[i] = offset + float(i);
26 #extension GL_ARB_geometry_shader4: enable
30 varying in float gs_offset[];
31 varying in float gs_input[][6];
33 varying out float fs_ok;
39 for (int i = 0; i < gl_VerticesIn; i++) {
40 for (int j = 0; j < 6; j++) {
41 if (gs_input[i][j] != gs_offset[i] + float(j))
46 for (int i = 0; i < gl_VerticesIn; i++) {
48 gl_Position = gl_PositionIn[i];
54 input type GL_TRIANGLES
55 output type GL_TRIANGLE_STRIP
61 const int gs_VerticesIn = 3;
67 if (distance(fs_ok, 1.0) < 1e-6)
68 gl_FragColor = vec4(0, 1, 0, 1);
70 gl_FragColor = vec4(1, 0, 0, 1);
74 vertex/float/2 offset/float/1
81 draw arrays GL_TRIANGLE_FAN 0 4