perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.50 / execution / gs-redeclares-pervertex-in-only.shader_test
blobf28bd7f60aed2a891fa5eaf8e9c36ee9653aa8e4
1 # This test verifies that a geometry shader can redeclare just the
2 # gl_PerVertex input block, but still use members of the gl_PerVertex
3 # output block (whether or not those members were included in the
4 # redeclaration of the input block).
6 [require]
7 GLSL >= 1.50
9 [vertex shader]
10 in vec4 piglit_vertex;
11 out gl_PerVertex {
12   vec4 gl_Position;
15 void main()
17   gl_Position = piglit_vertex;
20 [geometry shader]
21 layout(triangles) in;
22 layout(triangle_strip, max_vertices = 3) out;
24 in gl_PerVertex {
25   vec4 gl_Position;
26 } gl_in[];
28 void main()
30   for (int i = 0; i < 3; i++) {
31     gl_Position = gl_in[i].gl_Position;
32     gl_ClipDistance[0] = 1.0;
33     EmitVertex();
34   }
37 [fragment shader]
38 void main()
40   if (gl_ClipDistance[0] == 1.0)
41     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
42   else
43     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
46 [test]
47 # Since the fragment shader's gl_ClipDistance array is only defined
48 # for elements that have clipping enabled, we need to enable clip
49 # plane 0.  Fortunately the values we use for gl_ClipDistance are
50 # always positive, so no pixels are actually clipped.
51 enable GL_CLIP_PLANE0
52 clear color 0.0 0.0 0.0 0.0
53 clear
54 draw rect -1 -1 2 2
55 probe all rgba 0.0 1.0 0.0 1.0