Lines Matching refs:ctx
76 VAOHelper(NegativeTestContext& ctx) in VAOHelper() argument
78 , m_ctx(ctx) in VAOHelper()
81 if (glu::isContextTypeES(ctx.getRenderContext().getType())) in VAOHelper()
100 static std::string getVtxFragVersionSources (const std::string source, NegativeTestContext& ctx) in getVtxFragVersionSources() argument
102 …const bool supportsES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(… in getVtxFragVersionSources()
112 void enable (NegativeTestContext& ctx) in enable() argument
114 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values."); in enable()
115 ctx.glEnable(-1); in enable()
116 ctx.expectError(GL_INVALID_ENUM); in enable()
117 ctx.endSection(); in enable()
120 static bool checkSupport(NegativeTestContext& ctx) in checkSupport() argument
122 return contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || in checkSupport()
123 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::core(4, 5)); in checkSupport()
127 void enablei (NegativeTestContext& ctx) in enablei() argument
129 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in enablei()
131 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values."); in enablei()
132 ctx.glEnablei(-1, -1); in enablei()
133 ctx.expectError(GL_INVALID_ENUM); in enablei()
134 ctx.endSection(); in enablei()
136 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number o… in enablei()
137 ctx.glEnablei(GL_BLEND, -1); in enablei()
138 ctx.expectError(GL_INVALID_VALUE); in enablei()
139 ctx.endSection(); in enablei()
142 void disable (NegativeTestContext& ctx) in disable() argument
144 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values."); in disable()
145 ctx.glDisable(-1); in disable()
146 ctx.expectError(GL_INVALID_ENUM); in disable()
147 ctx.endSection(); in disable()
150 void disablei (NegativeTestContext& ctx) in disablei() argument
152 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in disablei()
154 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values."); in disablei()
155 ctx.glDisablei(-1,-1); in disablei()
156 ctx.expectError(GL_INVALID_ENUM); in disablei()
157 ctx.endSection(); in disablei()
159 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number o… in disablei()
160 ctx.glDisablei(GL_BLEND, -1); in disablei()
161 ctx.expectError(GL_INVALID_VALUE); in disablei()
162 ctx.endSection(); in disablei()
166 void get_booleanv (NegativeTestContext& ctx) in get_booleanv() argument
168 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values."); in get_booleanv()
170 ctx.glGetBooleanv(-1, ¶ms); in get_booleanv()
171 ctx.expectError(GL_INVALID_ENUM); in get_booleanv()
172 ctx.endSection(); in get_booleanv()
175 void get_booleani_v (NegativeTestContext& ctx) in get_booleani_v() argument
180 …ctx.beginSection("GL_INVALID_ENUM is generated if target is not indexed state queriable with these… in get_booleani_v()
181 ctx.glGetBooleani_v(-1, 0, &data); in get_booleani_v()
182 ctx.expectError(GL_INVALID_ENUM); in get_booleani_v()
183 ctx.endSection(); in get_booleani_v()
185 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the ind… in get_booleani_v()
186 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings); in get_booleani_v()
187 ctx.expectError(GL_NO_ERROR); in get_booleani_v()
188 ctx.glGetBooleani_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data); in get_booleani_v()
189 ctx.expectError(GL_INVALID_VALUE); in get_booleani_v()
190 ctx.endSection(); in get_booleani_v()
193 void get_floatv (NegativeTestContext& ctx) in get_floatv() argument
195 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values."); in get_floatv()
197 ctx.glGetFloatv(-1, ¶ms); in get_floatv()
198 ctx.expectError(GL_INVALID_ENUM); in get_floatv()
199 ctx.endSection(); in get_floatv()
202 void get_integerv (NegativeTestContext& ctx) in get_integerv() argument
205 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values."); in get_integerv()
206 ctx.glGetIntegerv(-1, ¶ms); in get_integerv()
207 ctx.expectError(GL_INVALID_ENUM); in get_integerv()
208 ctx.endSection(); in get_integerv()
211 void get_integer64v (NegativeTestContext& ctx) in get_integer64v() argument
214 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values."); in get_integer64v()
215 ctx.glGetInteger64v(-1, ¶ms); in get_integer64v()
216 ctx.expectError(GL_INVALID_ENUM); in get_integer64v()
217 ctx.endSection(); in get_integer64v()
220 void get_integeri_v (NegativeTestContext& ctx) in get_integeri_v() argument
226 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value."); in get_integeri_v()
227 ctx.glGetIntegeri_v(-1, 0, &data); in get_integeri_v()
228 ctx.expectError(GL_INVALID_ENUM); in get_integeri_v()
229 ctx.endSection(); in get_integeri_v()
231 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the ind… in get_integeri_v()
232 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings); in get_integeri_v()
233 ctx.expectError(GL_NO_ERROR); in get_integeri_v()
234 ctx.glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data); in get_integeri_v()
235 ctx.expectError(GL_INVALID_VALUE); in get_integeri_v()
236 ctx.endSection(); in get_integeri_v()
238 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the ind… in get_integeri_v()
239 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings); in get_integeri_v()
240 ctx.expectError(GL_NO_ERROR); in get_integeri_v()
241 ctx.glGetIntegeri_v(GL_SHADER_STORAGE_BUFFER_BINDING, maxShaderStorageBufferBindings, &data); in get_integeri_v()
242 ctx.expectError(GL_INVALID_VALUE); in get_integeri_v()
243 ctx.endSection(); in get_integeri_v()
246 void get_integer64i_v (NegativeTestContext& ctx) in get_integer64i_v() argument
252 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value."); in get_integer64i_v()
253 ctx.glGetInteger64i_v(-1, 0, &data); in get_integer64i_v()
254 ctx.expectError(GL_INVALID_ENUM); in get_integer64i_v()
255 ctx.endSection(); in get_integer64i_v()
257 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the ind… in get_integer64i_v()
258 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings); in get_integer64i_v()
259 ctx.expectError(GL_NO_ERROR); in get_integer64i_v()
260 ctx.glGetInteger64i_v(GL_UNIFORM_BUFFER_START, maxUniformBufferBindings, &data); in get_integer64i_v()
261 ctx.expectError(GL_INVALID_VALUE); in get_integer64i_v()
262 ctx.endSection(); in get_integer64i_v()
264 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the ind… in get_integer64i_v()
265 ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings); in get_integer64i_v()
266 ctx.expectError(GL_NO_ERROR); in get_integer64i_v()
267 ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_START, maxShaderStorageBufferBindings, &data); in get_integer64i_v()
268 ctx.expectError(GL_INVALID_VALUE); in get_integer64i_v()
269 ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_SIZE, maxShaderStorageBufferBindings, &data); in get_integer64i_v()
270 ctx.expectError(GL_INVALID_VALUE); in get_integer64i_v()
271 ctx.endSection(); in get_integer64i_v()
274 void get_string (NegativeTestContext& ctx) in get_string() argument
276 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value."); in get_string()
277 ctx.glGetString(-1); in get_string()
278 ctx.expectError(GL_INVALID_ENUM); in get_string()
279 ctx.endSection(); in get_string()
282 void get_stringi (NegativeTestContext& ctx) in get_stringi() argument
286 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value."); in get_stringi()
287 ctx.glGetStringi(-1, 0); in get_stringi()
288 ctx.expectError(GL_INVALID_ENUM); in get_stringi()
289 ctx.endSection(); in get_stringi()
291 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for indexed st… in get_stringi()
292 ctx.glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions); in get_stringi()
293 ctx.glGetStringi(GL_EXTENSIONS, numExtensions); in get_stringi()
294 ctx.expectError(GL_INVALID_VALUE); in get_stringi()
295 ctx.endSection(); in get_stringi()
300 void get_attached_shaders (NegativeTestContext& ctx) in get_attached_shaders() argument
303 GLuint shaderObject = ctx.glCreateShader(GL_VERTEX_SHADER); in get_attached_shaders()
304 GLuint program = ctx.glCreateProgram(); in get_attached_shaders()
307 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_attached_shaders()
308 ctx.glGetAttachedShaders(-1, 1, &count[0], &shaders[0]); in get_attached_shaders()
309 ctx.expectError(GL_INVALID_VALUE); in get_attached_shaders()
310 ctx.endSection(); in get_attached_shaders()
312 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_attached_shaders()
313 ctx.glGetAttachedShaders(shaderObject, 1, &count[0], &shaders[0]); in get_attached_shaders()
314 ctx.expectError(GL_INVALID_OPERATION); in get_attached_shaders()
315 ctx.endSection(); in get_attached_shaders()
317 ctx.beginSection("GL_INVALID_VALUE is generated if maxCount is less than 0."); in get_attached_shaders()
318 ctx.glGetAttachedShaders(program, -1, &count[0], &shaders[0]); in get_attached_shaders()
319 ctx.expectError(GL_INVALID_VALUE); in get_attached_shaders()
320 ctx.endSection(); in get_attached_shaders()
322 ctx.glDeleteShader(shaderObject); in get_attached_shaders()
323 ctx.glDeleteProgram(program); in get_attached_shaders()
326 void get_shaderiv (NegativeTestContext& ctx) in get_shaderiv() argument
329 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_shaderiv()
330 GLuint program = ctx.glCreateProgram(); in get_shaderiv()
333 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported); in get_shaderiv()
334 …ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_T… in get_shaderiv()
336 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_shaderiv()
337 ctx.glGetShaderiv(shader, -1, ¶m[0]); in get_shaderiv()
338 ctx.expectError(GL_INVALID_ENUM); in get_shaderiv()
339 ctx.endSection(); in get_shaderiv()
341 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); in get_shaderiv()
342 ctx.glGetShaderiv(-1, GL_SHADER_TYPE, ¶m[0]); in get_shaderiv()
343 ctx.expectError(GL_INVALID_VALUE); in get_shaderiv()
344 ctx.endSection(); in get_shaderiv()
346 ctx.beginSection("GL_INVALID_OPERATION is generated if shader does not refer to a shader object."); in get_shaderiv()
347 ctx.glGetShaderiv(program, GL_SHADER_TYPE, ¶m[0]); in get_shaderiv()
348 ctx.expectError(GL_INVALID_OPERATION); in get_shaderiv()
349 ctx.endSection(); in get_shaderiv()
351 ctx.glDeleteShader(shader); in get_shaderiv()
352 ctx.glDeleteProgram(program); in get_shaderiv()
355 void get_shader_info_log (NegativeTestContext& ctx) in get_shader_info_log() argument
357 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_shader_info_log()
358 GLuint program = ctx.glCreateProgram(); in get_shader_info_log()
362 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); in get_shader_info_log()
363 ctx.glGetShaderInfoLog(-1, 128, &length[0], &infoLog[0]); in get_shader_info_log()
364 ctx.expectError(GL_INVALID_VALUE); in get_shader_info_log()
365 ctx.endSection(); in get_shader_info_log()
367 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object."); in get_shader_info_log()
368 ctx.glGetShaderInfoLog(program, 128, &length[0], &infoLog[0]); in get_shader_info_log()
369 ctx.expectError(GL_INVALID_OPERATION); in get_shader_info_log()
370 ctx.endSection(); in get_shader_info_log()
372 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0."); in get_shader_info_log()
373 ctx.glGetShaderInfoLog(shader, -1, &length[0], &infoLog[0]); in get_shader_info_log()
374 ctx.expectError(GL_INVALID_VALUE); in get_shader_info_log()
375 ctx.endSection(); in get_shader_info_log()
377 ctx.glDeleteShader(shader); in get_shader_info_log()
378 ctx.glDeleteProgram(program); in get_shader_info_log()
381 void get_shader_precision_format (NegativeTestContext& ctx) in get_shader_precision_format() argument
387 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported); in get_shader_precision_format()
388 …ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_T… in get_shader_precision_format()
393 …ctx.beginSection("GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted v… in get_shader_precision_format()
394 ctx.glGetShaderPrecisionFormat (-1, GL_MEDIUM_FLOAT, &range[0], &precision[0]); in get_shader_precision_format()
395 ctx.expectError(GL_INVALID_ENUM); in get_shader_precision_format()
396 ctx.glGetShaderPrecisionFormat (GL_VERTEX_SHADER, -1, &range[0], &precision[0]); in get_shader_precision_format()
397 ctx.expectError(GL_INVALID_ENUM); in get_shader_precision_format()
398 ctx.glGetShaderPrecisionFormat (-1, -1, &range[0], &precision[0]); in get_shader_precision_format()
399 ctx.expectError(GL_INVALID_ENUM); in get_shader_precision_format()
400 ctx.endSection(); in get_shader_precision_format()
403 void get_shader_source (NegativeTestContext& ctx) in get_shader_source() argument
407 GLuint program = ctx.glCreateProgram(); in get_shader_source()
408 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_shader_source()
410 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL."); in get_shader_source()
411 ctx.glGetShaderSource(-1, 1, &length[0], &source[0]); in get_shader_source()
412 ctx.expectError(GL_INVALID_VALUE); in get_shader_source()
413 ctx.endSection(); in get_shader_source()
415 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object."); in get_shader_source()
416 ctx.glGetShaderSource(program, 1, &length[0], &source[0]); in get_shader_source()
417 ctx.expectError(GL_INVALID_OPERATION); in get_shader_source()
418 ctx.endSection(); in get_shader_source()
420 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0."); in get_shader_source()
421 ctx.glGetShaderSource(shader, -1, &length[0], &source[0]); in get_shader_source()
422 ctx.expectError(GL_INVALID_VALUE); in get_shader_source()
423 ctx.endSection(); in get_shader_source()
425 ctx.glDeleteProgram(program); in get_shader_source()
426 ctx.glDeleteShader(shader); in get_shader_source()
431 void get_programiv (NegativeTestContext& ctx) in get_programiv() argument
433 GLuint program = ctx.glCreateProgram(); in get_programiv()
434 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_programiv()
437 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_programiv()
438 ctx.glGetProgramiv(program, -1, ¶ms[0]); in get_programiv()
439 ctx.expectError(GL_INVALID_ENUM); in get_programiv()
440 ctx.endSection(); in get_programiv()
442 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_programiv()
443 ctx.glGetProgramiv(-1, GL_LINK_STATUS, ¶ms[0]); in get_programiv()
444 ctx.expectError(GL_INVALID_VALUE); in get_programiv()
445 ctx.endSection(); in get_programiv()
447 …ctx.beginSection("GL_INVALID_OPERATION is generated if program does not refer to a program object.… in get_programiv()
448 ctx.glGetProgramiv(shader, GL_LINK_STATUS, ¶ms[0]); in get_programiv()
449 ctx.expectError(GL_INVALID_OPERATION); in get_programiv()
450 ctx.endSection(); in get_programiv()
452 ctx.glDeleteProgram(program); in get_programiv()
453 ctx.glDeleteShader(shader); in get_programiv()
456 void get_program_info_log (NegativeTestContext& ctx) in get_program_info_log() argument
458 GLuint program = ctx.glCreateProgram(); in get_program_info_log()
459 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_program_info_log()
463 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_program_info_log()
464 ctx.glGetProgramInfoLog (-1, 1, &length[0], &infoLog[0]); in get_program_info_log()
465 ctx.expectError(GL_INVALID_VALUE); in get_program_info_log()
466 ctx.endSection(); in get_program_info_log()
468 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_program_info_log()
469 ctx.glGetProgramInfoLog (shader, 1, &length[0], &infoLog[0]); in get_program_info_log()
470 ctx.expectError(GL_INVALID_OPERATION); in get_program_info_log()
471 ctx.endSection(); in get_program_info_log()
473 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0."); in get_program_info_log()
474 ctx.glGetProgramInfoLog (program, -1, &length[0], &infoLog[0]); in get_program_info_log()
475 ctx.expectError(GL_INVALID_VALUE); in get_program_info_log()
476 ctx.endSection(); in get_program_info_log()
478 ctx.glDeleteProgram(program); in get_program_info_log()
479 ctx.glDeleteShader(shader); in get_program_info_log()
484 void get_tex_parameterfv (NegativeTestContext& ctx) in get_tex_parameterfv() argument
488 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_tex_parameterfv()
489 ctx.glGetTexParameterfv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]); in get_tex_parameterfv()
490 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameterfv()
491 ctx.glGetTexParameterfv (GL_TEXTURE_2D, -1, ¶ms[0]); in get_tex_parameterfv()
492 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameterfv()
493 ctx.glGetTexParameterfv (-1, -1, ¶ms[0]); in get_tex_parameterfv()
494 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameterfv()
495 ctx.endSection(); in get_tex_parameterfv()
498 void get_tex_parameteriv (NegativeTestContext& ctx) in get_tex_parameteriv() argument
502 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_tex_parameteriv()
503 ctx.glGetTexParameteriv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]); in get_tex_parameteriv()
504 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriv()
505 ctx.glGetTexParameteriv (GL_TEXTURE_2D, -1, ¶ms[0]); in get_tex_parameteriv()
506 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriv()
507 ctx.glGetTexParameteriv (-1, -1, ¶ms[0]); in get_tex_parameteriv()
508 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriv()
509 ctx.endSection(); in get_tex_parameteriv()
512 void get_tex_parameteriiv (NegativeTestContext& ctx) in get_tex_parameteriiv() argument
514 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in get_tex_parameteriiv()
518 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_tex_parameteriiv()
519 ctx.glGetTexParameterIiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]); in get_tex_parameteriiv()
520 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriiv()
521 ctx.glGetTexParameterIiv(GL_TEXTURE_2D, -1, ¶ms[0]); in get_tex_parameteriiv()
522 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriiv()
523 ctx.glGetTexParameterIiv(-1, -1, ¶ms[0]); in get_tex_parameteriiv()
524 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriiv()
525 ctx.endSection(); in get_tex_parameteriiv()
528 void get_tex_parameteriuiv (NegativeTestContext& ctx) in get_tex_parameteriuiv() argument
530 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in get_tex_parameteriuiv()
534 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_tex_parameteriuiv()
535 ctx.glGetTexParameterIuiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]); in get_tex_parameteriuiv()
536 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriuiv()
537 ctx.glGetTexParameterIuiv(GL_TEXTURE_2D, -1, ¶ms[0]); in get_tex_parameteriuiv()
538 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriuiv()
539 ctx.glGetTexParameterIuiv(-1, -1, ¶ms[0]); in get_tex_parameteriuiv()
540 ctx.expectError(GL_INVALID_ENUM); in get_tex_parameteriuiv()
541 ctx.endSection(); in get_tex_parameteriuiv()
544 void get_uniformfv (NegativeTestContext& ctx) in get_uniformfv() argument
546 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_uniformfv()
552 ctx.glUseProgram(program.getProgram()); in get_uniformfv()
554 unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4"); // vec4 in get_uniformfv()
556 ctx.fail("Failed to retrieve uniform location"); in get_uniformfv()
558 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_uniformfv()
559 programEmpty = ctx.glCreateProgram(); in get_uniformfv()
561 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_uniformfv()
562 ctx.glGetUniformfv (-1, unif, ¶ms[0]); in get_uniformfv()
563 ctx.expectError(GL_INVALID_VALUE); in get_uniformfv()
564 ctx.endSection(); in get_uniformfv()
566 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_uniformfv()
567 ctx.glGetUniformfv (shader, unif, ¶ms[0]); in get_uniformfv()
568 ctx.expectError(GL_INVALID_OPERATION); in get_uniformfv()
569 ctx.endSection(); in get_uniformfv()
571 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_uniformfv()
572 ctx.glGetUniformfv (programEmpty, unif, ¶ms[0]); in get_uniformfv()
573 ctx.expectError(GL_INVALID_OPERATION); in get_uniformfv()
574 ctx.endSection(); in get_uniformfv()
576 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_uniformfv()
577 ctx.glGetUniformfv (program.getProgram(), -1, ¶ms[0]); in get_uniformfv()
578 ctx.expectError(GL_INVALID_OPERATION); in get_uniformfv()
579 ctx.endSection(); in get_uniformfv()
581 ctx.glDeleteShader(shader); in get_uniformfv()
582 ctx.glDeleteProgram(programEmpty); in get_uniformfv()
585 void get_nuniformfv (NegativeTestContext& ctx) in get_nuniformfv() argument
587 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in get_nuniformfv()
589 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_nuniformfv()
590 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4"); in get_nuniformfv()
596 ctx.glUseProgram(program.getProgram()); in get_nuniformfv()
599 ctx.fail("Failed to retrieve uniform location"); in get_nuniformfv()
601 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_nuniformfv()
602 programEmpty = ctx.glCreateProgram(); in get_nuniformfv()
604 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize); in get_nuniformfv()
606 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_nuniformfv()
607 ctx.glGetnUniformfv(-1, unif, bufferSize, ¶ms[0]); in get_nuniformfv()
608 ctx.expectError(GL_INVALID_VALUE); in get_nuniformfv()
609 ctx.endSection(); in get_nuniformfv()
611 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_nuniformfv()
612 ctx.glGetnUniformfv(shader, unif, bufferSize, ¶ms[0]); in get_nuniformfv()
613 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformfv()
614 ctx.endSection(); in get_nuniformfv()
616 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_nuniformfv()
617 ctx.glGetnUniformfv(programEmpty, unif, bufferSize, ¶ms[0]); in get_nuniformfv()
618 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformfv()
619 ctx.endSection(); in get_nuniformfv()
621 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_nuniformfv()
622 ctx.glGetnUniformfv(program.getProgram(), -1, bufferSize, ¶ms[0]); in get_nuniformfv()
623 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformfv()
624 ctx.endSection(); in get_nuniformfv()
626 …ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the reque… in get_nuniformfv()
627 ctx.glGetnUniformfv(program.getProgram(), unif, 0, ¶ms[0]); in get_nuniformfv()
628 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformfv()
629 ctx.endSection(); in get_nuniformfv()
631 ctx.glDeleteShader(shader); in get_nuniformfv()
632 ctx.glDeleteProgram(programEmpty); in get_nuniformfv()
635 void get_uniformiv (NegativeTestContext& ctx) in get_uniformiv() argument
637 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_uniformiv()
638 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4"); in get_uniformiv()
643 ctx.glUseProgram(program.getProgram()); in get_uniformiv()
646 ctx.fail("Failed to retrieve uniform location"); in get_uniformiv()
648 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_uniformiv()
649 programEmpty = ctx.glCreateProgram(); in get_uniformiv()
651 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_uniformiv()
652 ctx.glGetUniformiv (-1, unif, ¶ms[0]); in get_uniformiv()
653 ctx.expectError(GL_INVALID_VALUE); in get_uniformiv()
654 ctx.endSection(); in get_uniformiv()
656 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_uniformiv()
657 ctx.glGetUniformiv (shader, unif, ¶ms[0]); in get_uniformiv()
658 ctx.expectError(GL_INVALID_OPERATION); in get_uniformiv()
659 ctx.endSection(); in get_uniformiv()
661 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_uniformiv()
662 ctx.glGetUniformiv (programEmpty, unif, ¶ms[0]); in get_uniformiv()
663 ctx.expectError(GL_INVALID_OPERATION); in get_uniformiv()
664 ctx.endSection(); in get_uniformiv()
666 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_uniformiv()
667 ctx.glGetUniformiv (program.getProgram(), -1, ¶ms[0]); in get_uniformiv()
668 ctx.expectError(GL_INVALID_OPERATION); in get_uniformiv()
669 ctx.endSection(); in get_uniformiv()
671 ctx.glDeleteShader(shader); in get_uniformiv()
672 ctx.glDeleteProgram(programEmpty); in get_uniformiv()
675 void get_nuniformiv (NegativeTestContext& ctx) in get_nuniformiv() argument
677 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in get_nuniformiv()
679 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_nuniformiv()
680 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4"); in get_nuniformiv()
686 ctx.glUseProgram(program.getProgram()); in get_nuniformiv()
689 ctx.fail("Failed to retrieve uniform location"); in get_nuniformiv()
691 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_nuniformiv()
692 programEmpty = ctx.glCreateProgram(); in get_nuniformiv()
694 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize); in get_nuniformiv()
696 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_nuniformiv()
697 ctx.glGetnUniformiv(-1, unif, bufferSize, ¶ms[0]); in get_nuniformiv()
698 ctx.expectError(GL_INVALID_VALUE); in get_nuniformiv()
699 ctx.endSection(); in get_nuniformiv()
701 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_nuniformiv()
702 ctx.glGetnUniformiv(shader, unif, bufferSize, ¶ms[0]); in get_nuniformiv()
703 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformiv()
704 ctx.endSection(); in get_nuniformiv()
706 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_nuniformiv()
707 ctx.glGetnUniformiv(programEmpty, unif, bufferSize, ¶ms[0]); in get_nuniformiv()
708 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformiv()
709 ctx.endSection(); in get_nuniformiv()
711 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_nuniformiv()
712 ctx.glGetnUniformiv(program.getProgram(), -1, bufferSize, ¶ms[0]); in get_nuniformiv()
713 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformiv()
714 ctx.endSection(); in get_nuniformiv()
716 …ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the reque… in get_nuniformiv()
717 ctx.glGetnUniformiv(program.getProgram(), unif, - 1, ¶ms[0]); in get_nuniformiv()
718 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformiv()
719 ctx.endSection(); in get_nuniformiv()
721 ctx.glDeleteShader(shader); in get_nuniformiv()
722 ctx.glDeleteProgram(programEmpty); in get_nuniformiv()
725 void get_uniformuiv (NegativeTestContext& ctx) in get_uniformuiv() argument
727 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_uniformuiv()
728 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_uvec4"); in get_uniformuiv()
733 ctx.glUseProgram(program.getProgram()); in get_uniformuiv()
736 ctx.fail("Failed to retrieve uniform location"); in get_uniformuiv()
738 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_uniformuiv()
739 programEmpty = ctx.glCreateProgram(); in get_uniformuiv()
741 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_uniformuiv()
742 ctx.glGetUniformuiv (-1, unif, ¶ms[0]); in get_uniformuiv()
743 ctx.expectError(GL_INVALID_VALUE); in get_uniformuiv()
744 ctx.endSection(); in get_uniformuiv()
746 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_uniformuiv()
747 ctx.glGetUniformuiv (shader, unif, ¶ms[0]); in get_uniformuiv()
748 ctx.expectError(GL_INVALID_OPERATION); in get_uniformuiv()
749 ctx.endSection(); in get_uniformuiv()
751 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_uniformuiv()
752 ctx.glGetUniformuiv (programEmpty, unif, ¶ms[0]); in get_uniformuiv()
753 ctx.expectError(GL_INVALID_OPERATION); in get_uniformuiv()
754 ctx.endSection(); in get_uniformuiv()
756 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_uniformuiv()
757 ctx.glGetUniformuiv (program.getProgram(), -1, ¶ms[0]); in get_uniformuiv()
758 ctx.expectError(GL_INVALID_OPERATION); in get_uniformuiv()
759 ctx.endSection(); in get_uniformuiv()
761 ctx.glDeleteShader(shader); in get_uniformuiv()
762 ctx.glDeleteProgram(programEmpty); in get_uniformuiv()
765 void get_nuniformuiv (NegativeTestContext& ctx) in get_nuniformuiv() argument
767 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in get_nuniformuiv()
769 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_nuniformuiv()
770 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4"); in get_nuniformuiv()
776 ctx.glUseProgram(program.getProgram()); in get_nuniformuiv()
779 ctx.fail("Failed to retrieve uniform location"); in get_nuniformuiv()
781 shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_nuniformuiv()
782 programEmpty = ctx.glCreateProgram(); in get_nuniformuiv()
784 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize); in get_nuniformuiv()
786 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_nuniformuiv()
787 ctx.glGetnUniformuiv(-1, unif, bufferSize, ¶ms[0]); in get_nuniformuiv()
788 ctx.expectError(GL_INVALID_VALUE); in get_nuniformuiv()
789 ctx.endSection(); in get_nuniformuiv()
791 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_nuniformuiv()
792 ctx.glGetnUniformuiv(shader, unif, bufferSize, ¶ms[0]); in get_nuniformuiv()
793 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformuiv()
794 ctx.endSection(); in get_nuniformuiv()
796 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked."); in get_nuniformuiv()
797 ctx.glGetnUniformuiv(programEmpty, unif, bufferSize, ¶ms[0]); in get_nuniformuiv()
798 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformuiv()
799 ctx.endSection(); in get_nuniformuiv()
801 …ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uni… in get_nuniformuiv()
802 ctx.glGetnUniformuiv(program.getProgram(), -1, bufferSize, ¶ms[0]); in get_nuniformuiv()
803 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformuiv()
804 ctx.endSection(); in get_nuniformuiv()
806 …ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the reque… in get_nuniformuiv()
807 ctx.glGetnUniformuiv(program.getProgram(), unif, -1, ¶ms[0]); in get_nuniformuiv()
808 ctx.expectError(GL_INVALID_OPERATION); in get_nuniformuiv()
809 ctx.endSection(); in get_nuniformuiv()
811 ctx.glDeleteShader(shader); in get_nuniformuiv()
812 ctx.glDeleteProgram(programEmpty); in get_nuniformuiv()
815 void get_active_uniform (NegativeTestContext& ctx) in get_active_uniform() argument
817 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_active_uniform()
818 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_active_uniform()
821 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms); in get_active_uniform()
822 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected… in get_active_uniform()
824 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_active_uniform()
825 ctx.glGetActiveUniform(-1, 0, 0, 0, 0, 0, 0); in get_active_uniform()
826 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform()
827 ctx.endSection(); in get_active_uniform()
829 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_active_uniform()
830 ctx.glGetActiveUniform(shader, 0, 0, 0, 0, 0, 0); in get_active_uniform()
831 ctx.expectError(GL_INVALID_OPERATION); in get_active_uniform()
832 ctx.endSection(); in get_active_uniform()
834 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of… in get_active_uniform()
835 ctx.glUseProgram(program.getProgram()); in get_active_uniform()
836 ctx.glGetActiveUniform(program.getProgram(), numActiveUniforms, 0, 0, 0, 0, 0); in get_active_uniform()
837 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform()
838 ctx.endSection(); in get_active_uniform()
840 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0."); in get_active_uniform()
841 ctx.glGetActiveUniform(program.getProgram(), 0, -1, 0, 0, 0, 0); in get_active_uniform()
842 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform()
843 ctx.endSection(); in get_active_uniform()
845 ctx.glUseProgram(0); in get_active_uniform()
846 ctx.glDeleteShader(shader); in get_active_uniform()
849 void get_active_uniformsiv (NegativeTestContext& ctx) in get_active_uniformsiv() argument
851 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_active_uniformsiv()
852 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_active_uniformsiv()
857 ctx.glUseProgram(program.getProgram()); in get_active_uniformsiv()
859 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms); in get_active_uniformsiv()
860 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected… in get_active_uniformsiv()
862 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_active_uniformsiv()
863 ctx.glGetActiveUniformsiv(-1, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst); in get_active_uniformsiv()
864 ctx.expectError(GL_INVALID_VALUE); in get_active_uniformsiv()
865 ctx.endSection(); in get_active_uniformsiv()
867 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_active_uniformsiv()
868 ctx.glGetActiveUniformsiv(shader, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst); in get_active_uniformsiv()
869 ctx.expectError(GL_INVALID_OPERATION); in get_active_uniformsiv()
870 ctx.endSection(); in get_active_uniformsiv()
872 …ctx.beginSection("GL_INVALID_VALUE is generated if any value in uniformIndices is greater than or … in get_active_uniformsiv()
881 …ctx.glGetActiveUniformsiv(program.getProgram(), (GLsizei)invalidUniformIndices.size(), &invalidUni… in get_active_uniformsiv()
882 ctx.expectError(excess == 0 ? GL_NO_ERROR : GL_INVALID_VALUE); in get_active_uniformsiv()
884 ctx.endSection(); in get_active_uniformsiv()
886 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted token."); in get_active_uniformsiv()
887 ctx.glGetActiveUniformsiv(program.getProgram(), 1, &dummyUniformIndex, -1, &dummyParamDst); in get_active_uniformsiv()
888 ctx.expectError(GL_INVALID_ENUM); in get_active_uniformsiv()
889 ctx.endSection(); in get_active_uniformsiv()
891 ctx.glUseProgram(0); in get_active_uniformsiv()
892 ctx.glDeleteShader(shader); in get_active_uniformsiv()
895 void get_active_uniform_blockiv (NegativeTestContext& ctx) in get_active_uniform_blockiv() argument
897 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_active_uniform_blockiv()
898 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_active_uniform_blockiv()
902 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks); in get_active_uniform_blockiv()
903 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expe… in get_active_uniform_blockiv()
904 ctx.expectError(GL_NO_ERROR); in get_active_uniform_blockiv()
906 …ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or … in get_active_uniform_blockiv()
907 ctx.glGetActiveUniformBlockiv(-1, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms); in get_active_uniform_blockiv()
908 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform_blockiv()
909 ctx.endSection(); in get_active_uniform_blockiv()
911 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object"); in get_active_uniform_blockiv()
912 ctx.glGetActiveUniformBlockiv(shader, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms); in get_active_uniform_blockiv()
913 ctx.expectError(GL_INVALID_OPERATION); in get_active_uniform_blockiv()
914 ctx.endSection(); in get_active_uniform_blockiv()
916 …ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to t… in get_active_uniform_blockiv()
917 ctx.glUseProgram(program.getProgram()); in get_active_uniform_blockiv()
918 ctx.expectError(GL_NO_ERROR); in get_active_uniform_blockiv()
919 …ctx.glGetActiveUniformBlockiv(program.getProgram(), numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &pa… in get_active_uniform_blockiv()
920 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform_blockiv()
921 ctx.endSection(); in get_active_uniform_blockiv()
923 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens."); in get_active_uniform_blockiv()
924 ctx.glGetActiveUniformBlockiv(program.getProgram(), 0, -1, ¶ms); in get_active_uniform_blockiv()
925 ctx.expectError(GL_INVALID_ENUM); in get_active_uniform_blockiv()
926 ctx.endSection(); in get_active_uniform_blockiv()
928 ctx.glUseProgram(0); in get_active_uniform_blockiv()
931 void get_active_uniform_block_name (NegativeTestContext& ctx) in get_active_uniform_block_name() argument
933 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_active_uniform_block_name()
934 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_active_uniform_block_name()
941 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks); in get_active_uniform_block_name()
942 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expe… in get_active_uniform_block_name()
943 ctx.expectError(GL_NO_ERROR); in get_active_uniform_block_name()
945 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object."); in get_active_uniform_block_name()
946 …ctx.glGetActiveUniformBlockName(shader, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &unifo… in get_active_uniform_block_name()
947 ctx.expectError(GL_INVALID_OPERATION); in get_active_uniform_block_name()
948 ctx.endSection(); in get_active_uniform_block_name()
950 …ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or … in get_active_uniform_block_name()
951 …ctx.glGetActiveUniformBlockName(-1, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &uniformBl… in get_active_uniform_block_name()
952 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform_block_name()
953 ctx.endSection(); in get_active_uniform_block_name()
955 …ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to t… in get_active_uniform_block_name()
956 ctx.glUseProgram(program.getProgram()); in get_active_uniform_block_name()
957 ctx.expectError(GL_NO_ERROR); in get_active_uniform_block_name()
958 …ctx.glGetActiveUniformBlockName(program.getProgram(), numActiveBlocks, (int)sizeof(uniformBlockNam… in get_active_uniform_block_name()
959 ctx.expectError(GL_INVALID_VALUE); in get_active_uniform_block_name()
960 ctx.endSection(); in get_active_uniform_block_name()
962 ctx.glUseProgram(0); in get_active_uniform_block_name()
965 void get_active_attrib (NegativeTestContext& ctx) in get_active_attrib() argument
967 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_active_attrib()
968 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_active_attrib()
977 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_ATTRIBUTES, &numActiveAttributes); in get_active_attrib()
978 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_ATTRIBUTES = " << numActiveAttributes << " (expe… in get_active_attrib()
980 ctx.glUseProgram(program.getProgram()); in get_active_attrib()
982 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."); in get_active_attrib()
983 ctx.glGetActiveAttrib(-1, 0, 32, &length, &size, &type, &name[0]); in get_active_attrib()
984 ctx.expectError(GL_INVALID_VALUE); in get_active_attrib()
985 ctx.endSection(); in get_active_attrib()
987 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object."); in get_active_attrib()
988 ctx.glGetActiveAttrib(shader, 0, 32, &length, &size, &type, &name[0]); in get_active_attrib()
989 ctx.expectError(GL_INVALID_OPERATION); in get_active_attrib()
990 ctx.endSection(); in get_active_attrib()
992 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_ACTIVE_ATT… in get_active_attrib()
993 …ctx.glGetActiveAttrib(program.getProgram(), numActiveAttributes, (int)sizeof(name), &length, &size… in get_active_attrib()
994 ctx.expectError(GL_INVALID_VALUE); in get_active_attrib()
995 ctx.endSection(); in get_active_attrib()
997 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0."); in get_active_attrib()
998 ctx.glGetActiveAttrib(program.getProgram(), 0, -1, &length, &size, &type, &name[0]); in get_active_attrib()
999 ctx.expectError(GL_INVALID_VALUE); in get_active_attrib()
1000 ctx.endSection(); in get_active_attrib()
1002 ctx.glUseProgram(0); in get_active_attrib()
1003 ctx.glDeleteShader(shader); in get_active_attrib()
1006 void get_uniform_indices (NegativeTestContext& ctx) in get_uniform_indices() argument
1008 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_uniform_indices()
1009 …ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ct… in get_uniform_indices()
1015 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks); in get_uniform_indices()
1016 …ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << Test… in get_uniform_indices()
1017 ctx.expectError(GL_NO_ERROR); in get_uniform_indices()
1019 ctx.beginSection("GL_INVALID_OPERATION is generated if program is a name of shader object."); in get_uniform_indices()
1020 ctx.glGetUniformIndices(shader, 1, &uniformName, &uniformIndices); in get_uniform_indices()
1021 ctx.expectError(GL_INVALID_OPERATION); in get_uniform_indices()
1022 ctx.endSection(); in get_uniform_indices()
1024 …ctx.beginSection("GL_INVALID_VALUE is generated if program is not name of program or shader object… in get_uniform_indices()
1025 ctx.glGetUniformIndices(invalid, 1, &uniformName, &uniformIndices); in get_uniform_indices()
1026 ctx.expectError(GL_INVALID_VALUE); in get_uniform_indices()
1027 ctx.endSection(); in get_uniform_indices()
1029 ctx.glUseProgram(0); in get_uniform_indices()
1030 ctx.glDeleteShader(shader); in get_uniform_indices()
1033 void get_vertex_attribfv (NegativeTestContext& ctx) in get_vertex_attribfv() argument
1037 VAOHelper vao(ctx); in get_vertex_attribfv()
1039 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_vertex_attribfv()
1040 ctx.glGetVertexAttribfv(0, -1, ¶ms); in get_vertex_attribfv()
1041 ctx.expectError(GL_INVALID_ENUM); in get_vertex_attribfv()
1042 ctx.endSection(); in get_vertex_attribfv()
1044 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX… in get_vertex_attribfv()
1045 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); in get_vertex_attribfv()
1046 ctx.glGetVertexAttribfv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms); in get_vertex_attribfv()
1047 ctx.expectError(GL_INVALID_VALUE); in get_vertex_attribfv()
1048 ctx.endSection(); in get_vertex_attribfv()
1051 void get_vertex_attribiv (NegativeTestContext& ctx) in get_vertex_attribiv() argument
1055 VAOHelper vao(ctx); in get_vertex_attribiv()
1057 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_vertex_attribiv()
1058 ctx.glGetVertexAttribiv(0, -1, ¶ms); in get_vertex_attribiv()
1059 ctx.expectError(GL_INVALID_ENUM); in get_vertex_attribiv()
1060 ctx.endSection(); in get_vertex_attribiv()
1062 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX… in get_vertex_attribiv()
1063 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); in get_vertex_attribiv()
1064 ctx.glGetVertexAttribiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms); in get_vertex_attribiv()
1065 ctx.expectError(GL_INVALID_VALUE); in get_vertex_attribiv()
1066 ctx.endSection(); in get_vertex_attribiv()
1069 void get_vertex_attribi_iv (NegativeTestContext& ctx) in get_vertex_attribi_iv() argument
1073 VAOHelper vao(ctx); in get_vertex_attribi_iv()
1075 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_vertex_attribi_iv()
1076 ctx.glGetVertexAttribIiv(0, -1, ¶ms); in get_vertex_attribi_iv()
1077 ctx.expectError(GL_INVALID_ENUM); in get_vertex_attribi_iv()
1078 ctx.endSection(); in get_vertex_attribi_iv()
1080 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX… in get_vertex_attribi_iv()
1081 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); in get_vertex_attribi_iv()
1082 ctx.glGetVertexAttribIiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms); in get_vertex_attribi_iv()
1083 ctx.expectError(GL_INVALID_VALUE); in get_vertex_attribi_iv()
1084 ctx.endSection(); in get_vertex_attribi_iv()
1087 void get_vertex_attribi_uiv (NegativeTestContext& ctx) in get_vertex_attribi_uiv() argument
1091 VAOHelper vao(ctx); in get_vertex_attribi_uiv()
1094 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_vertex_attribi_uiv()
1095 ctx.glGetVertexAttribIuiv(0, -1, ¶ms); in get_vertex_attribi_uiv()
1096 ctx.expectError(GL_INVALID_ENUM); in get_vertex_attribi_uiv()
1097 ctx.endSection(); in get_vertex_attribi_uiv()
1099 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX… in get_vertex_attribi_uiv()
1100 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); in get_vertex_attribi_uiv()
1101 ctx.glGetVertexAttribIuiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms); in get_vertex_attribi_uiv()
1102 ctx.expectError(GL_INVALID_VALUE); in get_vertex_attribi_uiv()
1103 ctx.endSection(); in get_vertex_attribi_uiv()
1106 void get_vertex_attrib_pointerv (NegativeTestContext& ctx) in get_vertex_attrib_pointerv() argument
1111 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_vertex_attrib_pointerv()
1112 ctx.glGetVertexAttribPointerv(0, -1, &ptr[0]); in get_vertex_attrib_pointerv()
1113 ctx.expectError(GL_INVALID_ENUM); in get_vertex_attrib_pointerv()
1114 ctx.endSection(); in get_vertex_attrib_pointerv()
1116 …ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX… in get_vertex_attrib_pointerv()
1117 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); in get_vertex_attrib_pointerv()
1118 ctx.glGetVertexAttribPointerv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr[0]); in get_vertex_attrib_pointerv()
1119 ctx.expectError(GL_INVALID_VALUE); in get_vertex_attrib_pointerv()
1120 ctx.endSection(); in get_vertex_attrib_pointerv()
1123 void get_frag_data_location (NegativeTestContext& ctx) in get_frag_data_location() argument
1125 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER); in get_frag_data_location()
1126 GLuint program = ctx.glCreateProgram(); in get_frag_data_location()
1128 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object."); in get_frag_data_location()
1129 ctx.glGetFragDataLocation(shader, "gl_FragColor"); in get_frag_data_location()
1130 ctx.expectError(GL_INVALID_OPERATION); in get_frag_data_location()
1131 ctx.endSection(); in get_frag_data_location()
1133 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been linked."); in get_frag_data_location()
1134 ctx.glGetFragDataLocation(program, "gl_FragColor"); in get_frag_data_location()
1135 ctx.expectError(GL_INVALID_OPERATION); in get_frag_data_location()
1136 ctx.endSection(); in get_frag_data_location()
1138 ctx.glDeleteProgram(program); in get_frag_data_location()
1139 ctx.glDeleteShader(shader); in get_frag_data_location()
1144 void get_buffer_parameteriv (NegativeTestContext& ctx) in get_buffer_parameteriv() argument
1148 ctx.glGenBuffers(1, &buf); in get_buffer_parameteriv()
1149 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf); in get_buffer_parameteriv()
1151 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value."); in get_buffer_parameteriv()
1152 ctx.glGetBufferParameteriv(-1, GL_BUFFER_SIZE, ¶ms); in get_buffer_parameteriv()
1153 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteriv()
1154 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, -1, ¶ms); in get_buffer_parameteriv()
1155 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteriv()
1156 ctx.glGetBufferParameteriv(-1, -1, ¶ms); in get_buffer_parameteriv()
1157 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteriv()
1158 ctx.endSection(); in get_buffer_parameteriv()
1160 …ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound … in get_buffer_parameteriv()
1161 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0); in get_buffer_parameteriv()
1162 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms); in get_buffer_parameteriv()
1163 ctx.expectError(GL_INVALID_OPERATION); in get_buffer_parameteriv()
1164 ctx.endSection(); in get_buffer_parameteriv()
1166 ctx.glDeleteBuffers(1, &buf); in get_buffer_parameteriv()
1169 void get_buffer_parameteri64v (NegativeTestContext& ctx) in get_buffer_parameteri64v() argument
1173 ctx.glGenBuffers(1, &buf); in get_buffer_parameteri64v()
1174 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf); in get_buffer_parameteri64v()
1176 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value."); in get_buffer_parameteri64v()
1177 ctx.glGetBufferParameteri64v(-1, GL_BUFFER_SIZE, ¶ms); in get_buffer_parameteri64v()
1178 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteri64v()
1179 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER , -1, ¶ms); in get_buffer_parameteri64v()
1180 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteri64v()
1181 ctx.glGetBufferParameteri64v(-1, -1, ¶ms); in get_buffer_parameteri64v()
1182 ctx.expectError(GL_INVALID_ENUM); in get_buffer_parameteri64v()
1183 ctx.endSection(); in get_buffer_parameteri64v()
1185 …ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound … in get_buffer_parameteri64v()
1186 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0); in get_buffer_parameteri64v()
1187 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms); in get_buffer_parameteri64v()
1188 ctx.expectError(GL_INVALID_OPERATION); in get_buffer_parameteri64v()
1189 ctx.endSection(); in get_buffer_parameteri64v()
1191 ctx.glDeleteBuffers(1, &buf); in get_buffer_parameteri64v()
1194 void get_buffer_pointerv (NegativeTestContext& ctx) in get_buffer_pointerv() argument
1198 ctx.glGenBuffers(1, &buf); in get_buffer_pointerv()
1199 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf); in get_buffer_pointerv()
1201 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_buffer_pointerv()
1202 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, -1, ¶ms); in get_buffer_pointerv()
1203 ctx.expectError(GL_INVALID_ENUM); in get_buffer_pointerv()
1204 ctx.glGetBufferPointerv(-1, GL_BUFFER_MAP_POINTER, ¶ms); in get_buffer_pointerv()
1205 ctx.expectError(GL_INVALID_ENUM); in get_buffer_pointerv()
1206 ctx.endSection(); in get_buffer_pointerv()
1208 …ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound … in get_buffer_pointerv()
1209 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0); in get_buffer_pointerv()
1210 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, GL_BUFFER_MAP_POINTER, ¶ms); in get_buffer_pointerv()
1211 ctx.expectError(GL_INVALID_OPERATION); in get_buffer_pointerv()
1212 ctx.endSection(); in get_buffer_pointerv()
1214 ctx.glDeleteBuffers(1, &buf); in get_buffer_pointerv()
1217 void get_framebuffer_attachment_parameteriv (NegativeTestContext& ctx) in get_framebuffer_attachment_parameteriv() argument
1223 ctx.glGenFramebuffers (1, &fbo); in get_framebuffer_attachment_parameteriv()
1224 ctx.glGenRenderbuffers (2, rbo); in get_framebuffer_attachment_parameteriv()
1226 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo); in get_framebuffer_attachment_parameteriv()
1227 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]); in get_framebuffer_attachment_parameteriv()
1228 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, 16, 16); in get_framebuffer_attachment_parameteriv()
1229 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo[0]); in get_framebuffer_attachment_parameteriv()
1230 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]); in get_framebuffer_attachment_parameteriv()
1231 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_STENCIL_INDEX8, 16, 16); in get_framebuffer_attachment_parameteriv()
1232 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo[1]); in get_framebuffer_attachment_parameteriv()
1233 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER); in get_framebuffer_attachment_parameteriv()
1234 ctx.expectError (GL_NO_ERROR); in get_framebuffer_attachment_parameteriv()
1236 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); in get_framebuffer_attachment_parameteriv()
1237 …ctx.glGetFramebufferAttachmentParameteriv(-1, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJEC… in get_framebuffer_attachment_parameteriv()
1238 ctx.expectError(GL_INVALID_ENUM); in get_framebuffer_attachment_parameteriv()
1239 ctx.endSection(); in get_framebuffer_attachment_parameteriv()
1241 …ctx.beginSection("GL_INVALID_ENUM is generated if pname is not valid for the value of GL_FRAMEBUFF… in get_framebuffer_attachment_parameteriv()
1242 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTA… in get_framebuffer_attachment_parameteriv()
1243 ctx.expectError(GL_INVALID_ENUM); in get_framebuffer_attachment_parameteriv()
1244 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in get_framebuffer_attachment_parameteriv()
1246 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJEC… in get_framebuffer_attachment_parameteriv()
1247 ctx.expectError(GL_INVALID_ENUM); in get_framebuffer_attachment_parameteriv()
1248 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo); in get_framebuffer_attachment_parameteriv()
1249 ctx.endSection(); in get_framebuffer_attachment_parameteriv()
1251 …ctx.beginSection("GL_INVALID_OPERATION is generated if attachment is GL_DEPTH_STENCIL_ATTACHMENT a… in get_framebuffer_attachment_parameteriv()
1252 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_FRAMEBUF… in get_framebuffer_attachment_parameteriv()
1253 ctx.expectError(GL_INVALID_OPERATION); in get_framebuffer_attachment_parameteriv()
1254 ctx.endSection(); in get_framebuffer_attachment_parameteriv()
1256 …ctx.beginSection("GL_INVALID_OPERATION is generated if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJE… in get_framebuffer_attachment_parameteriv()
1257 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATT… in get_framebuffer_attachment_parameteriv()
1258 ctx.expectError(GL_NO_ERROR); in get_framebuffer_attachment_parameteriv()
1259 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATT… in get_framebuffer_attachment_parameteriv()
1260 ctx.expectError(GL_INVALID_OPERATION); in get_framebuffer_attachment_parameteriv()
1261 ctx.endSection(); in get_framebuffer_attachment_parameteriv()
1263 …ctx.beginSection("GL_INVALID_OPERATION or GL_INVALID_ENUM is generated if attachment is not one of… in get_framebuffer_attachment_parameteriv()
1264 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJEC… in get_framebuffer_attachment_parameteriv()
1265 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM); in get_framebuffer_attachment_parameteriv()
1266 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0); in get_framebuffer_attachment_parameteriv()
1267 …ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATT… in get_framebuffer_attachment_parameteriv()
1268 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM); in get_framebuffer_attachment_parameteriv()
1269 ctx.endSection(); in get_framebuffer_attachment_parameteriv()
1271 ctx.glDeleteFramebuffers(1, &fbo); in get_framebuffer_attachment_parameteriv()
1274 void get_renderbuffer_parameteriv (NegativeTestContext& ctx) in get_renderbuffer_parameteriv() argument
1278 ctx.glGenRenderbuffers(1, &rbo); in get_renderbuffer_parameteriv()
1279 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo); in get_renderbuffer_parameteriv()
1281 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in get_renderbuffer_parameteriv()
1282 ctx.glGetRenderbufferParameteriv(-1, GL_RENDERBUFFER_WIDTH, ¶ms[0]); in get_renderbuffer_parameteriv()
1283 ctx.expectError(GL_INVALID_ENUM); in get_renderbuffer_parameteriv()
1284 ctx.endSection(); in get_renderbuffer_parameteriv()
1286 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens."); in get_renderbuffer_parameteriv()
1287 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, -1, ¶ms[0]); in get_renderbuffer_parameteriv()
1288 ctx.expectError(GL_INVALID_ENUM); in get_renderbuffer_parameteriv()
1289 ctx.endSection(); in get_renderbuffer_parameteriv()
1291 …ctx.beginSection("GL_INVALID_OPERATION is generated if the renderbuffer currently bound to target… in get_renderbuffer_parameteriv()
1292 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0); in get_renderbuffer_parameteriv()
1293 ctx.expectError(GL_NO_ERROR); in get_renderbuffer_parameteriv()
1294 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, ¶ms[0]); in get_renderbuffer_parameteriv()
1295 ctx.expectError(GL_INVALID_OPERATION); in get_renderbuffer_parameteriv()
1296 ctx.endSection(); in get_renderbuffer_parameteriv()
1298 ctx.glDeleteRenderbuffers(1, &rbo); in get_renderbuffer_parameteriv()
1299 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0); in get_renderbuffer_parameteriv()
1302 void get_internalformativ (NegativeTestContext& ctx) in get_internalformativ() argument
1304 const bool isES = glu::isContextTypeES(ctx.getRenderContext().getType()); in get_internalformativ()
1309 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative."); in get_internalformativ()
1310 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, -1, ¶ms[0]); in get_internalformativ()
1311 ctx.expectError (GL_INVALID_VALUE); in get_internalformativ()
1312 ctx.endSection(); in get_internalformativ()
1314 …ctx.beginSection("GL_INVALID_ENUM is generated if pname is not GL_SAMPLES or GL_NUM_SAMPLE_COUNTS.… in get_internalformativ()
1315 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, -1, 16, ¶ms[0]); in get_internalformativ()
1316 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1317 ctx.endSection(); in get_internalformativ()
1319 …ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not color-, depth-, or stencil… in get_internalformativ()
1323 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_render_snorm")) in get_internalformativ()
1325 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RG8_SNORM, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]); in get_internalformativ()
1326 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1329 …ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_COMPRESSED_RGB8_ETC2, GL_NUM_SAMPLE_COUNTS, 16, &pa… in get_internalformativ()
1330 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1331 ctx.endSection(); in get_internalformativ()
1334 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER."); in get_internalformativ()
1335 ctx.glGetInternalformativ (-1, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]); in get_internalformativ()
1336 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1337 ctx.glGetInternalformativ (GL_FRAMEBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]); in get_internalformativ()
1338 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1340 if (isES && !ctx.getContextInfo().isExtensionSupported("GL_EXT_sparse_texture")) in get_internalformativ()
1342 ctx.glGetInternalformativ (GL_TEXTURE_2D, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]); in get_internalformativ()
1343 ctx.expectError (GL_INVALID_ENUM); in get_internalformativ()
1346 ctx.endSection(); in get_internalformativ()
1351 void get_queryiv (NegativeTestContext& ctx) in get_queryiv() argument
1355 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value."); in get_queryiv()
1356 ctx.glGetQueryiv (GL_ANY_SAMPLES_PASSED, -1, ¶ms); in get_queryiv()
1357 ctx.expectError (GL_INVALID_ENUM); in get_queryiv()
1358 ctx.glGetQueryiv (-1, GL_CURRENT_QUERY, ¶ms); in get_queryiv()
1359 ctx.expectError (GL_INVALID_ENUM); in get_queryiv()
1360 ctx.glGetQueryiv (-1, -1, ¶ms); in get_queryiv()
1361 ctx.expectError (GL_INVALID_ENUM); in get_queryiv()
1362 ctx.endSection(); in get_queryiv()
1365 void get_query_objectuiv (NegativeTestContext& ctx) in get_query_objectuiv() argument
1369 ctx.glGenQueries (1, &id); in get_query_objectuiv()
1371 ctx.beginSection("GL_INVALID_OPERATION is generated if id is not the name of a query object."); in get_query_objectuiv()
1372 ctx.glGetQueryObjectuiv (-1, GL_QUERY_RESULT_AVAILABLE, ¶ms); in get_query_objectuiv()
1373 ctx.expectError (GL_INVALID_OPERATION); in get_query_objectuiv()
1374 …ctx.getLog() << TestLog::Message << "// Note: " << id << " is not a query object yet, since it has… in get_query_objectuiv()
1375 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms); in get_query_objectuiv()
1376 ctx.expectError (GL_INVALID_OPERATION); in get_query_objectuiv()
1377 ctx.endSection(); in get_query_objectuiv()
1379 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id); in get_query_objectuiv()
1380 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED); in get_query_objectuiv()
1382 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value."); in get_query_objectuiv()
1383 ctx.glGetQueryObjectuiv (id, -1, ¶ms); in get_query_objectuiv()
1384 ctx.expectError (GL_INVALID_ENUM); in get_query_objectuiv()
1385 ctx.endSection(); in get_query_objectuiv()
1387 …ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of a currently active query … in get_query_objectuiv()
1388 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id); in get_query_objectuiv()
1389 ctx.expectError (GL_NO_ERROR); in get_query_objectuiv()
1390 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms); in get_query_objectuiv()
1391 ctx.expectError (GL_INVALID_OPERATION); in get_query_objectuiv()
1392 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED); in get_query_objectuiv()
1393 ctx.expectError (GL_NO_ERROR); in get_query_objectuiv()
1394 ctx.endSection(); in get_query_objectuiv()
1396 ctx.glDeleteQueries (1, &id); in get_query_objectuiv()
1401 void get_synciv (NegativeTestContext& ctx) in get_synciv() argument
1409 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object."); in get_synciv()
1410 ctx.glGetSynciv(0, GL_OBJECT_TYPE, 32, &length, &values[0]); in get_synciv()
1411 ctx.expectError(GL_INVALID_VALUE); in get_synciv()
1412 ctx.endSection(); in get_synciv()
1414 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens."); in get_synciv()
1415 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); in get_synciv()
1416 ctx.expectError(GL_NO_ERROR); in get_synciv()
1417 ctx.glGetSynciv(sync, -1, 32, &length, &values[0]); in get_synciv()
1418 ctx.expectError(GL_INVALID_ENUM); in get_synciv()
1419 ctx.endSection(); in get_synciv()
1421 ctx.glDeleteSync(sync); in get_synciv()
1423 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative."); in get_synciv()
1424 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); in get_synciv()
1425 ctx.expectError(GL_NO_ERROR); in get_synciv()
1426 ctx.glGetSynciv(sync, GL_OBJECT_TYPE, -1, &length, &values[0]); in get_synciv()
1427 ctx.expectError(GL_INVALID_VALUE); in get_synciv()
1428 ctx.endSection(); in get_synciv()
1430 ctx.glDeleteSync(sync); in get_synciv()
1435 void is_enabled (NegativeTestContext& ctx) in is_enabled() argument
1437 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value."); in is_enabled()
1438 ctx.glIsEnabled(-1); in is_enabled()
1439 ctx.expectError(GL_INVALID_ENUM); in is_enabled()
1440 ctx.glIsEnabled(GL_TRIANGLES); in is_enabled()
1441 ctx.expectError(GL_INVALID_ENUM); in is_enabled()
1442 ctx.endSection(); in is_enabled()
1445 void is_enabledi (NegativeTestContext& ctx) in is_enabledi() argument
1447 …TCU_CHECK_AND_THROW(NotSupportedError, checkSupport(ctx), "This test requires a higher context ver… in is_enabledi()
1449 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value."); in is_enabledi()
1450 ctx.glIsEnabledi(-1, 1); in is_enabledi()
1451 ctx.expectError(GL_INVALID_ENUM); in is_enabledi()
1452 ctx.glIsEnabledi(GL_TRIANGLES, 1); in is_enabledi()
1453 ctx.expectError(GL_INVALID_ENUM); in is_enabledi()
1454 ctx.endSection(); in is_enabledi()
1456 …ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for the indexe… in is_enabledi()
1457 ctx.glIsEnabledi(GL_BLEND, -1); in is_enabledi()
1458 ctx.expectError(GL_INVALID_VALUE); in is_enabledi()
1459 ctx.endSection(); in is_enabledi()
1464 void hint (NegativeTestContext& ctx) in hint() argument
1466 …ctx.beginSection("GL_INVALID_ENUM is generated if either target or mode is not an accepted value."… in hint()
1467 ctx.glHint(GL_GENERATE_MIPMAP_HINT, -1); in hint()
1468 ctx.expectError(GL_INVALID_ENUM); in hint()
1469 ctx.glHint(-1, GL_FASTEST); in hint()
1470 ctx.expectError(GL_INVALID_ENUM); in hint()
1471 ctx.glHint(-1, -1); in hint()
1472 ctx.expectError(GL_INVALID_ENUM); in hint()
1473 ctx.endSection(); in hint()