Lines Matching refs:ctx

48 void scissor (NegativeTestContext& ctx)
50 ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative.");
51 ctx.glScissor(0, 0, -1, 0);
52 ctx.expectError(GL_INVALID_VALUE);
53 ctx.glScissor(0, 0, 0, -1);
54 ctx.expectError(GL_INVALID_VALUE);
55 ctx.glScissor(0, 0, -1, -1);
56 ctx.expectError(GL_INVALID_VALUE);
57 ctx.endSection();
60 void depth_func (NegativeTestContext& ctx)
62 ctx.beginSection("GL_INVALID_ENUM is generated if func is not an accepted value.");
63 ctx.glDepthFunc(-1);
64 ctx.expectError(GL_INVALID_ENUM);
65 ctx.endSection();
68 void viewport (NegativeTestContext& ctx)
70 ctx.beginSection("GL_INVALID_VALUE is generated if either width or height is negative.");
71 ctx.glViewport(0, 0, -1, 1);
72 ctx.expectError(GL_INVALID_VALUE);
73 ctx.glViewport(0, 0, 1, -1);
74 ctx.expectError(GL_INVALID_VALUE);
75 ctx.glViewport(0, 0, -1, -1);
76 ctx.expectError(GL_INVALID_VALUE);
77 ctx.endSection();
81 void stencil_func (NegativeTestContext& ctx)
83 ctx.beginSection("GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
84 ctx.glStencilFunc(-1, 0, 1);
85 ctx.expectError(GL_INVALID_ENUM);
86 ctx.endSection();
89 void stencil_func_separate (NegativeTestContext& ctx)
91 ctx.beginSection("GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
92 ctx.glStencilFuncSeparate(-1, GL_NEVER, 0, 1);
93 ctx.expectError(GL_INVALID_ENUM);
94 ctx.endSection();
96 ctx.beginSection("GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
97 ctx.glStencilFuncSeparate(GL_FRONT, -1, 0, 1);
98 ctx.expectError(GL_INVALID_ENUM);
99 ctx.endSection();
102 void stencil_op (NegativeTestContext& ctx)
104 ctx.beginSection("GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the defined symbolic constant values.");
105 ctx.glStencilOp(-1, GL_ZERO, GL_REPLACE);
106 ctx.expectError(GL_INVALID_ENUM);
107 ctx.glStencilOp(GL_KEEP, -1, GL_REPLACE);
108 ctx.expectError(GL_INVALID_ENUM);
109 ctx.glStencilOp(GL_KEEP, GL_ZERO, -1);
110 ctx.expectError(GL_INVALID_ENUM);
111 ctx.endSection();
114 void stencil_op_separate (NegativeTestContext& ctx)
116 ctx.beginSection("GL_INVALID_ENUM is generated if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
117 ctx.glStencilOpSeparate(-1, GL_KEEP, GL_ZERO, GL_REPLACE);
118 ctx.expectError(GL_INVALID_ENUM);
119 ctx.endSection();
121 ctx.beginSection("GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values.");
122 ctx.glStencilOpSeparate(GL_FRONT, -1, GL_ZERO, GL_REPLACE);
123 ctx.expectError(GL_INVALID_ENUM);
124 ctx.glStencilOpSeparate(GL_FRONT, GL_KEEP, -1, GL_REPLACE);
125 ctx.expectError(GL_INVALID_ENUM);
126 ctx.glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_ZERO, -1);
127 ctx.expectError(GL_INVALID_ENUM);
128 ctx.endSection();
131 void stencil_mask_separate (NegativeTestContext& ctx)
133 ctx.beginSection("GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
134 ctx.glStencilMaskSeparate(-1, 0);
135 ctx.expectError(GL_INVALID_ENUM);
136 ctx.endSection();
140 void blend_equation (NegativeTestContext& ctx)
142 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
143 ctx.glBlendEquation(-1);
144 ctx.expectError(GL_INVALID_ENUM);
145 ctx.endSection();
148 void blend_equation_separate (NegativeTestContext& ctx)
150 ctx.beginSection("GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
151 ctx.glBlendEquationSeparate(-1, GL_FUNC_ADD);
152 ctx.expectError(GL_INVALID_ENUM);
153 ctx.endSection();
154 ctx.beginSection("GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
155 ctx.glBlendEquationSeparate(GL_FUNC_ADD, -1);
156 ctx.expectError(GL_INVALID_ENUM);
157 ctx.endSection();
160 static bool checkSupport(NegativeTestContext& ctx)
162 return contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
163 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::core(4, 5)) ||
164 ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed");
167 void blend_equationi (NegativeTestContext& ctx)
171 if (!checkSupport(ctx))
174 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
175 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
176 ctx.glBlendEquationi(0, -1);
177 ctx.expectError(GL_INVALID_ENUM);
178 ctx.endSection();
179 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
180 ctx.glBlendEquationi(-1, GL_FUNC_ADD);
181 ctx.expectError(GL_INVALID_VALUE);
182 ctx.glBlendEquationi(maxDrawBuffers, GL_FUNC_ADD);
183 ctx.expectError(GL_INVALID_VALUE);
184 ctx.endSection();
187 void blend_equation_separatei (NegativeTestContext& ctx)
191 if (!checkSupport(ctx))
194 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
195 ctx.beginSection("GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
196 ctx.glBlendEquationSeparatei(0, -1, GL_FUNC_ADD);
197 ctx.expectError(GL_INVALID_ENUM);
198 ctx.endSection();
199 ctx.beginSection("GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
200 ctx.glBlendEquationSeparatei(0, GL_FUNC_ADD, -1);
201 ctx.expectError(GL_INVALID_ENUM);
202 ctx.endSection();
203 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
204 ctx.glBlendEquationSeparatei(-1, GL_FUNC_ADD, GL_FUNC_ADD);
205 ctx.expectError(GL_INVALID_VALUE);
206 ctx.glBlendEquationSeparatei(maxDrawBuffers, GL_FUNC_ADD, GL_FUNC_ADD);
207 ctx.expectError(GL_INVALID_VALUE);
208 ctx.endSection();
211 void blend_func (NegativeTestContext& ctx)
213 ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
214 ctx.glBlendFunc(-1, GL_ONE);
215 ctx.expectError(GL_INVALID_ENUM);
216 ctx.glBlendFunc(GL_ONE, -1);
217 ctx.expectError(GL_INVALID_ENUM);
218 ctx.endSection();
221 void blend_func_separate (NegativeTestContext& ctx)
223 ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
224 ctx.glBlendFuncSeparate(-1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
225 ctx.expectError(GL_INVALID_ENUM);
226 ctx.glBlendFuncSeparate(GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
227 ctx.expectError(GL_INVALID_ENUM);
228 ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
229 ctx.expectError(GL_INVALID_ENUM);
230 ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
231 ctx.expectError(GL_INVALID_ENUM);
232 ctx.endSection();
235 void blend_funci (NegativeTestContext& ctx)
239 if (!checkSupport(ctx))
242 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
243 ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
244 ctx.glBlendFunci(0, -1, GL_ONE);
245 ctx.expectError(GL_INVALID_ENUM);
246 ctx.glBlendFunci(0, GL_ONE, -1);
247 ctx.expectError(GL_INVALID_ENUM);
248 ctx.endSection();
249 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
250 ctx.glBlendFunci(-1, GL_ONE, GL_ONE);
251 ctx.expectError(GL_INVALID_VALUE);
252 ctx.glBlendFunci(maxDrawBuffers, GL_ONE, GL_ONE);
253 ctx.expectError(GL_INVALID_VALUE);
254 ctx.endSection();
257 void blend_func_separatei (NegativeTestContext& ctx)
261 if (!checkSupport(ctx))
264 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
265 ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
266 ctx.glBlendFuncSeparatei(0, -1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
267 ctx.expectError(GL_INVALID_ENUM);
268 ctx.glBlendFuncSeparatei(0, GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
269 ctx.expectError(GL_INVALID_ENUM);
270 ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
271 ctx.expectError(GL_INVALID_ENUM);
272 ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
273 ctx.expectError(GL_INVALID_ENUM);
274 ctx.endSection();
275 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
276 ctx.glBlendFuncSeparatei(-1, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
277 ctx.expectError(GL_INVALID_VALUE);
278 ctx.glBlendFuncSeparatei(maxDrawBuffers, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
279 ctx.expectError(GL_INVALID_VALUE);
280 ctx.endSection();
284 void cull_face (NegativeTestContext& ctx)
286 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
287 ctx.glCullFace(-1);
288 ctx.expectError(GL_INVALID_ENUM);
289 ctx.endSection();
292 void front_face (NegativeTestContext& ctx)
294 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
295 ctx.glFrontFace(-1);
296 ctx.expectError(GL_INVALID_ENUM);
297 ctx.endSection();
300 void line_width (NegativeTestContext& ctx)
302 ctx.beginSection("GL_INVALID_VALUE is generated if width is less than or equal to 0.");
303 ctx.glLineWidth(0);
304 ctx.expectError(GL_INVALID_VALUE);
305 ctx.glLineWidth(-1);
306 ctx.expectError(GL_INVALID_VALUE);
307 ctx.endSection();
311 void gen_queries (NegativeTestContext& ctx)
313 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
315 ctx.glGenQueries (-1, &ids);
316 ctx.expectError (GL_INVALID_VALUE);
317 ctx.endSection();
320 void begin_query (NegativeTestContext& ctx)
323 ctx.glGenQueries (3, ids);
325 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
326 ctx.glBeginQuery (-1, ids[0]);
327 ctx.expectError (GL_INVALID_ENUM);
328 ctx.endSection();
330 ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glBeginQuery is executed while a query object of the same target is already active.");
331 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]);
332 ctx.expectError (GL_NO_ERROR);
333 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[1]);
334 ctx.expectError (GL_INVALID_OPERATION);
336 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]);
337 ctx.expectError (GL_INVALID_OPERATION);
338 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]);
339 ctx.expectError (GL_NO_ERROR);
340 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]);
341 ctx.expectError (GL_INVALID_OPERATION);
342 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
343 ctx.glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
344 ctx.expectError (GL_NO_ERROR);
345 ctx.endSection();
347 ctx.beginSection("GL_INVALID_OPERATION is generated if id is 0.");
348 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, 0);
349 ctx.expectError (GL_INVALID_OPERATION);
350 ctx.endSection();
352 ctx.beginSection("GL_INVALID_OPERATION is generated if id not a name returned from a previous call to ctx.glGenQueries, or if such a name has since been deleted with ctx.glDeleteQueries.");
353 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, -1);
354 ctx.expectError (GL_INVALID_OPERATION);
355 ctx.glDeleteQueries (1, &ids[2]);
356 ctx.expectError (GL_NO_ERROR);
357 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[2]);
358 ctx.expectError (GL_INVALID_OPERATION);
359 ctx.endSection();
361 ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of an already active query object.");
362 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]);
363 ctx.expectError (GL_NO_ERROR);
364 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
365 ctx.expectError (GL_INVALID_OPERATION);
366 ctx.endSection();
368 ctx.beginSection("GL_INVALID_OPERATION is generated if id refers to an existing query object whose type does not does not match target.");
369 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
370 ctx.expectError (GL_NO_ERROR);
371 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
372 ctx.expectError (GL_INVALID_OPERATION);
373 ctx.endSection();
375 ctx.glDeleteQueries (2, &ids[0]);
376 ctx.expectError (GL_NO_ERROR);
379 void end_query (NegativeTestContext& ctx)
382 ctx.glGenQueries (1, &id);
384 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
385 ctx.glEndQuery (-1);
386 ctx.expectError (GL_INVALID_ENUM);
387 ctx.endSection();
389 ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glEndQuery is executed when a query object of the same target is not active.");
390 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
391 ctx.expectError (GL_INVALID_OPERATION);
392 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
393 ctx.expectError (GL_NO_ERROR);
394 ctx.glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
395 ctx.expectError (GL_INVALID_OPERATION);
396 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
397 ctx.expectError (GL_NO_ERROR);
398 ctx.endSection();
400 ctx.glDeleteQueries (1, &id);
401 ctx.expectError (GL_NO_ERROR);
404 void delete_queries (NegativeTestContext& ctx)
407 ctx.glGenQueries (1, &id);
409 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
410 ctx.glDeleteQueries (-1, &id);
411 ctx.expectError (GL_INVALID_VALUE);
412 ctx.endSection();
414 ctx.glDeleteQueries (1, &id);
418 void fence_sync (NegativeTestContext& ctx)
420 ctx.beginSection("GL_INVALID_ENUM is generated if condition is not GL_SYNC_GPU_COMMANDS_COMPLETE.");
421 ctx.glFenceSync(-1, 0);
422 ctx.expectError(GL_INVALID_ENUM);
423 ctx.endSection();
425 ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
426 ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0x0010);
427 ctx.expectError(GL_INVALID_VALUE);
428 ctx.endSection();
431 void wait_sync (NegativeTestContext& ctx)
433 GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
435 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
436 ctx.glWaitSync(0, 0, GL_TIMEOUT_IGNORED);
437 ctx.expectError(GL_INVALID_VALUE);
438 ctx.endSection();
440 ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
441 ctx.glWaitSync(sync, 0x0010, GL_TIMEOUT_IGNORED);
442 ctx.expectError(GL_INVALID_VALUE);
443 ctx.endSection();
445 ctx.beginSection("GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED.");
446 ctx.glWaitSync(sync, 0, 0);
447 ctx.expectError(GL_INVALID_VALUE);
448 ctx.endSection();
450 ctx.glDeleteSync(sync);
453 void client_wait_sync (NegativeTestContext& ctx)
455 GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
457 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of an existing sync object.");
458 ctx.glClientWaitSync (0, 0, 10000);
459 ctx.expectError(GL_INVALID_VALUE);
460 ctx.endSection();
462 ctx.beginSection("GL_INVALID_VALUE is generated if flags contains any unsupported flag.");
463 ctx.glClientWaitSync(sync, 0x00000004, 10000);
464 ctx.expectError(GL_INVALID_VALUE);
465 ctx.endSection();
467 ctx.glDeleteSync(sync);
470 void delete_sync (NegativeTestContext& ctx)
472 ctx.beginSection("GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object.");
473 ctx.glDeleteSync((GLsync)1);
474 ctx.expectError(GL_INVALID_VALUE);
475 ctx.glDeleteSync(0);
476 ctx.expectError(GL_NO_ERROR);
477 ctx.endSection();