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;
29 for (int i = 0; i < 16; i++)
30 var[gl_InvocationID].m1[i] = 1.0 + float(i);
32 for (int i = 0; i < 14; i++)
33 var[gl_InvocationID].m2[i] = 1.0 + float(16+i);
36 var[gl_InvocationID].m2[index-16] = 0.0;
38 var[gl_InvocationID].m1[index] = 0.0;
40 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
41 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
42 gl_TessLevelInner = float[2](1.0, 1.0);
48 for (int i = 0; i < 16; i++) {
49 float x = var[(gl_InvocationID + 1) % gl_PatchVerticesIn].m1[i];
51 pass = pass && x == (index == i ?
56 for (int i = 0; i < 14; i++) {
57 float x = var[(gl_InvocationID + 1) % gl_PatchVerticesIn].m2[i];
59 pass = pass && x == (index == 16+i ?
64 color[gl_InvocationID] = pass ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
67 [tessellation evaluation shader]
69 #extension GL_ARB_tessellation_shader : require
70 layout(quads, equal_spacing) in;
76 #define INTERP_QUADj(INj, OUT) do { \
78 for (int j = 0; j < 4; j++) v[j] = INj; \
79 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
84 INTERP_QUADj(color[j], fscolor);
85 INTERP_QUADj(gl_in[j].gl_Position, gl_Position);
99 clear color 0.5 0.5 0.5 0.5
102 patch parameter vertices 4
105 draw rect patch -1 -1 0.09 0.09
106 #draw arrays GL_PATCHES 0 4
107 probe rgb 6 6 0.0 1.0 0.0
110 draw rect patch -0.9 -1 0.09 0.09
111 probe rgb 18 6 0.0 1.0 0.0
114 draw rect patch -0.8 -1 0.09 0.09
115 probe rgb 31 6 0.0 1.0 0.0
118 draw rect patch -0.7 -1 0.09 0.09
119 probe rgb 43 6 0.0 1.0 0.0
122 draw rect patch -0.6 -1 0.09 0.09
123 probe rgb 56 6 0.0 1.0 0.0
126 draw rect patch -0.5 -1 0.09 0.09
127 probe rgb 68 6 0.0 1.0 0.0
130 draw rect patch -0.4 -1 0.09 0.09
131 probe rgb 81 6 0.0 1.0 0.0
134 draw rect patch -0.3 -1 0.09 0.09
135 probe rgb 93 6 0.0 1.0 0.0
138 draw rect patch -0.2 -1 0.09 0.09
139 probe rgb 106 6 0.0 1.0 0.0
142 draw rect patch -0.1 -1 0.09 0.09
143 probe rgb 118 6 0.0 1.0 0.0
146 draw rect patch 0 -1 0.09 0.09
147 probe rgb 131 6 0.0 1.0 0.0
150 draw rect patch 0.1 -1 0.09 0.09
151 probe rgb 143 6 0.0 1.0 0.0
154 draw rect patch 0.2 -1 0.09 0.09
155 probe rgb 156 6 0.0 1.0 0.0
158 draw rect patch 0.3 -1 0.09 0.09
159 probe rgb 168 6 0.0 1.0 0.0
162 draw rect patch 0.4 -1 0.09 0.09
163 probe rgb 181 6 0.0 1.0 0.0
166 draw rect patch 0.5 -1.0 0.09 0.09
167 probe rgb 193 6 0.0 1.0 0.0
170 draw rect patch -1 -0.9 0.09 0.09
171 probe rgb 6 18 0.0 1.0 0.0
174 draw rect patch -0.9 -0.9 0.09 0.09
175 probe rgb 18 18 0.0 1.0 0.0
178 draw rect patch -0.8 -0.9 0.09 0.09
179 probe rgb 31 18 0.0 1.0 0.0
182 draw rect patch -0.7 -0.9 0.09 0.09
183 probe rgb 43 18 0.0 1.0 0.0
186 draw rect patch -0.6 -0.9 0.09 0.09
187 probe rgb 56 18 0.0 1.0 0.0
190 draw rect patch -0.5 -0.9 0.09 0.09
191 probe rgb 68 18 0.0 1.0 0.0
194 draw rect patch -0.4 -0.9 0.09 0.09
195 probe rgb 81 18 0.0 1.0 0.0
198 draw rect patch -0.3 -0.9 0.09 0.09
199 probe rgb 93 18 0.0 1.0 0.0
202 draw rect patch -0.2 -0.9 0.09 0.09
203 probe rgb 106 18 0.0 1.0 0.0
206 draw rect patch -0.1 -0.9 0.09 0.09
207 probe rgb 118 18 0.0 1.0 0.0
210 draw rect patch 0 -0.9 0.09 0.09
211 probe rgb 131 18 0.0 1.0 0.0
214 draw rect patch 0.1 -0.9 0.09 0.09
215 probe rgb 143 18 0.0 1.0 0.0
218 draw rect patch 0.2 -0.9 0.09 0.09
219 probe rgb 156 18 0.0 1.0 0.0
222 draw rect patch 0.3 -0.9 0.09 0.09
223 probe rgb 168 18 0.0 1.0 0.0