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;
21 patch out float m1[16];
22 patch out float m2[14];
26 for (int i = 0; i < 16; i++)
27 m1[i] = 1.0 + float(i);
29 for (int i = 0; i < 14; i++)
30 m2[i] = 1.0 + float(16+i);
37 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
38 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
39 gl_TessLevelInner = float[2](1.0, 1.0);
42 [tessellation evaluation shader]
44 #extension GL_ARB_tessellation_shader : require
45 layout(quads, equal_spacing) in;
48 patch in float m1[16];
49 patch in float m2[14];
52 #define INTERP_QUADj(INj, OUT) do { \
54 for (int j = 0; j < 4; j++) v[j] = INj; \
55 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
62 for (int i = 0; i < 16; i++) {
63 pass = pass && m1[i] == (index == i ?
68 for (int i = 0; i < 14; i++) {
69 pass = pass && m2[i] == (index == 16+i ?
74 fscolor = pass ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
76 INTERP_QUADj(gl_in[j].gl_Position, gl_Position);
90 clear color 0.5 0.5 0.5 0.5
93 patch parameter vertices 4
96 draw rect patch -1 -1 0.09 0.09
97 #draw arrays GL_PATCHES 0 4
98 probe rgb 6 6 0.0 1.0 0.0
101 draw rect patch -0.9 -1 0.09 0.09
102 probe rgb 18 6 0.0 1.0 0.0
105 draw rect patch -0.8 -1 0.09 0.09
106 probe rgb 31 6 0.0 1.0 0.0
109 draw rect patch -0.7 -1 0.09 0.09
110 probe rgb 43 6 0.0 1.0 0.0
113 draw rect patch -0.6 -1 0.09 0.09
114 probe rgb 56 6 0.0 1.0 0.0
117 draw rect patch -0.5 -1 0.09 0.09
118 probe rgb 68 6 0.0 1.0 0.0
121 draw rect patch -0.4 -1 0.09 0.09
122 probe rgb 81 6 0.0 1.0 0.0
125 draw rect patch -0.3 -1 0.09 0.09
126 probe rgb 93 6 0.0 1.0 0.0
129 draw rect patch -0.2 -1 0.09 0.09
130 probe rgb 106 6 0.0 1.0 0.0
133 draw rect patch -0.1 -1 0.09 0.09
134 probe rgb 118 6 0.0 1.0 0.0
137 draw rect patch 0 -1 0.09 0.09
138 probe rgb 131 6 0.0 1.0 0.0
141 draw rect patch 0.1 -1 0.09 0.09
142 probe rgb 143 6 0.0 1.0 0.0
145 draw rect patch 0.2 -1 0.09 0.09
146 probe rgb 156 6 0.0 1.0 0.0
149 draw rect patch 0.3 -1 0.09 0.09
150 probe rgb 168 6 0.0 1.0 0.0
153 draw rect patch 0.4 -1 0.09 0.09
154 probe rgb 181 6 0.0 1.0 0.0
157 draw rect patch 0.5 -1.0 0.09 0.09
158 probe rgb 193 6 0.0 1.0 0.0
161 draw rect patch -1 -0.9 0.09 0.09
162 probe rgb 6 18 0.0 1.0 0.0
165 draw rect patch -0.9 -0.9 0.09 0.09
166 probe rgb 18 18 0.0 1.0 0.0
169 draw rect patch -0.8 -0.9 0.09 0.09
170 probe rgb 31 18 0.0 1.0 0.0
173 draw rect patch -0.7 -0.9 0.09 0.09
174 probe rgb 43 18 0.0 1.0 0.0
177 draw rect patch -0.6 -0.9 0.09 0.09
178 probe rgb 56 18 0.0 1.0 0.0
181 draw rect patch -0.5 -0.9 0.09 0.09
182 probe rgb 68 18 0.0 1.0 0.0
185 draw rect patch -0.4 -0.9 0.09 0.09
186 probe rgb 81 18 0.0 1.0 0.0
189 draw rect patch -0.3 -0.9 0.09 0.09
190 probe rgb 93 18 0.0 1.0 0.0
193 draw rect patch -0.2 -0.9 0.09 0.09
194 probe rgb 106 18 0.0 1.0 0.0
197 draw rect patch -0.1 -0.9 0.09 0.09
198 probe rgb 118 18 0.0 1.0 0.0
201 draw rect patch 0 -0.9 0.09 0.09
202 probe rgb 131 18 0.0 1.0 0.0
205 draw rect patch 0.1 -0.9 0.09 0.09
206 probe rgb 143 18 0.0 1.0 0.0
209 draw rect patch 0.2 -0.9 0.09 0.09
210 probe rgb 156 18 0.0 1.0 0.0
213 draw rect patch 0.3 -0.9 0.09 0.09
214 probe rgb 168 18 0.0 1.0 0.0