4 GL_ARB_geometry_shader4
11 out float gs_input[6];
14 for (int i = 0; i < 6; i++)
21 #extension GL_ARB_geometry_shader4: enable
25 uniform sampler2D tex;
26 uniform sampler2D tex_array[7];
28 in float gs_input[][6];
34 for (int i = 0; i < gl_VerticesIn; i++) {
35 vec4 c = vec4(0, 0, 0, 1);
36 c.x = texture(tex_array[gl_VerticesIn], vec2(0.5, 0.5)).x;
38 const int three = gl_VerticesIn;
44 /* We sample from a row of 8 pixels, the left 4 blue and the
45 * right 4 white. Since we only use the red channel, the left 4
46 * are 0, and the right 4 are 1. sample twice from the fifth
49 c.z = textureOffset(tex, vec2(3.0/16.0, 0.75),
50 ivec2(gl_VerticesIn, 0)).x;
51 c.z *= textureOffset(tex, vec2(15.0/16.0, 0.75),
52 ivec2(gl_VerticesIn, 0)).x;
54 gl_Position = gl_PositionIn[i];
61 input type GL_TRIANGLES
62 output type GL_TRIANGLE_STRIP
83 uniform int tex_array[0] 1
84 uniform int tex_array[1] 1
85 uniform int tex_array[2] 1
86 uniform int tex_array[3] 2
87 uniform int tex_array[4] 1
88 uniform int tex_array[5] 1
89 uniform int tex_array[6] 1
92 texture checkerboard 1 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (0.0, 0.0, 0.0, 0.0)
93 texture checkerboard 2 0 (8, 8) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
94 draw arrays GL_TRIANGLE_FAN 0 4
95 probe all rgb 1.0 1.0 1.0