3 GL_ARB_tessellation_shader
18 gl_Position = piglit_vertex;
20 for (int i = 0; i < 16; i++)
21 vs.m1[i] = 1.0 + float(i);
23 for (int i = 0; i < 15; i++)
24 vs.m2[i] = 1.0 + float(16+i);
27 vs.m2[index-16] = 0.0;
32 [tessellation control shader]
34 #extension GL_ARB_tessellation_shader : require
35 layout(vertices = 4) out;
48 for (int i = 0; i < 16; i++)
49 pass = pass && vs[gl_InvocationID].m1[i] == (index == i ?
53 for (int i = 0; i < 15; i++)
54 pass = pass && vs[gl_InvocationID].m2[i] == (index == 16+i ?
58 color[gl_InvocationID] = pass ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
60 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
61 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
62 gl_TessLevelInner = float[2](1.0, 1.0);
65 [tessellation evaluation shader]
67 #extension GL_ARB_tessellation_shader : require
68 layout(quads, equal_spacing) in;
73 #define INTERP_QUAD(INi, OUT) { \
75 for (int i = 0; i < 4; i++) v[i] = INi; \
76 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
81 INTERP_QUAD(gl_in[i].gl_Position, gl_Position)
82 INTERP_QUAD(color[i], fscolor)
96 clear color 0.5 0.5 0.5 0.5
99 patch parameter vertices 4
102 draw rect patch -1 -1 0.09 0.09
103 #draw arrays GL_PATCHES 0 4
104 probe rgb 6 6 0.0 1.0 0.0
107 draw rect patch -0.9 -1 0.09 0.09
108 probe rgb 18 6 0.0 1.0 0.0
111 draw rect patch -0.8 -1 0.09 0.09
112 probe rgb 31 6 0.0 1.0 0.0
115 draw rect patch -0.7 -1 0.09 0.09
116 probe rgb 43 6 0.0 1.0 0.0
119 draw rect patch -0.6 -1 0.09 0.09
120 probe rgb 56 6 0.0 1.0 0.0
123 draw rect patch -0.5 -1 0.09 0.09
124 probe rgb 68 6 0.0 1.0 0.0
127 draw rect patch -0.4 -1 0.09 0.09
128 probe rgb 81 6 0.0 1.0 0.0
131 draw rect patch -0.3 -1 0.09 0.09
132 probe rgb 93 6 0.0 1.0 0.0
135 draw rect patch -0.2 -1 0.09 0.09
136 probe rgb 106 6 0.0 1.0 0.0
139 draw rect patch -0.1 -1 0.09 0.09
140 probe rgb 118 6 0.0 1.0 0.0
143 draw rect patch 0 -1 0.09 0.09
144 probe rgb 131 6 0.0 1.0 0.0
147 draw rect patch 0.1 -1 0.09 0.09
148 probe rgb 143 6 0.0 1.0 0.0
151 draw rect patch 0.2 -1 0.09 0.09
152 probe rgb 156 6 0.0 1.0 0.0
155 draw rect patch 0.3 -1 0.09 0.09
156 probe rgb 168 6 0.0 1.0 0.0
159 draw rect patch 0.4 -1 0.09 0.09
160 probe rgb 181 6 0.0 1.0 0.0
163 draw rect patch 0.5 -1.0 0.09 0.09
164 probe rgb 193 6 0.0 1.0 0.0
167 draw rect patch -1 -0.9 0.09 0.09
168 probe rgb 6 18 0.0 1.0 0.0
171 draw rect patch -0.9 -0.9 0.09 0.09
172 probe rgb 18 18 0.0 1.0 0.0
175 draw rect patch -0.8 -0.9 0.09 0.09
176 probe rgb 31 18 0.0 1.0 0.0
179 draw rect patch -0.7 -0.9 0.09 0.09
180 probe rgb 43 18 0.0 1.0 0.0
183 draw rect patch -0.6 -0.9 0.09 0.09
184 probe rgb 56 18 0.0 1.0 0.0
187 draw rect patch -0.5 -0.9 0.09 0.09
188 probe rgb 68 18 0.0 1.0 0.0
191 draw rect patch -0.4 -0.9 0.09 0.09
192 probe rgb 81 18 0.0 1.0 0.0
195 draw rect patch -0.3 -0.9 0.09 0.09
196 probe rgb 93 18 0.0 1.0 0.0
199 draw rect patch -0.2 -0.9 0.09 0.09
200 probe rgb 106 18 0.0 1.0 0.0
203 draw rect patch -0.1 -0.9 0.09 0.09
204 probe rgb 118 18 0.0 1.0 0.0
207 draw rect patch 0 -0.9 0.09 0.09
208 probe rgb 131 18 0.0 1.0 0.0
211 draw rect patch 0.1 -0.9 0.09 0.09
212 probe rgb 143 18 0.0 1.0 0.0
215 draw rect patch 0.2 -0.9 0.09 0.09
216 probe rgb 156 18 0.0 1.0 0.0
219 draw rect patch 0.3 -0.9 0.09 0.09
220 probe rgb 168 18 0.0 1.0 0.0
223 draw rect patch 0.4 -0.9 0.09 0.09
224 probe rgb 181 18 0.0 1.0 0.0