1 # Test a set of simple pass-through tessellation shaders
5 GL_ARB_tessellation_shader
7 #[vertex shader passthrough]
12 const vec2 verts[] = vec2[](vec2(-1, 1),
16 const int elts[] = int[](0, 1, 2,
21 gl_Position = vec4(verts[elts[gl_VertexID]], 0, 1);
24 [tessellation control shader]
26 #extension GL_ARB_tessellation_shader : require
28 layout(vertices = 3) out;
32 gl_TessLevelInner[0] = 1.0;
33 gl_TessLevelInner[1] = 1.0;
34 gl_TessLevelOuter[0] = 1.0;
35 gl_TessLevelOuter[1] = 1.0;
36 gl_TessLevelOuter[2] = 1.0;
37 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
40 [tessellation evaluation shader]
42 #extension GL_ARB_tessellation_shader : require
44 layout(triangles, equal_spacing) in;
48 int index = int(gl_TessCoord.y + (2 * gl_TessCoord.z));
49 gl_Position = gl_in[index].gl_Position;
57 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
61 clear color 0.1 0.1 0.1 0.1
63 patch parameter vertices 3
64 draw arrays GL_PATCHES 0 6
65 probe all rgba 0.0 1.0 0.0 1.0