1 case per_patch_array_of_structs
3 desc "per-patch variable type is array of structs"
4 expect compile_or_link_fail
5 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
14 tessellation_control ""
16 ${TESSELLATION_CONTROL_DECLARATIONS}
22 patch out S patchVariable[2]; // array of structures is illegal
25 patchVariable[0].a = gl_in[0].gl_Position.x;
26 patchVariable[0].b = gl_in[0].gl_Position.yz;
27 patchVariable[1].a = gl_in[0].gl_Position.z;
28 patchVariable[1].b = gl_in[0].gl_Position.wx;
29 ${TESSELLATION_CONTROL_OUTPUT}
32 tessellation_evaluation ""
34 ${TESSELLATION_EVALUATION_DECLARATIONS}
40 patch in S patchVariable[2]; // array of structures is illegal
41 out mediump float te_out;
44 te_out = patchVariable[0].a + patchVariable[1].b.y;
45 ${TESSELLATION_EVALUATION_OUTPUT}
50 precision mediump float;
51 ${FRAGMENT_DECLARATIONS}
52 in mediump float te_out;
55 ${FRAG_COLOR} = vec4(te_out);
60 case per_patch_structs_containing_arrays
62 desc "per-patch variable type is struct containing array"
63 expect compile_or_link_fail
64 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
67 ${VERTEX_DECLARATIONS}
73 tessellation_control ""
75 ${TESSELLATION_CONTROL_DECLARATIONS}
81 patch out S patchVariable; // output structure containing array is illegal
84 patchVariable.a = gl_in[0].gl_Position.x;
85 patchVariable.b[0] = gl_in[0].gl_Position.y;
86 patchVariable.b[1] = gl_in[0].gl_Position.w;
87 ${TESSELLATION_CONTROL_OUTPUT}
90 tessellation_evaluation ""
92 ${TESSELLATION_EVALUATION_DECLARATIONS}
98 patch in S patchVariable; // output structure containing array is illegal
99 out mediump float te_out;
102 te_out = patchVariable.a + patchVariable.b[1];
103 ${TESSELLATION_EVALUATION_OUTPUT}
108 precision mediump float;
109 ${FRAGMENT_DECLARATIONS}
110 in mediump float te_out;
113 ${FRAG_COLOR} = vec4(te_out);
118 case per_vertex_incorrect_control_explicit_output_array_size_1
120 desc "Incorrectly sized tessellation control output array"
121 expect compile_or_link_fail
122 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
125 ${VERTEX_DECLARATIONS}
131 tessellation_control ""
133 ${TESSELLATION_CONTROL_DECLARATIONS}
134 out highp float varyingArray[3]; // size is not equal to gl_MaxPatchVertices
137 varyingArray[gl_InvocationID] = gl_in[0].gl_Position[gl_InvocationID];
138 ${TESSELLATION_CONTROL_OUTPUT}
141 tessellation_evaluation ""
143 ${TESSELLATION_EVALUATION_DECLARATIONS}
144 in highp float varyingArray[gl_MaxPatchVertices]; // size is correct
145 out mediump float te_out;
148 te_out = varyingArray[0] * gl_TessCoord.x + varyingArray[1] * gl_TessCoord.y + varyingArray[2];
149 ${TESSELLATION_EVALUATION_OUTPUT}
154 precision mediump float;
155 ${FRAGMENT_DECLARATIONS}
156 in mediump float te_out;
159 ${FRAG_COLOR} = vec4(te_out);
164 case per_vertex_incorrect_control_explicit_output_array_size_2
166 desc "Incorrectly sized tessellation control output array"
167 expect compile_or_link_fail
168 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
171 ${VERTEX_DECLARATIONS}
177 tessellation_control ""
179 ${TESSELLATION_CONTROL_DECLARATIONS}
180 out highp float varyingArray[gl_MaxPatchVertices]; // size does not match layout declaration
183 varyingArray[gl_InvocationID] = gl_in[0].gl_Position[gl_InvocationID];
184 ${TESSELLATION_CONTROL_OUTPUT}
187 tessellation_evaluation ""
189 ${TESSELLATION_EVALUATION_DECLARATIONS}
190 in highp float varyingArray[gl_MaxPatchVertices]; // size is correct
191 out mediump float te_out;
194 te_out = varyingArray[0] * gl_TessCoord.x + varyingArray[1] * gl_TessCoord.y + varyingArray[2];
195 ${TESSELLATION_EVALUATION_OUTPUT}
200 precision mediump float;
201 ${FRAGMENT_DECLARATIONS}
202 in mediump float te_out;
205 ${FRAG_COLOR} = vec4(te_out);
210 case per_vertex_incorrect_control_explicit_output_array_size_3
212 desc "Incorrectly sized tessellation control output array"
213 expect compile_or_link_fail
214 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
217 ${VERTEX_DECLARATIONS}
223 tessellation_control ""
225 ${TESSELLATION_CONTROL_DECLARATIONS}
226 out highp float varyingArray[${GL_MAX_PATCH_VERTICES}]; // size does not match layout declaration
229 varyingArray[gl_InvocationID] = gl_in[0].gl_Position[gl_InvocationID];
230 ${TESSELLATION_CONTROL_OUTPUT}
233 tessellation_evaluation ""
235 ${TESSELLATION_EVALUATION_DECLARATIONS}
236 in highp float varyingArray[gl_MaxPatchVertices]; // size is correct
237 out mediump float te_out;
240 te_out = varyingArray[0] * gl_TessCoord.x + varyingArray[1] * gl_TessCoord.y + varyingArray[2];
241 ${TESSELLATION_EVALUATION_OUTPUT}
246 precision mediump float;
247 ${FRAGMENT_DECLARATIONS}
248 in mediump float te_out;
251 ${FRAG_COLOR} = vec4(te_out);
256 case per_vertex_incorrect_eval_explicit_input_array_size
258 desc "Incorrectly sized tessellation control output array"
259 expect compile_or_link_fail
260 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
263 ${VERTEX_DECLARATIONS}
269 tessellation_control ""
271 ${TESSELLATION_CONTROL_DECLARATIONS}
272 out highp float varyingArray[];
275 varyingArray[gl_InvocationID] = gl_in[0].gl_Position[gl_InvocationID];
276 ${TESSELLATION_CONTROL_OUTPUT}
279 tessellation_evaluation ""
281 ${TESSELLATION_EVALUATION_DECLARATIONS}
282 in highp float varyingArray[3]; // size is not equal to gl_MaxPatchVertices
283 out mediump float te_out;
286 te_out = varyingArray[0] * gl_TessCoord.x + varyingArray[1] * gl_TessCoord.y + varyingArray[2];
287 ${TESSELLATION_EVALUATION_OUTPUT}
292 precision mediump float;
293 ${FRAGMENT_DECLARATIONS}
294 in mediump float te_out;
297 ${FRAG_COLOR} = vec4(te_out);