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;
28 for (int i = 0; i < 16; i++)
29 var[gl_InvocationID].m1[i] = vec2(1.0, 1.1) + vec2(i);
31 for (int i = 0; i < 15; i++)
32 var[gl_InvocationID].m2[i] = vec2(1.0, 1.1) + vec2(16+i);
35 var[gl_InvocationID].m2[index-16] = vec2(0.0, 0.1);
37 var[gl_InvocationID].m1[index] = vec2(0.0, 0.1);
39 gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
40 gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
41 gl_TessLevelInner = float[2](1.0, 1.0);
44 [tessellation evaluation shader]
46 #extension GL_ARB_tessellation_shader : require
47 layout(quads, equal_spacing) in;
56 #define INTERP_QUADj(TYPE, INj, OUT) do { \
58 for (int j = 0; j < 4; j++) v[j] = INj; \
59 OUT = mix(mix(v[0], v[1], gl_TessCoord[0]), mix(v[2], v[3], gl_TessCoord[0]), \
66 for (int i = 0; i < 16; i++) {
69 INTERP_QUADj(vec2, var[j].m1[i], x);
70 pass = pass && x == (index == i ?
72 vec2(1.0, 1.1) + vec2(i));
75 for (int i = 0; i < 15; i++) {
78 INTERP_QUADj(vec2, var[j].m2[i], x);
79 pass = pass && x == (index == 16+i ?
81 vec2(17.0, 17.1) + vec2(i));
84 fscolor = pass ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
86 INTERP_QUADj(vec4, gl_in[j].gl_Position, gl_Position);
100 clear color 0.5 0.5 0.5 0.5
103 patch parameter vertices 4
106 draw rect patch -1 -1 0.09 0.09
107 #draw arrays GL_PATCHES 0 4
108 probe rgb 6 6 0.0 1.0 0.0
111 draw rect patch -0.9 -1 0.09 0.09
112 probe rgb 18 6 0.0 1.0 0.0
115 draw rect patch -0.8 -1 0.09 0.09
116 probe rgb 31 6 0.0 1.0 0.0
119 draw rect patch -0.7 -1 0.09 0.09
120 probe rgb 43 6 0.0 1.0 0.0
123 draw rect patch -0.6 -1 0.09 0.09
124 probe rgb 56 6 0.0 1.0 0.0
127 draw rect patch -0.5 -1 0.09 0.09
128 probe rgb 68 6 0.0 1.0 0.0
131 draw rect patch -0.4 -1 0.09 0.09
132 probe rgb 81 6 0.0 1.0 0.0
135 draw rect patch -0.3 -1 0.09 0.09
136 probe rgb 93 6 0.0 1.0 0.0
139 draw rect patch -0.2 -1 0.09 0.09
140 probe rgb 106 6 0.0 1.0 0.0
143 draw rect patch -0.1 -1 0.09 0.09
144 probe rgb 118 6 0.0 1.0 0.0
147 draw rect patch 0 -1 0.09 0.09
148 probe rgb 131 6 0.0 1.0 0.0
151 draw rect patch 0.1 -1 0.09 0.09
152 probe rgb 143 6 0.0 1.0 0.0
155 draw rect patch 0.2 -1 0.09 0.09
156 probe rgb 156 6 0.0 1.0 0.0
159 draw rect patch 0.3 -1 0.09 0.09
160 probe rgb 168 6 0.0 1.0 0.0
163 draw rect patch 0.4 -1 0.09 0.09
164 probe rgb 181 6 0.0 1.0 0.0
167 draw rect patch 0.5 -1.0 0.09 0.09
168 probe rgb 193 6 0.0 1.0 0.0
171 draw rect patch -1 -0.9 0.09 0.09
172 probe rgb 6 18 0.0 1.0 0.0
175 draw rect patch -0.9 -0.9 0.09 0.09
176 probe rgb 18 18 0.0 1.0 0.0
179 draw rect patch -0.8 -0.9 0.09 0.09
180 probe rgb 31 18 0.0 1.0 0.0
183 draw rect patch -0.7 -0.9 0.09 0.09
184 probe rgb 43 18 0.0 1.0 0.0
187 draw rect patch -0.6 -0.9 0.09 0.09
188 probe rgb 56 18 0.0 1.0 0.0
191 draw rect patch -0.5 -0.9 0.09 0.09
192 probe rgb 68 18 0.0 1.0 0.0
195 draw rect patch -0.4 -0.9 0.09 0.09
196 probe rgb 81 18 0.0 1.0 0.0
199 draw rect patch -0.3 -0.9 0.09 0.09
200 probe rgb 93 18 0.0 1.0 0.0
203 draw rect patch -0.2 -0.9 0.09 0.09
204 probe rgb 106 18 0.0 1.0 0.0
207 draw rect patch -0.1 -0.9 0.09 0.09
208 probe rgb 118 18 0.0 1.0 0.0
211 draw rect patch 0 -0.9 0.09 0.09
212 probe rgb 131 18 0.0 1.0 0.0
215 draw rect patch 0.1 -0.9 0.09 0.09
216 probe rgb 143 18 0.0 1.0 0.0
219 draw rect patch 0.2 -0.9 0.09 0.09
220 probe rgb 156 18 0.0 1.0 0.0
223 draw rect patch 0.3 -0.9 0.09 0.09
224 probe rgb 168 18 0.0 1.0 0.0
227 draw rect patch 0.4 -0.9 0.09 0.09
228 probe rgb 181 18 0.0 1.0 0.0