3 GL_ARB_tessellation_shader
12 gl_Position = piglit_vertex;
15 [tessellation control shader]
17 #extension GL_ARB_tessellation_shader : require
18 layout(vertices = 4) out;
25 if (gl_InvocationID == 0)
30 v[gl_InvocationID] = int(gl_InvocationID);
32 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
33 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
34 gl_TessLevelInner = float[2](1.0, 1.0);
37 [tessellation evaluation shader]
39 #extension GL_ARB_tessellation_shader : require
40 layout(quads, equal_spacing) in;
46 #define INTERP_QUADj(INj, OUT) do { \
48 for (int j = 0; j < 4; j++) v[j] = INj; \
49 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
56 for (int i = 0; i < 4; i++)
57 pass = pass && (v[i] == i);
59 fscolor = pass ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
61 INTERP_QUADj(gl_in[j].gl_Position, gl_Position);
75 clear color 0.5 0.5 0.5 0.5
78 patch parameter vertices 4
80 draw rect patch -1 -1 0.09 0.09
81 #draw arrays GL_PATCHES 0 4
82 probe rgb 6 6 0.0 1.0 0.0