1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 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 GL State API tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es31fNegativeStateApiTests.hpp"
26 #include "gluCallLogWrapper.hpp"
27 #include "gluContextInfo.hpp"
28 #include "gluShaderProgram.hpp"
30 #include "glwDefs.hpp"
31 #include "glwEnums.hpp"
33 #include "tcuStringTemplate.hpp"
46 namespace NegativeTestShared
50 using glu::CallLogWrapper;
53 static const char* uniformTestVertSource = "${GLSL_VERSION_DECL}\n"
54 "uniform mediump vec4 vUnif_vec4;\n"
55 "in mediump vec4 attr;"
56 "layout(shared) uniform Block { mediump vec4 blockVar; };\n"
59 " gl_Position = vUnif_vec4 + blockVar + attr;\n"
62 static const char* uniformTestFragSource = "${GLSL_VERSION_DECL}\n"
63 "uniform mediump ivec4 fUnif_ivec4;\n"
64 "uniform mediump uvec4 fUnif_uvec4;\n"
65 "layout(location = 0) out mediump vec4 fragColor;"
68 " fragColor = vec4(vec4(fUnif_ivec4) + vec4(fUnif_uvec4));\n"
71 static std::string getVtxFragVersionSources (const std::string source, NegativeTestContext& ctx)
73 const bool supportsES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
75 std::map<std::string, std::string> args;
77 args["GLSL_VERSION_DECL"] = supportsES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_300_ES);
79 return tcu::StringTemplate(source).specialize(args);
82 // Enabling & disabling states
83 void enable (NegativeTestContext& ctx)
85 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
87 ctx.expectError(GL_INVALID_ENUM);
91 // Enabling & disabling states
92 void enablei (NegativeTestContext& ctx)
94 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
96 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
97 ctx.glEnablei(-1, -1);
98 ctx.expectError(GL_INVALID_ENUM);
101 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of indexed capabilities for cap.");
102 ctx.glEnablei(GL_BLEND, -1);
103 ctx.expectError(GL_INVALID_VALUE);
107 void disable (NegativeTestContext& ctx)
109 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
111 ctx.expectError(GL_INVALID_ENUM);
115 void disablei (NegativeTestContext& ctx)
117 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
119 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
120 ctx.glDisablei(-1,-1);
121 ctx.expectError(GL_INVALID_ENUM);
124 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of indexed capabilities for cap.");
125 ctx.glDisablei(GL_BLEND, -1);
126 ctx.expectError(GL_INVALID_VALUE);
130 // Simple state queries
131 void get_booleanv (NegativeTestContext& ctx)
133 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
134 GLboolean params = GL_FALSE;
135 ctx.glGetBooleanv(-1, ¶ms);
136 ctx.expectError(GL_INVALID_ENUM);
140 void get_booleani_v (NegativeTestContext& ctx)
143 GLint maxUniformBufferBindings = 0;
145 ctx.beginSection("GL_INVALID_ENUM is generated if target is not indexed state queriable with these commands.");
146 ctx.glGetBooleani_v(-1, 0, &data);
147 ctx.expectError(GL_INVALID_ENUM);
150 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
151 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
152 ctx.expectError(GL_NO_ERROR);
153 ctx.glGetBooleani_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data);
154 ctx.expectError(GL_INVALID_VALUE);
158 void get_floatv (NegativeTestContext& ctx)
160 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
161 GLfloat params = 0.0f;
162 ctx.glGetFloatv(-1, ¶ms);
163 ctx.expectError(GL_INVALID_ENUM);
167 void get_integerv (NegativeTestContext& ctx)
170 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
171 ctx.glGetIntegerv(-1, ¶ms);
172 ctx.expectError(GL_INVALID_ENUM);
176 void get_integer64v (NegativeTestContext& ctx)
179 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
180 ctx.glGetInteger64v(-1, ¶ms);
181 ctx.expectError(GL_INVALID_ENUM);
185 void get_integeri_v (NegativeTestContext& ctx)
188 GLint maxUniformBufferBindings = 0;
189 GLint maxShaderStorageBufferBindings = 0;
191 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
192 ctx.glGetIntegeri_v(-1, 0, &data);
193 ctx.expectError(GL_INVALID_ENUM);
196 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
197 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
198 ctx.expectError(GL_NO_ERROR);
199 ctx.glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data);
200 ctx.expectError(GL_INVALID_VALUE);
203 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
204 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings);
205 ctx.expectError(GL_NO_ERROR);
206 ctx.glGetIntegeri_v(GL_SHADER_STORAGE_BUFFER_BINDING, maxShaderStorageBufferBindings, &data);
207 ctx.expectError(GL_INVALID_VALUE);
211 void get_integer64i_v (NegativeTestContext& ctx)
213 GLint64 data = (GLint64)-1;
214 GLint maxUniformBufferBindings = 0;
215 GLint maxShaderStorageBufferBindings = 0;
217 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
218 ctx.glGetInteger64i_v(-1, 0, &data);
219 ctx.expectError(GL_INVALID_ENUM);
222 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
223 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
224 ctx.expectError(GL_NO_ERROR);
225 ctx.glGetInteger64i_v(GL_UNIFORM_BUFFER_START, maxUniformBufferBindings, &data);
226 ctx.expectError(GL_INVALID_VALUE);
229 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
230 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings);
231 ctx.expectError(GL_NO_ERROR);
232 ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_START, maxShaderStorageBufferBindings, &data);
233 ctx.expectError(GL_INVALID_VALUE);
234 ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_SIZE, maxShaderStorageBufferBindings, &data);
235 ctx.expectError(GL_INVALID_VALUE);
239 void get_string (NegativeTestContext& ctx)
241 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
243 ctx.expectError(GL_INVALID_ENUM);
247 void get_stringi (NegativeTestContext& ctx)
249 GLint numExtensions = 0;
251 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
252 ctx.glGetStringi(-1, 0);
253 ctx.expectError(GL_INVALID_ENUM);
256 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for indexed state name.");
257 ctx.glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
258 ctx.glGetStringi(GL_EXTENSIONS, numExtensions);
259 ctx.expectError(GL_INVALID_VALUE);
263 // Enumerated state queries: Shaders
265 void get_attached_shaders (NegativeTestContext& ctx)
267 GLuint shaders[1] = { 0 };
268 GLuint shaderObject = ctx.glCreateShader(GL_VERTEX_SHADER);
269 GLuint program = ctx.glCreateProgram();
270 GLsizei count[1] = { 0 };
272 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
273 ctx.glGetAttachedShaders(-1, 1, &count[0], &shaders[0]);
274 ctx.expectError(GL_INVALID_VALUE);
277 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
278 ctx.glGetAttachedShaders(shaderObject, 1, &count[0], &shaders[0]);
279 ctx.expectError(GL_INVALID_OPERATION);
282 ctx.beginSection("GL_INVALID_VALUE is generated if maxCount is less than 0.");
283 ctx.glGetAttachedShaders(program, -1, &count[0], &shaders[0]);
284 ctx.expectError(GL_INVALID_VALUE);
287 ctx.glDeleteShader(shaderObject);
288 ctx.glDeleteProgram(program);
291 void get_shaderiv (NegativeTestContext& ctx)
293 GLboolean shaderCompilerSupported;
294 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
295 GLuint program = ctx.glCreateProgram();
296 GLint param[1] = { -1 };
298 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported);
299 ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_TRUE" : "GL_FALSE") << TestLog::EndMessage;
301 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
302 ctx.glGetShaderiv(shader, -1, ¶m[0]);
303 ctx.expectError(GL_INVALID_ENUM);
306 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
307 ctx.glGetShaderiv(-1, GL_SHADER_TYPE, ¶m[0]);
308 ctx.expectError(GL_INVALID_VALUE);
311 ctx.beginSection("GL_INVALID_OPERATION is generated if shader does not refer to a shader object.");
312 ctx.glGetShaderiv(program, GL_SHADER_TYPE, ¶m[0]);
313 ctx.expectError(GL_INVALID_OPERATION);
316 ctx.glDeleteShader(shader);
317 ctx.glDeleteProgram(program);
320 void get_shader_info_log (NegativeTestContext& ctx)
322 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
323 GLuint program = ctx.glCreateProgram();
324 GLsizei length[1] = { -1 };
325 char infoLog[128] = { 0 };
327 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
328 ctx.glGetShaderInfoLog(-1, 128, &length[0], &infoLog[0]);
329 ctx.expectError(GL_INVALID_VALUE);
332 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object.");
333 ctx.glGetShaderInfoLog(program, 128, &length[0], &infoLog[0]);
334 ctx.expectError(GL_INVALID_OPERATION);
337 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0.");
338 ctx.glGetShaderInfoLog(shader, -1, &length[0], &infoLog[0]);
339 ctx.expectError(GL_INVALID_VALUE);
342 ctx.glDeleteShader(shader);
343 ctx.glDeleteProgram(program);
346 void get_shader_precision_format (NegativeTestContext& ctx)
348 GLboolean shaderCompilerSupported;
352 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported);
353 ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_TRUE" : "GL_FALSE") << TestLog::EndMessage;
355 deMemset(&range[0], 0xcd, sizeof(range));
356 deMemset(&precision[0], 0xcd, sizeof(precision));
358 ctx.beginSection("GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted value.");
359 ctx.glGetShaderPrecisionFormat (-1, GL_MEDIUM_FLOAT, &range[0], &precision[0]);
360 ctx.expectError(GL_INVALID_ENUM);
361 ctx.glGetShaderPrecisionFormat (GL_VERTEX_SHADER, -1, &range[0], &precision[0]);
362 ctx.expectError(GL_INVALID_ENUM);
363 ctx.glGetShaderPrecisionFormat (-1, -1, &range[0], &precision[0]);
364 ctx.expectError(GL_INVALID_ENUM);
368 void get_shader_source (NegativeTestContext& ctx)
370 GLsizei length[1] = { 0 };
371 char source[1] = { 0 };
372 GLuint program = ctx.glCreateProgram();
373 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
375 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
376 ctx.glGetShaderSource(-1, 1, &length[0], &source[0]);
377 ctx.expectError(GL_INVALID_VALUE);
380 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object.");
381 ctx.glGetShaderSource(program, 1, &length[0], &source[0]);
382 ctx.expectError(GL_INVALID_OPERATION);
385 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
386 ctx.glGetShaderSource(shader, -1, &length[0], &source[0]);
387 ctx.expectError(GL_INVALID_VALUE);
390 ctx.glDeleteProgram(program);
391 ctx.glDeleteShader(shader);
394 // Enumerated state queries: Programs
396 void get_programiv (NegativeTestContext& ctx)
398 GLuint program = ctx.glCreateProgram();
399 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
400 GLint params[1] = { 0 };
402 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
403 ctx.glGetProgramiv(program, -1, ¶ms[0]);
404 ctx.expectError(GL_INVALID_ENUM);
407 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
408 ctx.glGetProgramiv(-1, GL_LINK_STATUS, ¶ms[0]);
409 ctx.expectError(GL_INVALID_VALUE);
412 ctx.beginSection("GL_INVALID_OPERATION is generated if program does not refer to a program object.");
413 ctx.glGetProgramiv(shader, GL_LINK_STATUS, ¶ms[0]);
414 ctx.expectError(GL_INVALID_OPERATION);
417 ctx.glDeleteProgram(program);
418 ctx.glDeleteShader(shader);
421 void get_program_info_log (NegativeTestContext& ctx)
423 GLuint program = ctx.glCreateProgram();
424 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
425 GLsizei length[1] = { 0 };
426 char infoLog[1] = { 'x' };
428 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
429 ctx.glGetProgramInfoLog (-1, 1, &length[0], &infoLog[0]);
430 ctx.expectError(GL_INVALID_VALUE);
433 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
434 ctx.glGetProgramInfoLog (shader, 1, &length[0], &infoLog[0]);
435 ctx.expectError(GL_INVALID_OPERATION);
438 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0.");
439 ctx.glGetProgramInfoLog (program, -1, &length[0], &infoLog[0]);
440 ctx.expectError(GL_INVALID_VALUE);
443 ctx.glDeleteProgram(program);
444 ctx.glDeleteShader(shader);
447 // Enumerated state queries: Shader variables
449 void get_tex_parameterfv (NegativeTestContext& ctx)
451 GLfloat params[1] = { 0 };
453 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
454 ctx.glGetTexParameterfv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
455 ctx.expectError(GL_INVALID_ENUM);
456 ctx.glGetTexParameterfv (GL_TEXTURE_2D, -1, ¶ms[0]);
457 ctx.expectError(GL_INVALID_ENUM);
458 ctx.glGetTexParameterfv (-1, -1, ¶ms[0]);
459 ctx.expectError(GL_INVALID_ENUM);
463 void get_tex_parameteriv (NegativeTestContext& ctx)
465 GLint params[1] = { 0 };
467 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
468 ctx.glGetTexParameteriv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
469 ctx.expectError(GL_INVALID_ENUM);
470 ctx.glGetTexParameteriv (GL_TEXTURE_2D, -1, ¶ms[0]);
471 ctx.expectError(GL_INVALID_ENUM);
472 ctx.glGetTexParameteriv (-1, -1, ¶ms[0]);
473 ctx.expectError(GL_INVALID_ENUM);
477 void get_tex_parameteriiv (NegativeTestContext& ctx)
479 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
481 GLint params[1] = { 0 };
483 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
484 ctx.glGetTexParameterIiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
485 ctx.expectError(GL_INVALID_ENUM);
486 ctx.glGetTexParameterIiv(GL_TEXTURE_2D, -1, ¶ms[0]);
487 ctx.expectError(GL_INVALID_ENUM);
488 ctx.glGetTexParameterIiv(-1, -1, ¶ms[0]);
489 ctx.expectError(GL_INVALID_ENUM);
493 void get_tex_parameteriuiv (NegativeTestContext& ctx)
495 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
497 GLuint params[1] = { 0 };
499 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
500 ctx.glGetTexParameterIuiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
501 ctx.expectError(GL_INVALID_ENUM);
502 ctx.glGetTexParameterIuiv(GL_TEXTURE_2D, -1, ¶ms[0]);
503 ctx.expectError(GL_INVALID_ENUM);
504 ctx.glGetTexParameterIuiv(-1, -1, ¶ms[0]);
505 ctx.expectError(GL_INVALID_ENUM);
509 void get_uniformfv (NegativeTestContext& ctx)
511 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
512 GLfloat params[4] = { 0.f };
517 ctx.glUseProgram(program.getProgram());
519 unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4"); // vec4
521 ctx.fail("Failed to retrieve uniform location");
523 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
524 programEmpty = ctx.glCreateProgram();
526 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
527 ctx.glGetUniformfv (-1, unif, ¶ms[0]);
528 ctx.expectError(GL_INVALID_VALUE);
531 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
532 ctx.glGetUniformfv (shader, unif, ¶ms[0]);
533 ctx.expectError(GL_INVALID_OPERATION);
536 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
537 ctx.glGetUniformfv (programEmpty, unif, ¶ms[0]);
538 ctx.expectError(GL_INVALID_OPERATION);
541 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
542 ctx.glGetUniformfv (program.getProgram(), -1, ¶ms[0]);
543 ctx.expectError(GL_INVALID_OPERATION);
546 ctx.glDeleteShader(shader);
547 ctx.glDeleteProgram(programEmpty);
550 void get_nuniformfv (NegativeTestContext& ctx)
552 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
554 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
555 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4");
556 GLfloat params[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
561 ctx.glUseProgram(program.getProgram());
564 ctx.fail("Failed to retrieve uniform location");
566 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
567 programEmpty = ctx.glCreateProgram();
569 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
571 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
572 ctx.glGetnUniformfv(-1, unif, bufferSize, ¶ms[0]);
573 ctx.expectError(GL_INVALID_VALUE);
576 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
577 ctx.glGetnUniformfv(shader, unif, bufferSize, ¶ms[0]);
578 ctx.expectError(GL_INVALID_OPERATION);
581 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
582 ctx.glGetnUniformfv(programEmpty, unif, bufferSize, ¶ms[0]);
583 ctx.expectError(GL_INVALID_OPERATION);
586 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
587 ctx.glGetnUniformfv(program.getProgram(), -1, bufferSize, ¶ms[0]);
588 ctx.expectError(GL_INVALID_OPERATION);
591 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
592 ctx.glGetnUniformfv(program.getProgram(), unif, 0, ¶ms[0]);
593 ctx.expectError(GL_INVALID_OPERATION);
596 ctx.glDeleteShader(shader);
597 ctx.glDeleteProgram(programEmpty);
600 void get_uniformiv (NegativeTestContext& ctx)
602 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
603 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
604 GLint params[4] = { 0, 0, 0, 0 };
608 ctx.glUseProgram(program.getProgram());
611 ctx.fail("Failed to retrieve uniform location");
613 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
614 programEmpty = ctx.glCreateProgram();
616 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
617 ctx.glGetUniformiv (-1, unif, ¶ms[0]);
618 ctx.expectError(GL_INVALID_VALUE);
621 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
622 ctx.glGetUniformiv (shader, unif, ¶ms[0]);
623 ctx.expectError(GL_INVALID_OPERATION);
626 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
627 ctx.glGetUniformiv (programEmpty, unif, ¶ms[0]);
628 ctx.expectError(GL_INVALID_OPERATION);
631 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
632 ctx.glGetUniformiv (program.getProgram(), -1, ¶ms[0]);
633 ctx.expectError(GL_INVALID_OPERATION);
636 ctx.glDeleteShader(shader);
637 ctx.glDeleteProgram(programEmpty);
640 void get_nuniformiv (NegativeTestContext& ctx)
642 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
644 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
645 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
646 GLint params[4] = { 0, 0, 0, 0 };
651 ctx.glUseProgram(program.getProgram());
654 ctx.fail("Failed to retrieve uniform location");
656 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
657 programEmpty = ctx.glCreateProgram();
659 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
661 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
662 ctx.glGetnUniformiv(-1, unif, bufferSize, ¶ms[0]);
663 ctx.expectError(GL_INVALID_VALUE);
666 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
667 ctx.glGetnUniformiv(shader, unif, bufferSize, ¶ms[0]);
668 ctx.expectError(GL_INVALID_OPERATION);
671 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
672 ctx.glGetnUniformiv(programEmpty, unif, bufferSize, ¶ms[0]);
673 ctx.expectError(GL_INVALID_OPERATION);
676 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
677 ctx.glGetnUniformiv(program.getProgram(), -1, bufferSize, ¶ms[0]);
678 ctx.expectError(GL_INVALID_OPERATION);
681 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
682 ctx.glGetnUniformiv(program.getProgram(), unif, - 1, ¶ms[0]);
683 ctx.expectError(GL_INVALID_OPERATION);
686 ctx.glDeleteShader(shader);
687 ctx.glDeleteProgram(programEmpty);
690 void get_uniformuiv (NegativeTestContext& ctx)
692 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
693 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_uvec4");
694 GLuint params[4] = { 0, 0, 0, 0 };
698 ctx.glUseProgram(program.getProgram());
701 ctx.fail("Failed to retrieve uniform location");
703 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
704 programEmpty = ctx.glCreateProgram();
706 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
707 ctx.glGetUniformuiv (-1, unif, ¶ms[0]);
708 ctx.expectError(GL_INVALID_VALUE);
711 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
712 ctx.glGetUniformuiv (shader, unif, ¶ms[0]);
713 ctx.expectError(GL_INVALID_OPERATION);
716 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
717 ctx.glGetUniformuiv (programEmpty, unif, ¶ms[0]);
718 ctx.expectError(GL_INVALID_OPERATION);
721 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
722 ctx.glGetUniformuiv (program.getProgram(), -1, ¶ms[0]);
723 ctx.expectError(GL_INVALID_OPERATION);
726 ctx.glDeleteShader(shader);
727 ctx.glDeleteProgram(programEmpty);
730 void get_nuniformuiv (NegativeTestContext& ctx)
732 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
734 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
735 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
736 GLuint params[4] = { 0, 0, 0, 0 };
741 ctx.glUseProgram(program.getProgram());
744 ctx.fail("Failed to retrieve uniform location");
746 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
747 programEmpty = ctx.glCreateProgram();
749 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
751 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
752 ctx.glGetnUniformuiv(-1, unif, bufferSize, ¶ms[0]);
753 ctx.expectError(GL_INVALID_VALUE);
756 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
757 ctx.glGetnUniformuiv(shader, unif, bufferSize, ¶ms[0]);
758 ctx.expectError(GL_INVALID_OPERATION);
761 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
762 ctx.glGetnUniformuiv(programEmpty, unif, bufferSize, ¶ms[0]);
763 ctx.expectError(GL_INVALID_OPERATION);
766 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
767 ctx.glGetnUniformuiv(program.getProgram(), -1, bufferSize, ¶ms[0]);
768 ctx.expectError(GL_INVALID_OPERATION);
771 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
772 ctx.glGetnUniformuiv(program.getProgram(), unif, -1, ¶ms[0]);
773 ctx.expectError(GL_INVALID_OPERATION);
776 ctx.glDeleteShader(shader);
777 ctx.glDeleteProgram(programEmpty);
780 void get_active_uniform (NegativeTestContext& ctx)
782 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
783 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
784 GLint numActiveUniforms = -1;
786 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms);
787 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected 4)." << TestLog::EndMessage;
789 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
790 ctx.glGetActiveUniform(-1, 0, 0, 0, 0, 0, 0);
791 ctx.expectError(GL_INVALID_VALUE);
794 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
795 ctx.glGetActiveUniform(shader, 0, 0, 0, 0, 0, 0);
796 ctx.expectError(GL_INVALID_OPERATION);
799 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of active uniform variables in program.");
800 ctx.glUseProgram(program.getProgram());
801 ctx.glGetActiveUniform(program.getProgram(), numActiveUniforms, 0, 0, 0, 0, 0);
802 ctx.expectError(GL_INVALID_VALUE);
805 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
806 ctx.glGetActiveUniform(program.getProgram(), 0, -1, 0, 0, 0, 0);
807 ctx.expectError(GL_INVALID_VALUE);
811 ctx.glDeleteShader(shader);
814 void get_active_uniformsiv (NegativeTestContext& ctx)
816 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
817 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
818 GLuint dummyUniformIndex = 1;
819 GLint dummyParamDst = -1;
820 GLint numActiveUniforms = -1;
822 ctx.glUseProgram(program.getProgram());
824 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms);
825 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected 4)." << TestLog::EndMessage;
827 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
828 ctx.glGetActiveUniformsiv(-1, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst);
829 ctx.expectError(GL_INVALID_VALUE);
832 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
833 ctx.glGetActiveUniformsiv(shader, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst);
834 ctx.expectError(GL_INVALID_OPERATION);
837 ctx.beginSection("GL_INVALID_VALUE is generated if any value in uniformIndices is greater than or equal to the value of GL_ACTIVE_UNIFORMS for program.");
838 for (int excess = 0; excess <= 2; excess++)
840 std::vector<GLuint> invalidUniformIndices;
841 invalidUniformIndices.push_back(1);
842 invalidUniformIndices.push_back(numActiveUniforms-1+excess);
843 invalidUniformIndices.push_back(1);
845 std::vector<GLint> dummyParamsDst(invalidUniformIndices.size());
846 ctx.glGetActiveUniformsiv(program.getProgram(), (GLsizei)invalidUniformIndices.size(), &invalidUniformIndices[0], GL_UNIFORM_TYPE, &dummyParamsDst[0]);
847 ctx.expectError(excess == 0 ? GL_NO_ERROR : GL_INVALID_VALUE);
851 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted token.");
852 ctx.glGetActiveUniformsiv(program.getProgram(), 1, &dummyUniformIndex, -1, &dummyParamDst);
853 ctx.expectError(GL_INVALID_ENUM);
857 ctx.glDeleteShader(shader);
860 void get_active_uniform_blockiv (NegativeTestContext& ctx)
862 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
863 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
865 GLint numActiveBlocks = -1;
867 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
868 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expected 1)." << TestLog::EndMessage;
869 ctx.expectError(GL_NO_ERROR);
871 ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or shader object.");
872 ctx.glGetActiveUniformBlockiv(-1, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms);
873 ctx.expectError(GL_INVALID_VALUE);
876 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object");
877 ctx.glGetActiveUniformBlockiv(shader, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms);
878 ctx.expectError(GL_INVALID_OPERATION);
881 ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of GL_ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.");
882 ctx.glUseProgram(program.getProgram());
883 ctx.expectError(GL_NO_ERROR);
884 ctx.glGetActiveUniformBlockiv(program.getProgram(), numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, ¶ms);
885 ctx.expectError(GL_INVALID_VALUE);
888 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
889 ctx.glGetActiveUniformBlockiv(program.getProgram(), 0, -1, ¶ms);
890 ctx.expectError(GL_INVALID_ENUM);
896 void get_active_uniform_block_name (NegativeTestContext& ctx)
898 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
899 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
901 GLint numActiveBlocks = -1;
902 GLchar uniformBlockName[128];
904 deMemset(&uniformBlockName[0], 0, sizeof(uniformBlockName));
906 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
907 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expected 1)." << TestLog::EndMessage;
908 ctx.expectError(GL_NO_ERROR);
910 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object.");
911 ctx.glGetActiveUniformBlockName(shader, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &uniformBlockName[0]);
912 ctx.expectError(GL_INVALID_OPERATION);
915 ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or shader object.");
916 ctx.glGetActiveUniformBlockName(-1, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &uniformBlockName[0]);
917 ctx.expectError(GL_INVALID_VALUE);
920 ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of GL_ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.");
921 ctx.glUseProgram(program.getProgram());
922 ctx.expectError(GL_NO_ERROR);
923 ctx.glGetActiveUniformBlockName(program.getProgram(), numActiveBlocks, (int)sizeof(uniformBlockName), &length, &uniformBlockName[0]);
924 ctx.expectError(GL_INVALID_VALUE);
930 void get_active_attrib (NegativeTestContext& ctx)
932 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
933 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
934 GLint numActiveAttributes = -1;
940 deMemset(&name[0], 0, sizeof(name));
942 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_ATTRIBUTES, &numActiveAttributes);
943 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_ATTRIBUTES = " << numActiveAttributes << " (expected 1)." << TestLog::EndMessage;
945 ctx.glUseProgram(program.getProgram());
947 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
948 ctx.glGetActiveAttrib(-1, 0, 32, &length, &size, &type, &name[0]);
949 ctx.expectError(GL_INVALID_VALUE);
952 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
953 ctx.glGetActiveAttrib(shader, 0, 32, &length, &size, &type, &name[0]);
954 ctx.expectError(GL_INVALID_OPERATION);
957 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_ACTIVE_ATTRIBUTES.");
958 ctx.glGetActiveAttrib(program.getProgram(), numActiveAttributes, (int)sizeof(name), &length, &size, &type, &name[0]);
959 ctx.expectError(GL_INVALID_VALUE);
962 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
963 ctx.glGetActiveAttrib(program.getProgram(), 0, -1, &length, &size, &type, &name[0]);
964 ctx.expectError(GL_INVALID_VALUE);
968 ctx.glDeleteShader(shader);
971 void get_uniform_indices (NegativeTestContext& ctx)
973 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
974 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
975 GLint numActiveBlocks = -1;
976 const GLchar* uniformName = "Block.blockVar";
977 GLuint uniformIndices = -1;
980 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
981 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << TestLog::EndMessage;
982 ctx.expectError(GL_NO_ERROR);
984 ctx.beginSection("GL_INVALID_OPERATION is generated if program is a name of shader object.");
985 ctx.glGetUniformIndices(shader, 1, &uniformName, &uniformIndices);
986 ctx.expectError(GL_INVALID_OPERATION);
989 ctx.beginSection("GL_INVALID_VALUE is generated if program is not name of program or shader object.");
990 ctx.glGetUniformIndices(invalid, 1, &uniformName, &uniformIndices);
991 ctx.expectError(GL_INVALID_VALUE);
995 ctx.glDeleteShader(shader);
998 void get_vertex_attribfv (NegativeTestContext& ctx)
1000 GLfloat params = 0.0f;
1001 GLint maxVertexAttribs;
1003 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1004 ctx.glGetVertexAttribfv(0, -1, ¶ms);
1005 ctx.expectError(GL_INVALID_ENUM);
1008 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1009 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1010 ctx.glGetVertexAttribfv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1011 ctx.expectError(GL_INVALID_VALUE);
1015 void get_vertex_attribiv (NegativeTestContext& ctx)
1018 GLint maxVertexAttribs;
1020 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1021 ctx.glGetVertexAttribiv(0, -1, ¶ms);
1022 ctx.expectError(GL_INVALID_ENUM);
1025 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1026 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1027 ctx.glGetVertexAttribiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1028 ctx.expectError(GL_INVALID_VALUE);
1032 void get_vertex_attribi_iv (NegativeTestContext& ctx)
1035 GLint maxVertexAttribs;
1037 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1038 ctx.glGetVertexAttribIiv(0, -1, ¶ms);
1039 ctx.expectError(GL_INVALID_ENUM);
1042 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1043 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1044 ctx.glGetVertexAttribIiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1045 ctx.expectError(GL_INVALID_VALUE);
1049 void get_vertex_attribi_uiv (NegativeTestContext& ctx)
1051 GLuint params = (GLuint)-1;
1052 GLint maxVertexAttribs;
1054 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1055 ctx.glGetVertexAttribIuiv(0, -1, ¶ms);
1056 ctx.expectError(GL_INVALID_ENUM);
1059 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1060 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1061 ctx.glGetVertexAttribIuiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1062 ctx.expectError(GL_INVALID_VALUE);
1066 void get_vertex_attrib_pointerv (NegativeTestContext& ctx)
1068 GLvoid* ptr[1] = { DE_NULL };
1069 GLint maxVertexAttribs;
1071 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1072 ctx.glGetVertexAttribPointerv(0, -1, &ptr[0]);
1073 ctx.expectError(GL_INVALID_ENUM);
1076 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1077 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1078 ctx.glGetVertexAttribPointerv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr[0]);
1079 ctx.expectError(GL_INVALID_VALUE);
1083 void get_frag_data_location (NegativeTestContext& ctx)
1085 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
1086 GLuint program = ctx.glCreateProgram();
1088 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object.");
1089 ctx.glGetFragDataLocation(shader, "gl_FragColor");
1090 ctx.expectError(GL_INVALID_OPERATION);
1093 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been linked.");
1094 ctx.glGetFragDataLocation(program, "gl_FragColor");
1095 ctx.expectError(GL_INVALID_OPERATION);
1098 ctx.glDeleteProgram(program);
1099 ctx.glDeleteShader(shader);
1102 // Enumerated state queries: Buffers
1104 void get_buffer_parameteriv (NegativeTestContext& ctx)
1108 ctx.glGenBuffers(1, &buf);
1109 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1111 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value.");
1112 ctx.glGetBufferParameteriv(-1, GL_BUFFER_SIZE, ¶ms);
1113 ctx.expectError(GL_INVALID_ENUM);
1114 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, -1, ¶ms);
1115 ctx.expectError(GL_INVALID_ENUM);
1116 ctx.glGetBufferParameteriv(-1, -1, ¶ms);
1117 ctx.expectError(GL_INVALID_ENUM);
1120 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1121 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1122 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms);
1123 ctx.expectError(GL_INVALID_OPERATION);
1126 ctx.glDeleteBuffers(1, &buf);
1129 void get_buffer_parameteri64v (NegativeTestContext& ctx)
1131 GLint64 params = -1;
1133 ctx.glGenBuffers(1, &buf);
1134 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1136 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value.");
1137 ctx.glGetBufferParameteri64v(-1, GL_BUFFER_SIZE, ¶ms);
1138 ctx.expectError(GL_INVALID_ENUM);
1139 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER , -1, ¶ms);
1140 ctx.expectError(GL_INVALID_ENUM);
1141 ctx.glGetBufferParameteri64v(-1, -1, ¶ms);
1142 ctx.expectError(GL_INVALID_ENUM);
1145 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1146 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1147 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms);
1148 ctx.expectError(GL_INVALID_OPERATION);
1151 ctx.glDeleteBuffers(1, &buf);
1154 void get_buffer_pointerv (NegativeTestContext& ctx)
1156 GLvoid* params = DE_NULL;
1158 ctx.glGenBuffers(1, &buf);
1159 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1161 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
1162 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, -1, ¶ms);
1163 ctx.expectError(GL_INVALID_ENUM);
1164 ctx.glGetBufferPointerv(-1, GL_BUFFER_MAP_POINTER, ¶ms);
1165 ctx.expectError(GL_INVALID_ENUM);
1168 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1169 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1170 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, GL_BUFFER_MAP_POINTER, ¶ms);
1171 ctx.expectError(GL_INVALID_OPERATION);
1174 ctx.glDeleteBuffers(1, &buf);
1177 void get_framebuffer_attachment_parameteriv (NegativeTestContext& ctx)
1179 GLint params[1] = { -1 };
1183 ctx.glGenFramebuffers (1, &fbo);
1184 ctx.glGenRenderbuffers (2, rbo);
1186 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo);
1187 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]);
1188 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, 16, 16);
1189 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo[0]);
1190 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]);
1191 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_STENCIL_INDEX8, 16, 16);
1192 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo[1]);
1193 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER);
1194 ctx.expectError (GL_NO_ERROR);
1196 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
1197 ctx.glGetFramebufferAttachmentParameteriv(-1, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, ¶ms[0]); // TYPE is GL_RENDERBUFFER
1198 ctx.expectError(GL_INVALID_ENUM);
1201 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not valid for the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.");
1202 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, ¶ms[0]); // TYPE is GL_RENDERBUFFER
1203 ctx.expectError(GL_INVALID_ENUM);
1204 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1205 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // TYPE is GL_FRAMEBUFFER_DEFAULT
1206 ctx.expectError(GL_INVALID_ENUM);
1207 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1210 ctx.beginSection("GL_INVALID_OPERATION is generated if attachment is GL_DEPTH_STENCIL_ATTACHMENT and different objects are bound to the depth and stencil attachment points of target.");
1211 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]);
1212 ctx.expectError(GL_INVALID_OPERATION);
1215 ctx.beginSection("GL_INVALID_OPERATION is generated if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.");
1216 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // TYPE is GL_NONE
1217 ctx.expectError(GL_NO_ERROR);
1218 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, ¶ms[0]); // TYPE is GL_NONE
1219 ctx.expectError(GL_INVALID_OPERATION);
1222 ctx.beginSection("GL_INVALID_OPERATION or GL_INVALID_ENUM is generated if attachment is not one of the accepted values for the current binding of target.");
1223 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // A FBO is bound so GL_BACK is invalid
1224 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM);
1225 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1226 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // Default framebuffer is bound so GL_COLOR_ATTACHMENT0 is invalid
1227 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM);
1230 ctx.glDeleteFramebuffers(1, &fbo);
1233 void get_renderbuffer_parameteriv (NegativeTestContext& ctx)
1235 GLint params[1] = { -1 };
1237 ctx.glGenRenderbuffers(1, &rbo);
1238 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo);
1240 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
1241 ctx.glGetRenderbufferParameteriv(-1, GL_RENDERBUFFER_WIDTH, ¶ms[0]);
1242 ctx.expectError(GL_INVALID_ENUM);
1245 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
1246 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, -1, ¶ms[0]);
1247 ctx.expectError(GL_INVALID_ENUM);
1250 ctx.beginSection("GL_INVALID_OPERATION is generated if the renderbuffer currently bound to target is zero.");
1251 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0);
1252 ctx.expectError(GL_NO_ERROR);
1253 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, ¶ms[0]);
1254 ctx.expectError(GL_INVALID_OPERATION);
1257 ctx.glDeleteRenderbuffers(1, &rbo);
1258 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0);
1261 void get_internalformativ (NegativeTestContext& ctx)
1265 deMemset(¶ms[0], 0xcd, sizeof(params));
1267 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative.");
1268 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, -1, ¶ms[0]);
1269 ctx.expectError (GL_INVALID_VALUE);
1272 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not GL_SAMPLES or GL_NUM_SAMPLE_COUNTS.");
1273 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, -1, 16, ¶ms[0]);
1274 ctx.expectError (GL_INVALID_ENUM);
1277 ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not color-, depth-, or stencil-renderable.");
1279 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_render_snorm"))
1281 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RG8_SNORM, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1282 ctx.expectError (GL_INVALID_ENUM);
1285 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_COMPRESSED_RGB8_ETC2, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1286 ctx.expectError (GL_INVALID_ENUM);
1289 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
1290 ctx.glGetInternalformativ (-1, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1291 ctx.expectError (GL_INVALID_ENUM);
1292 ctx.glGetInternalformativ (GL_FRAMEBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1293 ctx.expectError (GL_INVALID_ENUM);
1295 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_sparse_texture"))
1297 ctx.glGetInternalformativ (GL_TEXTURE_2D, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1298 ctx.expectError (GL_INVALID_ENUM);
1304 // Query object queries
1306 void get_queryiv (NegativeTestContext& ctx)
1310 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
1311 ctx.glGetQueryiv (GL_ANY_SAMPLES_PASSED, -1, ¶ms);
1312 ctx.expectError (GL_INVALID_ENUM);
1313 ctx.glGetQueryiv (-1, GL_CURRENT_QUERY, ¶ms);
1314 ctx.expectError (GL_INVALID_ENUM);
1315 ctx.glGetQueryiv (-1, -1, ¶ms);
1316 ctx.expectError (GL_INVALID_ENUM);
1320 void get_query_objectuiv (NegativeTestContext& ctx)
1324 ctx.glGenQueries (1, &id);
1326 ctx.beginSection("GL_INVALID_OPERATION is generated if id is not the name of a query object.");
1327 ctx.glGetQueryObjectuiv (-1, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1328 ctx.expectError (GL_INVALID_OPERATION);
1329 ctx.getLog() << TestLog::Message << "// Note: " << id << " is not a query object yet, since it hasn't been used by glBeginQuery" << TestLog::EndMessage;
1330 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1331 ctx.expectError (GL_INVALID_OPERATION);
1334 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
1335 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
1337 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1338 ctx.glGetQueryObjectuiv (id, -1, ¶ms);
1339 ctx.expectError (GL_INVALID_ENUM);
1342 ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of a currently active query object.");
1343 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
1344 ctx.expectError (GL_NO_ERROR);
1345 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1346 ctx.expectError (GL_INVALID_OPERATION);
1347 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
1348 ctx.expectError (GL_NO_ERROR);
1351 ctx.glDeleteQueries (1, &id);
1354 // Sync object queries
1356 void get_synciv (NegativeTestContext& ctx)
1358 GLsizei length = -1;
1362 deMemset(&values[0], 0xcd, sizeof(values));
1364 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
1365 ctx.glGetSynciv(0, GL_OBJECT_TYPE, 32, &length, &values[0]);
1366 ctx.expectError(GL_INVALID_VALUE);
1369 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
1370 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
1371 ctx.expectError(GL_NO_ERROR);
1372 ctx.glGetSynciv(sync, -1, 32, &length, &values[0]);
1373 ctx.expectError(GL_INVALID_ENUM);
1376 ctx.glDeleteSync(sync);
1378 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative.");
1379 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
1380 ctx.expectError(GL_NO_ERROR);
1381 ctx.glGetSynciv(sync, GL_OBJECT_TYPE, -1, &length, &values[0]);
1382 ctx.expectError(GL_INVALID_VALUE);
1385 ctx.glDeleteSync(sync);
1388 // Enumerated boolean state queries
1390 void is_enabled (NegativeTestContext& ctx)
1392 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value.");
1393 ctx.glIsEnabled(-1);
1394 ctx.expectError(GL_INVALID_ENUM);
1395 ctx.glIsEnabled(GL_TRIANGLES);
1396 ctx.expectError(GL_INVALID_ENUM);
1400 void is_enabledi (NegativeTestContext& ctx)
1402 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
1404 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value.");
1405 ctx.glIsEnabledi(-1, 1);
1406 ctx.expectError(GL_INVALID_ENUM);
1407 ctx.glIsEnabledi(GL_TRIANGLES, 1);
1408 ctx.expectError(GL_INVALID_ENUM);
1411 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for the indexed state cap.");
1412 ctx.glIsEnabledi(GL_BLEND, -1);
1413 ctx.expectError(GL_INVALID_VALUE);
1419 void hint (NegativeTestContext& ctx)
1421 ctx.beginSection("GL_INVALID_ENUM is generated if either target or mode is not an accepted value.");
1422 ctx.glHint(GL_GENERATE_MIPMAP_HINT, -1);
1423 ctx.expectError(GL_INVALID_ENUM);
1424 ctx.glHint(-1, GL_FASTEST);
1425 ctx.expectError(GL_INVALID_ENUM);
1427 ctx.expectError(GL_INVALID_ENUM);
1431 std::vector<FunctionContainer> getNegativeStateApiTestFunctions ()
1433 const FunctionContainer funcs[] =
1435 {enable, "enable", "Invalid glEnable() usage" },
1436 {disable, "disable", "Invalid glDisable() usage" },
1437 {get_booleanv, "get_booleanv", "Invalid glGetBooleanv() usage" },
1438 {get_floatv, "get_floatv", "Invalid glGetFloatv() usage" },
1439 {get_integerv, "get_integerv", "Invalid glGetIntegerv() usage" },
1440 {get_integer64v, "get_integer64v", "Invalid glGetInteger64v() usage" },
1441 {get_integeri_v, "get_integeri_v", "Invalid glGetIntegeri_v() usage" },
1442 {get_booleani_v, "get_booleani_v", "Invalid glGetBooleani_v() usage" },
1443 {get_integer64i_v, "get_integer64i_v", "Invalid glGetInteger64i_v() usage" },
1444 {get_string, "get_string", "Invalid glGetString() usage" },
1445 {get_stringi, "get_stringi", "Invalid glGetStringi() usage" },
1446 {get_attached_shaders, "get_attached_shaders", "Invalid glGetAttachedShaders() usage" },
1447 {get_shaderiv, "get_shaderiv", "Invalid glGetShaderiv() usage" },
1448 {get_shader_info_log, "get_shader_info_log", "Invalid glGetShaderInfoLog() usage" },
1449 {get_shader_precision_format, "get_shader_precision_format", "Invalid glGetShaderPrecisionFormat() usage" },
1450 {get_shader_source, "get_shader_source", "Invalid glGetShaderSource() usage" },
1451 {get_programiv, "get_programiv", "Invalid glGetProgramiv() usage" },
1452 {get_program_info_log, "get_program_info_log", "Invalid glGetProgramInfoLog() usage" },
1453 {get_tex_parameterfv, "get_tex_parameterfv", "Invalid glGetTexParameterfv() usage" },
1454 {get_tex_parameteriv, "get_tex_parameteriv", "Invalid glGetTexParameteriv() usage" },
1455 {get_uniformfv, "get_uniformfv", "Invalid glGetUniformfv() usage" },
1456 {get_uniformiv, "get_uniformiv", "Invalid glGetUniformiv() usage" },
1457 {get_uniformuiv, "get_uniformuiv", "Invalid glGetUniformuiv() usage" },
1458 {get_active_uniform, "get_active_uniform", "Invalid glGetActiveUniform() usage" },
1459 {get_active_uniformsiv, "get_active_uniformsiv", "Invalid glGetActiveUniformsiv() usage" },
1460 {get_active_uniform_blockiv, "get_active_uniform_blockiv", "Invalid glGetActiveUniformBlockiv() usage" },
1461 {get_active_uniform_block_name, "get_active_uniform_block_name", "Invalid glGetActiveUniformBlockName() usage" },
1462 {get_active_attrib, "get_active_attrib", "Invalid glGetActiveAttrib() usage" },
1463 {get_uniform_indices, "get_uniform_indices", "Invalid glGetUniformIndices() usage" },
1464 {get_vertex_attribfv, "get_vertex_attribfv", "Invalid glGetVertexAttribfv() usage" },
1465 {get_vertex_attribiv, "get_vertex_attribiv", "Invalid glGetVertexAttribiv() usage" },
1466 {get_vertex_attribi_iv, "get_vertex_attribi_iv", "Invalid glGetVertexAttribIiv() usage" },
1467 {get_vertex_attribi_uiv, "get_vertex_attribi_uiv", "Invalid glGetVertexAttribIuiv() usage" },
1468 {get_vertex_attrib_pointerv, "get_vertex_attrib_pointerv", "Invalid glGetVertexAttribPointerv() usage" },
1469 {get_frag_data_location, "get_frag_data_location", "Invalid glGetFragDataLocation() usage" },
1470 {get_buffer_parameteriv, "get_buffer_parameteriv", "Invalid glGetBufferParameteriv() usage" },
1471 {get_buffer_parameteri64v, "get_buffer_parameteri64v", "Invalid glGetBufferParameteri64v() usage" },
1472 {get_buffer_pointerv, "get_buffer_pointerv", "Invalid glGetBufferPointerv() usage" },
1473 {get_framebuffer_attachment_parameteriv, "get_framebuffer_attachment_parameteriv", "Invalid glGetFramebufferAttachmentParameteriv() usage" },
1474 {get_renderbuffer_parameteriv, "get_renderbuffer_parameteriv", "Invalid glGetRenderbufferParameteriv() usage" },
1475 {get_internalformativ, "get_internalformativ", "Invalid glGetInternalformativ() usage" },
1476 {get_queryiv, "get_queryiv", "Invalid glGetQueryiv() usage" },
1477 {get_query_objectuiv, "get_query_objectuiv", "Invalid glGetQueryObjectuiv() usage" },
1478 {get_synciv, "get_synciv", "Invalid glGetSynciv() usage" },
1479 {is_enabled, "is_enabled", "Invalid glIsEnabled() usage" },
1480 {hint, "hint", "Invalid glHint() usage" },
1481 {enablei, "enablei", "Invalid glEnablei() usage" },
1482 {disablei, "disablei", "Invalid glDisablei() usage" },
1483 {get_tex_parameteriiv, "get_tex_parameteriiv", "Invalid glGetTexParameterIiv() usage" },
1484 {get_tex_parameteriuiv, "get_tex_parameteriuiv", "Invalid glGetTexParameterIuiv() usage" },
1485 {get_nuniformfv, "get_nuniformfv", "Invalid glGetnUniformfv() usage" },
1486 {get_nuniformiv, "get_nuniformiv", "Invalid glGetnUniformiv() usage" },
1487 {get_nuniformuiv, "get_nuniformuiv", "Invalid glGetnUniformuiv() usage" },
1488 {is_enabledi, "is_enabledi", "Invalid glIsEnabledi() usage" },
1491 return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
1494 } // NegativeTestShared