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;
24 patch out vec4 p1[16];
25 patch out vec4 p2[14];
29 for (int i = 0; i < 16; i++)
30 blk[gl_InvocationID].m1[i] = vec4(1.0, 1.1, 1.2, 1.3) + vec4(i);
32 for (int i = 0; i < 15; i++)
33 blk[gl_InvocationID].m2[i] = vec4(1.0, 1.1, 1.2, 1.3) + vec4(16+i);
35 for (int i = 0; i < 16; i++)
36 p1[i] = vec4(1.0, 1.1, 1.2, 1.3) + vec4(31+i);
38 for (int i = 0; i < 14; i++)
39 p2[i] = vec4(1.0, 1.1, 1.2, 1.3) + vec4(47+i);
41 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
42 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
43 gl_TessLevelInner = float[2](1.0, 1.0);
46 [tessellation evaluation shader]
48 #extension GL_ARB_tessellation_shader : require
49 layout(quads, equal_spacing) in;
61 #define INTERP_QUAD(INi, OUT) do { \
63 for (int i = 0; i < 4; i++) v[i] = INi; \
64 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
72 INTERP_QUAD(blk[i].m2[index-16], m);
75 INTERP_QUAD(blk[i].m1[index], m);
79 color = m == expect && p == expect+vec4(31) ?
80 vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
81 INTERP_QUAD(gl_in[i].gl_Position, gl_Position);
95 clear color 0.5 0.5 0.5 0.5
99 uniform vec4 expect 1 1.1 1.2 1.3
100 draw rect patch -1 -1 0.09 0.09
101 probe rgb 6 6 0.0 1.0 0.0
104 uniform vec4 expect 2 2.1 2.2 2.3
105 draw rect patch -0.9 -1 0.09 0.09
106 probe rgb 18 6 0.0 1.0 0.0
109 uniform vec4 expect 3 3.1 3.2 3.3
110 draw rect patch -0.8 -1 0.09 0.09
111 probe rgb 31 6 0.0 1.0 0.0
114 uniform vec4 expect 4 4.1 4.2 4.3
115 draw rect patch -0.7 -1 0.09 0.09
116 probe rgb 43 6 0.0 1.0 0.0
119 uniform vec4 expect 5 5.1 5.2 5.3
120 draw rect patch -0.6 -1 0.09 0.09
121 probe rgb 56 6 0.0 1.0 0.0
124 uniform vec4 expect 6 6.1 6.2 6.3
125 draw rect patch -0.5 -1 0.09 0.09
126 probe rgb 68 6 0.0 1.0 0.0
129 uniform vec4 expect 7 7.1 7.2 7.3
130 draw rect patch -0.4 -1 0.09 0.09
131 probe rgb 81 6 0.0 1.0 0.0
134 uniform vec4 expect 8 8.1 8.2 8.3
135 draw rect patch -0.3 -1 0.09 0.09
136 probe rgb 93 6 0.0 1.0 0.0
139 uniform vec4 expect 9 9.1 9.2 9.3
140 draw rect patch -0.2 -1 0.09 0.09
141 probe rgb 106 6 0.0 1.0 0.0
144 uniform vec4 expect 10 10.1 10.2 10.3
145 draw rect patch -0.1 -1 0.09 0.09
146 probe rgb 118 6 0.0 1.0 0.0
149 uniform vec4 expect 11 11.1 11.2 11.3
150 draw rect patch 0 -1 0.09 0.09
151 probe rgb 131 6 0.0 1.0 0.0
154 uniform vec4 expect 12 12.1 12.2 12.3
155 draw rect patch 0.1 -1 0.09 0.09
156 probe rgb 143 6 0.0 1.0 0.0
159 uniform vec4 expect 13 13.1 13.2 13.3
160 draw rect patch 0.2 -1 0.09 0.09
161 probe rgb 156 6 0.0 1.0 0.0
164 uniform vec4 expect 14 14.1 14.2 14.3
165 draw rect patch 0.3 -1 0.09 0.09
166 probe rgb 168 6 0.0 1.0 0.0
169 uniform vec4 expect 15 15.1 15.2 15.3
170 draw rect patch 0.4 -1 0.09 0.09
171 probe rgb 181 6 0.0 1.0 0.0
174 uniform vec4 expect 16 16.1 16.2 16.3
175 draw rect patch 0.5 -1.0 0.09 0.09
176 probe rgb 193 6 0.0 1.0 0.0
179 uniform vec4 expect 17 17.1 17.2 17.3
180 draw rect patch -1 -0.9 0.09 0.09
181 probe rgb 6 18 0.0 1.0 0.0
184 uniform vec4 expect 18 18.1 18.2 18.3
185 draw rect patch -0.9 -0.9 0.09 0.09
186 probe rgb 18 18 0.0 1.0 0.0
189 uniform vec4 expect 19 19.1 19.2 19.3
190 draw rect patch -0.8 -0.9 0.09 0.09
191 probe rgb 31 18 0.0 1.0 0.0
194 uniform vec4 expect 20 20.1 20.2 20.3
195 draw rect patch -0.7 -0.9 0.09 0.09
196 probe rgb 43 18 0.0 1.0 0.0
199 uniform vec4 expect 21 21.1 21.2 21.3
200 draw rect patch -0.6 -0.9 0.09 0.09
201 probe rgb 56 18 0.0 1.0 0.0
204 uniform vec4 expect 22 22.1 22.2 22.3
205 draw rect patch -0.5 -0.9 0.09 0.09
206 probe rgb 68 18 0.0 1.0 0.0
209 uniform vec4 expect 23 23.1 23.2 23.3
210 draw rect patch -0.4 -0.9 0.09 0.09
211 probe rgb 81 18 0.0 1.0 0.0
214 uniform vec4 expect 24 24.1 24.2 24.3
215 draw rect patch -0.3 -0.9 0.09 0.09
216 probe rgb 93 18 0.0 1.0 0.0
219 uniform vec4 expect 25 25.1 25.2 25.3
220 draw rect patch -0.2 -0.9 0.09 0.09
221 probe rgb 106 18 0.0 1.0 0.0
224 uniform vec4 expect 26 26.1 26.2 26.3
225 draw rect patch -0.1 -0.9 0.09 0.09
226 probe rgb 118 18 0.0 1.0 0.0
229 uniform vec4 expect 27 27.1 27.2 27.3
230 draw rect patch 0 -0.9 0.09 0.09
231 probe rgb 131 18 0.0 1.0 0.0
234 uniform vec4 expect 28 28.1 28.2 28.3
235 draw rect patch 0.1 -0.9 0.09 0.09
236 probe rgb 143 18 0.0 1.0 0.0
239 uniform vec4 expect 29 29.1 29.2 29.3
240 draw rect patch 0.2 -0.9 0.09 0.09
241 probe rgb 156 18 0.0 1.0 0.0
244 uniform vec4 expect 30 30.1 30.2 30.3
245 draw rect patch 0.3 -0.9 0.09 0.09
246 probe rgb 168 18 0.0 1.0 0.0