1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Negative Vertex Array API tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es31fNegativeVertexArrayApiTests.hpp"
25 #include "gluCallLogWrapper.hpp"
26 #include "gluContextInfo.hpp"
27 #include "gluShaderProgram.hpp"
28 #include "glwDefs.hpp"
29 #include "glwEnums.hpp"
30 #include "tcuStringTemplate.hpp"
42 namespace NegativeTestShared
46 using glu::CallLogWrapper;
49 static const char* vertexShaderSource = "${GLSL_VERSION_STRING}\n"
52 " gl_Position = vec4(0.0);\n"
55 static const char* fragmentShaderSource = "${GLSL_VERSION_STRING}\n"
56 "layout(location = 0) out mediump vec4 fragColor;"
59 " fragColor = vec4(0.0);\n"
62 void vertex_attribf (NegativeTestContext& ctx)
64 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
65 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
66 ctx.glVertexAttrib1f(maxVertexAttribs, 0.0f);
67 ctx.expectError(GL_INVALID_VALUE);
68 ctx.glVertexAttrib2f(maxVertexAttribs, 0.0f, 0.0f);
69 ctx.expectError(GL_INVALID_VALUE);
70 ctx.glVertexAttrib3f(maxVertexAttribs, 0.0f, 0.0f, 0.0f);
71 ctx.expectError(GL_INVALID_VALUE);
72 ctx.glVertexAttrib4f(maxVertexAttribs, 0.0f, 0.0f, 0.0f, 0.0f);
73 ctx.expectError(GL_INVALID_VALUE);
77 void vertex_attribfv (NegativeTestContext& ctx)
79 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
80 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
82 ctx.glVertexAttrib1fv(maxVertexAttribs, &v[0]);
83 ctx.expectError(GL_INVALID_VALUE);
84 ctx.glVertexAttrib2fv(maxVertexAttribs, &v[0]);
85 ctx.expectError(GL_INVALID_VALUE);
86 ctx.glVertexAttrib3fv(maxVertexAttribs, &v[0]);
87 ctx.expectError(GL_INVALID_VALUE);
88 ctx.glVertexAttrib4fv(maxVertexAttribs, &v[0]);
89 ctx.expectError(GL_INVALID_VALUE);
93 void vertex_attribi4 (NegativeTestContext& ctx)
95 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
99 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
100 ctx.glVertexAttribI4i(maxVertexAttribs, valInt, valInt, valInt, valInt);
101 ctx.expectError(GL_INVALID_VALUE);
102 ctx.glVertexAttribI4ui(maxVertexAttribs, valUint, valUint, valUint, valUint);
103 ctx.expectError(GL_INVALID_VALUE);
107 void vertex_attribi4v (NegativeTestContext& ctx)
109 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
110 GLint valInt[4] = { 0 };
111 GLuint valUint[4] = { 0 };
113 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
114 ctx.glVertexAttribI4iv(maxVertexAttribs, &valInt[0]);
115 ctx.expectError(GL_INVALID_VALUE);
116 ctx.glVertexAttribI4uiv(maxVertexAttribs, &valUint[0]);
117 ctx.expectError(GL_INVALID_VALUE);
121 void vertex_attrib_pointer (NegativeTestContext& ctx)
123 ctx.beginSection("GL_INVALID_ENUM is generated if type is not an accepted value.");
124 ctx.glVertexAttribPointer(0, 1, 0, GL_TRUE, 0, 0);
125 ctx.expectError(GL_INVALID_ENUM);
128 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
129 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
130 ctx.glVertexAttribPointer(maxVertexAttribs, 1, GL_BYTE, GL_TRUE, 0, 0);
131 ctx.expectError(GL_INVALID_VALUE);
134 ctx.beginSection("GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4.");
135 ctx.glVertexAttribPointer(0, 0, GL_BYTE, GL_TRUE, 0, 0);
136 ctx.expectError(GL_INVALID_VALUE);
139 ctx.beginSection("GL_INVALID_VALUE is generated if stride is negative.");
140 ctx.glVertexAttribPointer(0, 1, GL_BYTE, GL_TRUE, -1, 0);
141 ctx.expectError(GL_INVALID_VALUE);
144 ctx.beginSection("GL_INVALID_OPERATION is generated if type is GL_INT_2_10_10_10_REV or GL_UNSIGNED_INT_2_10_10_10_REV and size is not 4.");
145 ctx.glVertexAttribPointer(0, 2, GL_INT_2_10_10_10_REV, GL_TRUE, 0, 0);
146 ctx.expectError(GL_INVALID_OPERATION);
147 ctx.glVertexAttribPointer(0, 2, GL_UNSIGNED_INT_2_10_10_10_REV, GL_TRUE, 0, 0);
148 ctx.expectError(GL_INVALID_OPERATION);
149 ctx.glVertexAttribPointer(0, 4, GL_INT_2_10_10_10_REV, GL_TRUE, 0, 0);
150 ctx.expectError(GL_NO_ERROR);
151 ctx.glVertexAttribPointer(0, 4, GL_UNSIGNED_INT_2_10_10_10_REV, GL_TRUE, 0, 0);
152 ctx.expectError(GL_NO_ERROR);
155 ctx.beginSection("GL_INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.");
158 ctx.glGenVertexArrays(1, &vao);
159 ctx.glBindVertexArray(vao);
160 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
161 ctx.expectError(GL_NO_ERROR);
163 ctx.glVertexAttribPointer(0, 1, GL_BYTE, GL_TRUE, 0, &offset);
164 ctx.expectError(GL_INVALID_OPERATION);
166 ctx.glBindVertexArray(0);
167 ctx.glDeleteVertexArrays(1, &vao);
168 ctx.expectError(GL_NO_ERROR);
172 void vertex_attrib_i_pointer (NegativeTestContext& ctx)
174 ctx.beginSection("GL_INVALID_ENUM is generated if type is not an accepted value.");
175 ctx.glVertexAttribIPointer(0, 1, 0, 0, 0);
176 ctx.expectError(GL_INVALID_ENUM);
177 ctx.glVertexAttribIPointer(0, 4, GL_INT_2_10_10_10_REV, 0, 0);
178 ctx.expectError(GL_INVALID_ENUM);
179 ctx.glVertexAttribIPointer(0, 4, GL_UNSIGNED_INT_2_10_10_10_REV, 0, 0);
180 ctx.expectError(GL_INVALID_ENUM);
183 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
184 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
185 ctx.glVertexAttribIPointer(maxVertexAttribs, 1, GL_BYTE, 0, 0);
186 ctx.expectError(GL_INVALID_VALUE);
189 ctx.beginSection("GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4.");
190 ctx.glVertexAttribIPointer(0, 0, GL_BYTE, 0, 0);
191 ctx.expectError(GL_INVALID_VALUE);
194 ctx.beginSection("GL_INVALID_VALUE is generated if stride is negative.");
195 ctx.glVertexAttribIPointer(0, 1, GL_BYTE, -1, 0);
196 ctx.expectError(GL_INVALID_VALUE);
199 ctx.beginSection("GL_INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.");
202 ctx.glGenVertexArrays(1, &vao);
203 ctx.glBindVertexArray(vao);
204 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
205 ctx.expectError(GL_NO_ERROR);
207 ctx.glVertexAttribIPointer(0, 1, GL_BYTE, 0, &offset);
208 ctx.expectError(GL_INVALID_OPERATION);
210 ctx.glBindVertexArray(0);
211 ctx.glDeleteVertexArrays(1, &vao);
212 ctx.expectError(GL_NO_ERROR);
216 void vertex_attrib_format (NegativeTestContext& ctx)
218 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
219 int maxVertexAttribRelativeOffset = ctx.getInteger(GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET);
222 ctx.beginSection("GL_INVALID_VALUE is generated if attribindex is greater than or equal to the value of MAX_VERTEX_ATTRIBS.");
223 ctx.glGenVertexArrays(1, &vao);
224 ctx.glBindVertexArray(vao);
225 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
226 ctx.glVertexAttribFormat(maxVertexAttribs, 4, GL_FLOAT, GL_FALSE, maxVertexAttribRelativeOffset);
227 ctx.expectError(GL_INVALID_VALUE);
230 ctx.beginSection("GL_INVALID_VALUE is generated if size is not one of 1, 2, 3, 4.");
231 ctx.glGenVertexArrays(1, &vao);
232 ctx.glBindVertexArray(vao);
233 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
234 ctx.glVertexAttribFormat(1, 0, GL_FLOAT, GL_FALSE, maxVertexAttribRelativeOffset);
235 ctx.expectError(GL_INVALID_VALUE);
238 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the parameter token names allowed.");
239 ctx.glGenVertexArrays(1, &vao);
240 ctx.glBindVertexArray(vao);
241 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
242 ctx.glVertexAttribFormat(1, 4, 1, GL_FALSE, 0);
243 ctx.expectError(GL_INVALID_ENUM);
246 ctx.beginSection("GL_INVALID_OPERATION is generated if type is not a token name allowed.");
247 ctx.glGenVertexArrays(1, &vao);
248 ctx.glBindVertexArray(0);
249 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
250 ctx.glVertexAttribFormat(1, 4, GL_FLOAT, GL_FALSE, 0);
251 ctx.expectError(GL_INVALID_OPERATION);
254 ctx.beginSection("GL_INVALID_OPERATION is generated if type is GL_INT_2_10_10_10_REV and size is not 4.");
255 ctx.glGenVertexArrays(1, &vao);
256 ctx.glBindVertexArray(vao);
257 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
258 ctx.glVertexAttribFormat(1, 3, GL_INT_2_10_10_10_REV, GL_FALSE, 0);
259 ctx.expectError(GL_INVALID_OPERATION);
262 ctx.beginSection("GL_INVALID_OPERATION is generated if type is GL_UNSIGNED_INT_2_10_10_10_REV and size is not 4.");
263 ctx.glGenVertexArrays(1, &vao);
264 ctx.glBindVertexArray(vao);
265 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
266 ctx.glVertexAttribFormat(1, 3, GL_UNSIGNED_INT_2_10_10_10_REV, GL_FALSE, 0);
267 ctx.expectError(GL_INVALID_OPERATION);
270 ctx.beginSection("GL_INVALID_VALUE is generated if relativeoffset is larger than the value of GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.");
271 ctx.glGenVertexArrays(1, &vao);
272 ctx.glBindVertexArray(vao);
273 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
274 ctx.glVertexAttribFormat(1, 4, GL_FLOAT, GL_FALSE, maxVertexAttribRelativeOffset + 1);
275 ctx.expectError(GL_INVALID_VALUE);
279 void vertex_attrib_i_format (NegativeTestContext& ctx)
281 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
282 int maxVertexAttribRelativeOffset = ctx.getInteger(GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET);
285 ctx.beginSection("GL_INVALID_VALUE is generated if attribindex is greater than or equal to the value of GL_MAX_VERTEX_ATTRIBS.");
286 ctx.glGenVertexArrays(1, &vao);
287 ctx.glBindVertexArray(vao);
288 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
289 ctx.glVertexAttribIFormat(maxVertexAttribs, 4, GL_INT, 0);
290 ctx.expectError(GL_INVALID_VALUE);
293 ctx.beginSection("GL_INVALID_VALUE is generated if size is not one the values 1, 2, 3, 4.");
294 ctx.glGenVertexArrays(1, &vao);
295 ctx.glBindVertexArray(vao);
296 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
297 ctx.glVertexAttribIFormat(1, 0, GL_INT, 0);
298 ctx.expectError(GL_INVALID_VALUE);
301 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the parameter token names allowed.");
302 ctx.glGenVertexArrays(1, &vao);
303 ctx.glBindVertexArray(vao);
304 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
305 ctx.glVertexAttribIFormat(1, 4, GL_FLOAT, 0);
306 ctx.expectError(GL_INVALID_ENUM);
309 ctx.beginSection("GL_INVALID_OPERATION is generated if type is not a token name allowed.");
310 ctx.glGenVertexArrays(1, &vao);
311 ctx.glBindVertexArray(0);
312 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
313 ctx.glVertexAttribIFormat(1, 4, GL_INT, 0);
314 ctx.expectError(GL_INVALID_OPERATION);
317 ctx.beginSection("GL_INVALID_VALUE is generated if relativeoffset is larger than the value of GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.");
318 ctx.glGenVertexArrays(1, &vao);
319 ctx.glBindVertexArray(vao);
320 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
321 ctx.glVertexAttribIFormat(1, 4, GL_INT, maxVertexAttribRelativeOffset + 1);
322 ctx.expectError(GL_INVALID_VALUE);
326 void enable_vertex_attrib_array (NegativeTestContext& ctx)
328 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
330 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
331 ctx.glEnableVertexAttribArray(maxVertexAttribs);
332 ctx.expectError(GL_INVALID_VALUE);
336 void disable_vertex_attrib_array (NegativeTestContext& ctx)
338 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
340 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
341 ctx.glDisableVertexAttribArray(maxVertexAttribs);
342 ctx.expectError(GL_INVALID_VALUE);
346 void gen_vertex_arrays (NegativeTestContext& ctx)
350 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
351 ctx.glGenVertexArrays(-1, &arrays);
352 ctx.expectError(GL_INVALID_VALUE);
356 void bind_vertex_array (NegativeTestContext& ctx)
358 ctx.beginSection("GL_INVALID_OPERATION is generated if array is not zero or the name of an existing vertex array object.");
359 ctx.glBindVertexArray(-1);
360 ctx.expectError(GL_INVALID_OPERATION);
364 void delete_vertex_arrays (NegativeTestContext& ctx)
366 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
367 ctx.glDeleteVertexArrays(-1, 0);
368 ctx.expectError(GL_INVALID_VALUE);
372 void vertex_attrib_divisor (NegativeTestContext& ctx)
374 int maxVertexAttribs = ctx.getInteger(GL_MAX_VERTEX_ATTRIBS);
376 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
377 ctx.glVertexAttribDivisor(maxVertexAttribs, 0);
378 ctx.expectError(GL_INVALID_VALUE);
382 void draw_arrays (NegativeTestContext& ctx)
384 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
386 map<string, string> args;
387 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
388 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
390 ctx.glUseProgram(program.getProgram());
391 ctx.expectError(GL_NO_ERROR);
393 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
394 ctx.glDrawArrays(-1, 0, 1);
395 ctx.expectError(GL_INVALID_ENUM);
398 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
399 ctx.glDrawArrays(GL_POINTS, 0, -1);
400 ctx.expectError(GL_INVALID_VALUE);
403 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
404 ctx.glGenFramebuffers(1, &fbo);
405 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
406 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
407 ctx.glDrawArrays(GL_POINTS, 0, 1);
408 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
409 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
410 ctx.glDeleteFramebuffers(1, &fbo);
416 void draw_arrays_invalid_program (NegativeTestContext& ctx)
421 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
422 ctx.glDrawArrays(-1, 0, 1);
423 ctx.expectError(GL_INVALID_ENUM);
426 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
427 ctx.glDrawArrays(GL_POINTS, 0, -1);
428 ctx.expectError(GL_INVALID_VALUE);
431 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
432 ctx.glGenFramebuffers(1, &fbo);
433 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
434 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
435 ctx.glDrawArrays(GL_POINTS, 0, 1);
436 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
437 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
438 ctx.glDeleteFramebuffers(1, &fbo);
442 void draw_arrays_incomplete_primitive (NegativeTestContext& ctx)
444 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
446 map<string, string> args;
447 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
448 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
450 ctx.glUseProgram(program.getProgram());
451 ctx.expectError(GL_NO_ERROR);
453 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
454 ctx.glDrawArrays(-1, 0, 1);
455 ctx.expectError(GL_INVALID_ENUM);
458 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
459 ctx.glDrawArrays(GL_TRIANGLES, 0, -1);
460 ctx.expectError(GL_INVALID_VALUE);
463 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
464 ctx.glGenFramebuffers(1, &fbo);
465 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
466 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
467 ctx.glDrawArrays(GL_TRIANGLES, 0, 1);
468 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
469 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
470 ctx.glDeleteFramebuffers(1, &fbo);
476 void draw_elements (NegativeTestContext& ctx)
478 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
483 map<string, string> args;
484 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
485 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
487 ctx.glUseProgram(program.getProgram());
488 ctx.expectError(GL_NO_ERROR);
490 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
491 ctx.glDrawElements(-1, 1, GL_UNSIGNED_BYTE, vertices);
492 ctx.expectError(GL_INVALID_ENUM);
495 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
496 ctx.glDrawElements(GL_POINTS, 1, -1, vertices);
497 ctx.expectError(GL_INVALID_ENUM);
498 ctx.glDrawElements(GL_POINTS, 1, GL_FLOAT, vertices);
499 ctx.expectError(GL_INVALID_ENUM);
502 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
503 ctx.glDrawElements(GL_POINTS, -1, GL_UNSIGNED_BYTE, vertices);
504 ctx.expectError(GL_INVALID_VALUE);
507 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
508 ctx.glGenFramebuffers(1, &fbo);
509 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
510 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
511 ctx.glDrawElements(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices);
512 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
513 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
514 ctx.glDeleteFramebuffers(1, &fbo);
517 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
519 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
520 const char* tfVarying = "gl_Position";
522 ctx.glGenBuffers(1, &buf);
523 ctx.glGenTransformFeedbacks(1, &tfID);
525 ctx.glUseProgram(program.getProgram());
526 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
527 ctx.glLinkProgram(program.getProgram());
528 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
529 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
530 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
531 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
532 ctx.glBeginTransformFeedback(GL_POINTS);
533 ctx.expectError(GL_NO_ERROR);
535 ctx.glDrawElements(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices);
536 ctx.expectError(GL_INVALID_OPERATION);
538 ctx.glPauseTransformFeedback();
539 ctx.glDrawElements(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices);
540 ctx.expectError(GL_NO_ERROR);
542 ctx.glEndTransformFeedback();
543 ctx.glDeleteBuffers(1, &buf);
544 ctx.glDeleteTransformFeedbacks(1, &tfID);
545 ctx.expectError(GL_NO_ERROR);
552 void draw_elements_invalid_program (NegativeTestContext& ctx)
558 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
559 ctx.glDrawElements(-1, 1, GL_UNSIGNED_BYTE, vertices);
560 ctx.expectError(GL_INVALID_ENUM);
563 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
564 ctx.glDrawElements(GL_POINTS, 1, -1, vertices);
565 ctx.expectError(GL_INVALID_ENUM);
566 ctx.glDrawElements(GL_POINTS, 1, GL_FLOAT, vertices);
567 ctx.expectError(GL_INVALID_ENUM);
570 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
571 ctx.glDrawElements(GL_POINTS, -1, GL_UNSIGNED_BYTE, vertices);
572 ctx.expectError(GL_INVALID_VALUE);
575 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
576 ctx.glGenFramebuffers(1, &fbo);
577 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
578 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
579 ctx.glDrawElements(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices);
580 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
581 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
582 ctx.glDeleteFramebuffers(1, &fbo);
586 void draw_elements_incomplete_primitive (NegativeTestContext& ctx)
588 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
593 map<string, string> args;
594 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
595 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
597 ctx.glUseProgram(program.getProgram());
598 ctx.expectError(GL_NO_ERROR);
600 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
601 ctx.glDrawElements(-1, 1, GL_UNSIGNED_BYTE, vertices);
602 ctx.expectError(GL_INVALID_ENUM);
605 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
606 ctx.glDrawElements(GL_TRIANGLES, 1, -1, vertices);
607 ctx.expectError(GL_INVALID_ENUM);
608 ctx.glDrawElements(GL_TRIANGLES, 1, GL_FLOAT, vertices);
609 ctx.expectError(GL_INVALID_ENUM);
612 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
613 ctx.glDrawElements(GL_TRIANGLES, -1, GL_UNSIGNED_BYTE, vertices);
614 ctx.expectError(GL_INVALID_VALUE);
617 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
618 ctx.glGenFramebuffers(1, &fbo);
619 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
620 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
621 ctx.glDrawElements(GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices);
622 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
623 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
624 ctx.glDeleteFramebuffers(1, &fbo);
627 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
629 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
630 const char* tfVarying= "gl_Position";
632 ctx.glGenBuffers(1, &buf);
633 ctx.glGenTransformFeedbacks(1, &tfID);
635 ctx.glUseProgram(program.getProgram());
636 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
637 ctx.glLinkProgram(program.getProgram());
638 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
639 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
640 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
641 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
642 ctx.glBeginTransformFeedback(GL_TRIANGLES);
643 ctx.expectError(GL_NO_ERROR);
645 ctx.glDrawElements(GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices);
646 ctx.expectError(GL_INVALID_OPERATION);
648 ctx.glPauseTransformFeedback();
649 ctx.glDrawElements(GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices);
650 ctx.expectError(GL_NO_ERROR);
652 ctx.glEndTransformFeedback();
653 ctx.glDeleteBuffers(1, &buf);
654 ctx.glDeleteTransformFeedbacks(1, &tfID);
655 ctx.expectError(GL_NO_ERROR);
662 void draw_elements_base_vertex (NegativeTestContext& ctx)
664 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
669 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
670 ctx.glDrawElementsBaseVertex(-1, 1, GL_UNSIGNED_INT, vertices, 1);
671 ctx.expectError(GL_INVALID_ENUM);
674 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
675 ctx.glDrawElementsBaseVertex(GL_POINTS, 1, -1, vertices, 1);
676 ctx.expectError(GL_INVALID_ENUM);
677 ctx.glDrawElementsBaseVertex(GL_POINTS, 1, GL_FLOAT, vertices, 1);
678 ctx.expectError(GL_INVALID_ENUM);
681 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
682 ctx.glDrawElementsBaseVertex(GL_POINTS, -1, GL_UNSIGNED_INT, vertices, 1);
683 ctx.expectError(GL_INVALID_VALUE);
686 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
687 ctx.glGenFramebuffers(1, &fbo);
688 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
689 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
690 ctx.glDrawElementsBaseVertex(GL_POINTS, 1, GL_UNSIGNED_INT, vertices, 1);
691 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
692 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
693 ctx.glDeleteFramebuffers(1, &fbo);
697 void draw_arrays_instanced (NegativeTestContext& ctx)
699 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
701 map<string, string> args;
702 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
703 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
705 ctx.glUseProgram(program.getProgram());
706 ctx.expectError(GL_NO_ERROR);
707 ctx.glVertexAttribDivisor(0, 1);
708 ctx.expectError(GL_NO_ERROR);
710 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
711 ctx.glDrawArraysInstanced(-1, 0, 1, 1);
712 ctx.expectError(GL_INVALID_ENUM);
715 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
716 ctx.glDrawArraysInstanced(GL_POINTS, 0, -1, 1);
717 ctx.expectError(GL_INVALID_VALUE);
718 ctx.glDrawArraysInstanced(GL_POINTS, 0, 1, -1);
719 ctx.expectError(GL_INVALID_VALUE);
722 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
723 ctx.glGenFramebuffers(1, &fbo);
724 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
725 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
726 ctx.glDrawArraysInstanced(GL_POINTS, 0, 1, 1);
727 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
728 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
729 ctx.glDeleteFramebuffers(1, &fbo);
735 void draw_arrays_instanced_invalid_program (NegativeTestContext& ctx)
739 ctx.glVertexAttribDivisor(0, 1);
740 ctx.expectError(GL_NO_ERROR);
742 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
743 ctx.glDrawArraysInstanced(-1, 0, 1, 1);
744 ctx.expectError(GL_INVALID_ENUM);
747 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
748 ctx.glDrawArraysInstanced(GL_POINTS, 0, -1, 1);
749 ctx.expectError(GL_INVALID_VALUE);
750 ctx.glDrawArraysInstanced(GL_POINTS, 0, 1, -1);
751 ctx.expectError(GL_INVALID_VALUE);
754 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
755 ctx.glGenFramebuffers(1, &fbo);
756 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
757 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
758 ctx.glDrawArraysInstanced(GL_POINTS, 0, 1, 1);
759 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
760 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
761 ctx.glDeleteFramebuffers(1, &fbo);
765 void draw_arrays_instanced_incomplete_primitive (NegativeTestContext& ctx)
767 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
769 map<string, string> args;
770 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
771 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
773 ctx.glVertexAttribDivisor(0, 1);
774 ctx.expectError(GL_NO_ERROR);
776 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
777 ctx.glDrawArraysInstanced(-1, 0, 1, 1);
778 ctx.expectError(GL_INVALID_ENUM);
781 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
782 ctx.glDrawArraysInstanced(GL_TRIANGLES, 0, -1, 1);
783 ctx.expectError(GL_INVALID_VALUE);
784 ctx.glDrawArraysInstanced(GL_TRIANGLES, 0, 1, -1);
785 ctx.expectError(GL_INVALID_VALUE);
788 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
789 ctx.glGenFramebuffers(1, &fbo);
790 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
791 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
792 ctx.glDrawArraysInstanced(GL_TRIANGLES, 0, 1, 1);
793 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
794 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
795 ctx.glDeleteFramebuffers(1, &fbo);
801 void draw_elements_instanced (NegativeTestContext& ctx)
803 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
808 map<string, string> args;
809 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
810 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
812 ctx.glUseProgram(program.getProgram());
813 ctx.glVertexAttribDivisor(0, 1);
814 ctx.expectError(GL_NO_ERROR);
816 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
817 ctx.glDrawElementsInstanced(-1, 1, GL_UNSIGNED_BYTE, vertices, 1);
818 ctx.expectError(GL_INVALID_ENUM);
821 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
822 ctx.glDrawElementsInstanced(GL_POINTS, 1, -1, vertices, 1);
823 ctx.expectError(GL_INVALID_ENUM);
824 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_FLOAT, vertices, 1);
825 ctx.expectError(GL_INVALID_ENUM);
828 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
829 ctx.glDrawElementsInstanced(GL_POINTS, -1, GL_UNSIGNED_BYTE, vertices, 1);
830 ctx.expectError(GL_INVALID_VALUE);
831 ctx.glDrawElementsInstanced(GL_POINTS, 11, GL_UNSIGNED_BYTE, vertices, -1);
832 ctx.expectError(GL_INVALID_VALUE);
835 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
836 ctx.glGenFramebuffers(1, &fbo);
837 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
838 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
839 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices, 1);
840 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
841 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
842 ctx.glDeleteFramebuffers(1, &fbo);
845 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
847 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
848 const char* tfVarying = "gl_Position";
850 ctx.glGenBuffers(1, &buf);
851 ctx.glGenTransformFeedbacks(1, &tfID);
853 ctx.glUseProgram(program.getProgram());
854 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
855 ctx.glLinkProgram(program.getProgram());
856 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
857 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
858 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
859 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
860 ctx.glBeginTransformFeedback(GL_POINTS);
861 ctx.expectError(GL_NO_ERROR);
863 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices, 1);
864 ctx.expectError(GL_INVALID_OPERATION);
866 ctx.glPauseTransformFeedback();
867 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices, 1);
868 ctx.expectError(GL_NO_ERROR);
870 ctx.glEndTransformFeedback();
871 ctx.glDeleteBuffers(1, &buf);
872 ctx.glDeleteTransformFeedbacks(1, &tfID);
873 ctx.expectError(GL_NO_ERROR);
880 void draw_elements_instanced_invalid_program (NegativeTestContext& ctx)
885 ctx.glVertexAttribDivisor(0, 1);
886 ctx.expectError(GL_NO_ERROR);
888 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
889 ctx.glDrawElementsInstanced(-1, 1, GL_UNSIGNED_BYTE, vertices, 1);
890 ctx.expectError(GL_INVALID_ENUM);
893 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
894 ctx.glDrawElementsInstanced(GL_POINTS, 1, -1, vertices, 1);
895 ctx.expectError(GL_INVALID_ENUM);
896 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_FLOAT, vertices, 1);
897 ctx.expectError(GL_INVALID_ENUM);
900 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
901 ctx.glDrawElementsInstanced(GL_POINTS, -1, GL_UNSIGNED_BYTE, vertices, 1);
902 ctx.expectError(GL_INVALID_VALUE);
903 ctx.glDrawElementsInstanced(GL_POINTS, 11, GL_UNSIGNED_BYTE, vertices, -1);
904 ctx.expectError(GL_INVALID_VALUE);
907 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
908 ctx.glGenFramebuffers(1, &fbo);
909 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
910 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
911 ctx.glDrawElementsInstanced(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices, 1);
912 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
913 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
914 ctx.glDeleteFramebuffers(1, &fbo);
918 void draw_elements_instanced_incomplete_primitive (NegativeTestContext& ctx)
920 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
925 map<string, string> args;
926 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
927 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
929 ctx.glUseProgram(program.getProgram());
930 ctx.glVertexAttribDivisor(0, 1);
931 ctx.expectError(GL_NO_ERROR);
933 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
934 ctx.glDrawElementsInstanced(-1, 1, GL_UNSIGNED_BYTE, vertices, 1);
935 ctx.expectError(GL_INVALID_ENUM);
938 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
939 ctx.glDrawElementsInstanced(GL_TRIANGLES, 1, -1, vertices, 1);
940 ctx.expectError(GL_INVALID_ENUM);
941 ctx.glDrawElementsInstanced(GL_TRIANGLES, 1, GL_FLOAT, vertices, 1);
942 ctx.expectError(GL_INVALID_ENUM);
945 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
946 ctx.glDrawElementsInstanced(GL_TRIANGLES, -1, GL_UNSIGNED_BYTE, vertices, 1);
947 ctx.expectError(GL_INVALID_VALUE);
948 ctx.glDrawElementsInstanced(GL_TRIANGLES, 11, GL_UNSIGNED_BYTE, vertices, -1);
949 ctx.expectError(GL_INVALID_VALUE);
952 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
953 ctx.glGenFramebuffers(1, &fbo);
954 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
955 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
956 ctx.glDrawElementsInstanced(GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices, 1);
957 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
958 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
959 ctx.glDeleteFramebuffers(1, &fbo);
962 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
964 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
965 const char* tfVarying= "gl_Position";
967 ctx.glGenBuffers(1, &buf);
968 ctx.glGenTransformFeedbacks(1, &tfID);
970 ctx.glUseProgram(program.getProgram());
971 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
972 ctx.glLinkProgram(program.getProgram());
973 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
974 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
975 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
976 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
977 ctx.glBeginTransformFeedback(GL_TRIANGLES);
978 ctx.expectError(GL_NO_ERROR);
980 ctx.glDrawElementsInstanced(GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices, 1);
981 ctx.expectError(GL_INVALID_OPERATION);
983 ctx.glPauseTransformFeedback();
984 ctx.glDrawElementsInstanced (GL_TRIANGLES, 1, GL_UNSIGNED_BYTE, vertices, 1);
985 ctx.expectError(GL_NO_ERROR);
987 ctx.glEndTransformFeedback();
988 ctx.glDeleteBuffers(1, &buf);
989 ctx.glDeleteTransformFeedbacks(1, &tfID);
990 ctx.expectError(GL_NO_ERROR);
997 void draw_elements_instanced_base_vertex (NegativeTestContext& ctx)
999 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
1001 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
1003 GLfloat vertices[1];
1004 map<string, string> args;
1005 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
1006 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
1008 ctx.glUseProgram(program.getProgram());
1009 ctx.glVertexAttribDivisor(0, 1);
1010 ctx.expectError(GL_NO_ERROR);
1012 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
1013 ctx.glDrawElementsInstancedBaseVertex(-1, 1, GL_UNSIGNED_BYTE, vertices, 1, 1);
1014 ctx.expectError(GL_INVALID_ENUM);
1017 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
1018 ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 1, -1, vertices, 1, 1);
1019 ctx.expectError(GL_INVALID_ENUM);
1020 ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 1, GL_FLOAT, vertices, 1, 1);
1021 ctx.expectError(GL_INVALID_ENUM);
1024 ctx.beginSection("GL_INVALID_VALUE is generated if count or primcount are negative.");
1025 ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, -1, GL_UNSIGNED_BYTE, vertices, 1, 1);
1026 ctx.expectError(GL_INVALID_VALUE);
1027 ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 11, GL_UNSIGNED_BYTE, vertices, -1, 1);
1028 ctx.expectError(GL_INVALID_VALUE);
1031 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
1032 ctx.glGenFramebuffers(1, &fbo);
1033 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1034 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
1035 ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 1, GL_UNSIGNED_BYTE, vertices, 1, 1);
1036 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
1037 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1038 ctx.glDeleteFramebuffers(1, &fbo);
1041 ctx.glUseProgram(0);
1044 void draw_range_elements (NegativeTestContext& ctx)
1046 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
1050 GLfloat vertices[1];
1051 map<string, string> args;
1052 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
1053 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
1055 ctx.glUseProgram(program.getProgram());
1056 ctx.expectError(GL_NO_ERROR);
1058 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
1059 ctx.glDrawRangeElements(-1, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1060 ctx.expectError(GL_INVALID_ENUM);
1063 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
1064 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, -1, vertices);
1065 ctx.expectError(GL_INVALID_ENUM);
1066 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_FLOAT, vertices);
1067 ctx.expectError(GL_INVALID_ENUM);
1070 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
1071 ctx.glDrawRangeElements(GL_POINTS, 0, 1, -1, GL_UNSIGNED_BYTE, vertices);
1072 ctx.expectError(GL_INVALID_VALUE);
1075 ctx.beginSection("GL_INVALID_VALUE is generated if end < start.");
1076 ctx.glDrawRangeElements(GL_POINTS, 1, 0, 1, GL_UNSIGNED_BYTE, vertices);
1077 ctx.expectError(GL_INVALID_VALUE);
1080 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
1081 ctx.glGenFramebuffers(1, &fbo);
1082 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1083 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
1084 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1085 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
1086 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1087 ctx.glDeleteFramebuffers(1, &fbo);
1090 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
1092 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
1093 const char* tfVarying= "gl_Position";
1095 ctx.glGenBuffers(1, &buf);
1096 ctx.glGenTransformFeedbacks(1, &tfID);
1098 ctx.glUseProgram(program.getProgram());
1099 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
1100 ctx.glLinkProgram(program.getProgram());
1101 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
1102 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
1103 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
1104 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
1105 ctx.glBeginTransformFeedback(GL_POINTS);
1106 ctx.expectError(GL_NO_ERROR);
1108 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1109 ctx.expectError(GL_INVALID_OPERATION);
1111 ctx.glPauseTransformFeedback();
1112 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1113 ctx.expectError(GL_NO_ERROR);
1115 ctx.glEndTransformFeedback();
1116 ctx.glDeleteBuffers(1, &buf);
1117 ctx.glDeleteTransformFeedbacks(1, &tfID);
1118 ctx.expectError(GL_NO_ERROR);
1122 ctx.glUseProgram(0);
1125 void draw_range_elements_invalid_program (NegativeTestContext& ctx)
1127 ctx.glUseProgram(0);
1129 GLfloat vertices[1];
1131 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
1132 ctx.glDrawRangeElements(-1, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1133 ctx.expectError(GL_INVALID_ENUM);
1136 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
1137 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, -1, vertices);
1138 ctx.expectError(GL_INVALID_ENUM);
1139 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_FLOAT, vertices);
1140 ctx.expectError(GL_INVALID_ENUM);
1143 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
1144 ctx.glDrawRangeElements(GL_POINTS, 0, 1, -1, GL_UNSIGNED_BYTE, vertices);
1145 ctx.expectError(GL_INVALID_VALUE);
1148 ctx.beginSection("GL_INVALID_VALUE is generated if end < start.");
1149 ctx.glDrawRangeElements(GL_POINTS, 1, 0, 1, GL_UNSIGNED_BYTE, vertices);
1150 ctx.expectError(GL_INVALID_VALUE);
1153 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
1154 ctx.glGenFramebuffers(1, &fbo);
1155 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1156 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
1157 ctx.glDrawRangeElements(GL_POINTS, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1158 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
1159 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1160 ctx.glDeleteFramebuffers(1, &fbo);
1164 void draw_range_elements_incomplete_primitive (NegativeTestContext& ctx)
1166 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
1170 GLfloat vertices[1];
1171 map<string, string> args;
1172 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
1173 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
1175 ctx.glUseProgram(program.getProgram());
1176 ctx.expectError(GL_NO_ERROR);
1178 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
1179 ctx.glDrawRangeElements(-1, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1180 ctx.expectError(GL_INVALID_ENUM);
1183 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
1184 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, 1, -1, vertices);
1185 ctx.expectError(GL_INVALID_ENUM);
1186 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, 1, GL_FLOAT, vertices);
1187 ctx.expectError(GL_INVALID_ENUM);
1190 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
1191 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, -1, GL_UNSIGNED_BYTE, vertices);
1192 ctx.expectError(GL_INVALID_VALUE);
1195 ctx.beginSection("GL_INVALID_VALUE is generated if end < start.");
1196 ctx.glDrawRangeElements(GL_TRIANGLES, 1, 0, 1, GL_UNSIGNED_BYTE, vertices);
1197 ctx.expectError(GL_INVALID_VALUE);
1200 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
1201 ctx.glGenFramebuffers(1, &fbo);
1202 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1203 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
1204 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1205 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
1206 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1207 ctx.glDeleteFramebuffers(1, &fbo);
1210 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader")) // GL_EXT_geometry_shader removes error
1212 ctx.beginSection("GL_INVALID_OPERATION is generated if transform feedback is active and not paused.");
1213 const char* tfVarying = "gl_Position";
1215 ctx.glGenBuffers(1, &buf);
1216 ctx.glGenTransformFeedbacks(1, &tfID);
1218 ctx.glUseProgram(program.getProgram());
1219 ctx.glTransformFeedbackVaryings(program.getProgram(), 1, &tfVarying, GL_INTERLEAVED_ATTRIBS);
1220 ctx.glLinkProgram(program.getProgram());
1221 ctx.glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tfID);
1222 ctx.glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, buf);
1223 ctx.glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 32, DE_NULL, GL_DYNAMIC_DRAW);
1224 ctx.glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buf);
1225 ctx.glBeginTransformFeedback(GL_TRIANGLES);
1226 ctx.expectError(GL_NO_ERROR);
1228 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1229 ctx.expectError(GL_INVALID_OPERATION);
1231 ctx.glPauseTransformFeedback();
1232 ctx.glDrawRangeElements(GL_TRIANGLES, 0, 1, 1, GL_UNSIGNED_BYTE, vertices);
1233 ctx.expectError(GL_NO_ERROR);
1235 ctx.glEndTransformFeedback();
1236 ctx.glDeleteBuffers(1, &buf);
1237 ctx.glDeleteTransformFeedbacks(1, &tfID);
1238 ctx.expectError(GL_NO_ERROR);
1242 ctx.glUseProgram(0);
1245 void draw_range_elements_base_vertex (NegativeTestContext& ctx)
1247 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
1249 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
1251 GLfloat vertices[1];
1252 map<string, string> args;
1253 args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
1254 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args)));
1256 ctx.glUseProgram(program.getProgram());
1257 ctx.expectError(GL_NO_ERROR);
1259 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
1260 ctx.glDrawRangeElementsBaseVertex(-1, 0, 1, 1, GL_UNSIGNED_BYTE, vertices, 1);
1261 ctx.expectError(GL_INVALID_ENUM);
1264 ctx.beginSection("GL_INVALID_ENUM is generated if type is not one of the accepted values.");
1265 ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, 1, -1, vertices, 1);
1266 ctx.expectError(GL_INVALID_ENUM);
1267 ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, 1, GL_FLOAT, vertices, 1);
1268 ctx.expectError(GL_INVALID_ENUM);
1271 ctx.beginSection("GL_INVALID_VALUE is generated if count is negative.");
1272 ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, -1, GL_UNSIGNED_BYTE, vertices, 1);
1273 ctx.expectError(GL_INVALID_VALUE);
1276 ctx.beginSection("GL_INVALID_VALUE is generated if end < start.");
1277 ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 1, 0, 1, GL_UNSIGNED_BYTE, vertices, 1);
1278 ctx.expectError(GL_INVALID_VALUE);
1281 ctx.beginSection("GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.");
1282 ctx.glGenFramebuffers(1, &fbo);
1283 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1284 ctx.glCheckFramebufferStatus(GL_FRAMEBUFFER);
1285 ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, 1, GL_UNSIGNED_BYTE, vertices, 1);
1286 ctx.expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
1287 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1288 ctx.glDeleteFramebuffers(1, &fbo);
1291 ctx.glUseProgram(0);
1294 std::vector<FunctionContainer> getNegativeVertexArrayApiTestFunctions ()
1296 FunctionContainer funcs[] =
1298 {vertex_attribf, "vertex_attribf", "Invalid glVertexAttrib{1234}f() usage" },
1299 {vertex_attribfv, "vertex_attribfv", "Invalid glVertexAttrib{1234}fv() usage" },
1300 {vertex_attribi4, "vertex_attribi4", "Invalid glVertexAttribI4{i|ui}f() usage" },
1301 {vertex_attribi4v, "vertex_attribi4v", "Invalid glVertexAttribI4{i|ui}fv() usage" },
1302 {vertex_attrib_pointer, "vertex_attrib_pointer", "Invalid glVertexAttribPointer() usage" },
1303 {vertex_attrib_i_pointer, "vertex_attrib_i_pointer", "Invalid glVertexAttribPointer() usage" },
1304 {vertex_attrib_format, "vertex_attrib_format", "Invalid glVertexAttribFormat() usage" },
1305 {vertex_attrib_i_format, "vertex_attrib_i_format", "Invalid glVertexAttribIFormat() usage" },
1306 {enable_vertex_attrib_array, "enable_vertex_attrib_array", "Invalid glEnableVertexAttribArray() usage" },
1307 {disable_vertex_attrib_array, "disable_vertex_attrib_array", "Invalid glDisableVertexAttribArray() usage" },
1308 {gen_vertex_arrays, "gen_vertex_arrays", "Invalid glGenVertexArrays() usage" },
1309 {bind_vertex_array, "bind_vertex_array", "Invalid glBindVertexArray() usage" },
1310 {delete_vertex_arrays, "delete_vertex_arrays", "Invalid glDeleteVertexArrays() usage" },
1311 {vertex_attrib_divisor, "vertex_attrib_divisor", "Invalid glVertexAttribDivisor() usage" },
1312 {draw_arrays, "draw_arrays", "Invalid glDrawArrays() usage" },
1313 {draw_arrays_invalid_program, "draw_arrays_invalid_program", "Invalid glDrawArrays() usage" },
1314 {draw_arrays_incomplete_primitive, "draw_arrays_incomplete_primitive", "Invalid glDrawArrays() usage" },
1315 {draw_elements, "draw_elements", "Invalid glDrawElements() usage" },
1316 {draw_elements_base_vertex, "draw_elements_base_vertex", "Invalid glDrawElementsBaseVertex() usage" },
1317 {draw_elements_invalid_program, "draw_elements_invalid_program", "Invalid glDrawElements() usage" },
1318 {draw_elements_incomplete_primitive, "draw_elements_incomplete_primitive", "Invalid glDrawElements() usage" },
1319 {draw_arrays_instanced, "draw_arrays_instanced", "Invalid glDrawArraysInstanced() usage" },
1320 {draw_arrays_instanced_invalid_program, "draw_arrays_instanced_invalid_program", "Invalid glDrawArraysInstanced() usage" },
1321 {draw_arrays_instanced_incomplete_primitive, "draw_arrays_instanced_incomplete_primitive", "Invalid glDrawArraysInstanced() usage" },
1322 {draw_elements_instanced, "draw_elements_instanced", "Invalid glDrawElementsInstanced() usage" },
1323 {draw_elements_instanced_invalid_program, "draw_elements_instanced_invalid_program", "Invalid glDrawElementsInstanced() usage" },
1324 {draw_elements_instanced_incomplete_primitive, "draw_elements_instanced_incomplete_primitive", "Invalid glDrawElementsInstanced() usage" },
1325 {draw_elements_instanced_base_vertex, "draw_elements_instanced_base_vertex", "Invalid glDrawElementsInstancedBaseVertex() usage" },
1326 {draw_range_elements, "draw_range_elements", "Invalid glDrawRangeElements() usage" },
1327 {draw_range_elements_invalid_program, "draw_range_elements_invalid_program", "Invalid glDrawRangeElements() usage" },
1328 {draw_range_elements_incomplete_primitive, "draw_range_elements_incomplete_primitive", "Invalid glDrawRangeElements() usage" },
1329 {draw_range_elements_base_vertex, "draw_range_elements_base_vertex", "Invalid glDrawRangeElementsBaseVertex() usage" },
1332 return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
1335 } // NegativeTestShared