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 void blend_equationi (NegativeTestContext& ctx)
164 if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed"))
167 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
168 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.");
169 ctx.glBlendEquationi(0, -1);
170 ctx.expectError(GL_INVALID_ENUM);
171 ctx.endSection();
172 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
173 ctx.glBlendEquationi(-1, GL_FUNC_ADD);
174 ctx.expectError(GL_INVALID_VALUE);
175 ctx.glBlendEquationi(maxDrawBuffers, GL_FUNC_ADD);
176 ctx.expectError(GL_INVALID_VALUE);
177 ctx.endSection();
180 void blend_equation_separatei (NegativeTestContext& ctx)
184 if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed"))
187 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
188 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.");
189 ctx.glBlendEquationSeparatei(0, -1, GL_FUNC_ADD);
190 ctx.expectError(GL_INVALID_ENUM);
191 ctx.endSection();
192 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.");
193 ctx.glBlendEquationSeparatei(0, GL_FUNC_ADD, -1);
194 ctx.expectError(GL_INVALID_ENUM);
195 ctx.endSection();
196 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
197 ctx.glBlendEquationSeparatei(-1, GL_FUNC_ADD, GL_FUNC_ADD);
198 ctx.expectError(GL_INVALID_VALUE);
199 ctx.glBlendEquationSeparatei(maxDrawBuffers, GL_FUNC_ADD, GL_FUNC_ADD);
200 ctx.expectError(GL_INVALID_VALUE);
201 ctx.endSection();
204 void blend_func (NegativeTestContext& ctx)
206 ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
207 ctx.glBlendFunc(-1, GL_ONE);
208 ctx.expectError(GL_INVALID_ENUM);
209 ctx.glBlendFunc(GL_ONE, -1);
210 ctx.expectError(GL_INVALID_ENUM);
211 ctx.endSection();
214 void blend_func_separate (NegativeTestContext& ctx)
216 ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
217 ctx.glBlendFuncSeparate(-1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
218 ctx.expectError(GL_INVALID_ENUM);
219 ctx.glBlendFuncSeparate(GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
220 ctx.expectError(GL_INVALID_ENUM);
221 ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
222 ctx.expectError(GL_INVALID_ENUM);
223 ctx.glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
224 ctx.expectError(GL_INVALID_ENUM);
225 ctx.endSection();
228 void blend_funci (NegativeTestContext& ctx)
232 if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed"))
235 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
236 ctx.beginSection("GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
237 ctx.glBlendFunci(0, -1, GL_ONE);
238 ctx.expectError(GL_INVALID_ENUM);
239 ctx.glBlendFunci(0, GL_ONE, -1);
240 ctx.expectError(GL_INVALID_ENUM);
241 ctx.endSection();
242 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
243 ctx.glBlendFunci(-1, GL_ONE, GL_ONE);
244 ctx.expectError(GL_INVALID_VALUE);
245 ctx.glBlendFunci(maxDrawBuffers, GL_ONE, GL_ONE);
246 ctx.expectError(GL_INVALID_VALUE);
247 ctx.endSection();
250 void blend_func_separatei (NegativeTestContext& ctx)
254 if (!glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed"))
257 ctx.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
258 ctx.beginSection("GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
259 ctx.glBlendFuncSeparatei(0, -1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
260 ctx.expectError(GL_INVALID_ENUM);
261 ctx.glBlendFuncSeparatei(0, GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
262 ctx.expectError(GL_INVALID_ENUM);
263 ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
264 ctx.expectError(GL_INVALID_ENUM);
265 ctx.glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
266 ctx.expectError(GL_INVALID_ENUM);
267 ctx.endSection();
268 ctx.beginSection("GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one.");
269 ctx.glBlendFuncSeparatei(-1, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
270 ctx.expectError(GL_INVALID_VALUE);
271 ctx.glBlendFuncSeparatei(maxDrawBuffers, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
272 ctx.expectError(GL_INVALID_VALUE);
273 ctx.endSection();
277 void cull_face (NegativeTestContext& ctx)
279 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
280 ctx.glCullFace(-1);
281 ctx.expectError(GL_INVALID_ENUM);
282 ctx.endSection();
285 void front_face (NegativeTestContext& ctx)
287 ctx.beginSection("GL_INVALID_ENUM is generated if mode is not an accepted value.");
288 ctx.glFrontFace(-1);
289 ctx.expectError(GL_INVALID_ENUM);
290 ctx.endSection();
293 void line_width (NegativeTestContext& ctx)
295 ctx.beginSection("GL_INVALID_VALUE is generated if width is less than or equal to 0.");
296 ctx.glLineWidth(0);
297 ctx.expectError(GL_INVALID_VALUE);
298 ctx.glLineWidth(-1);
299 ctx.expectError(GL_INVALID_VALUE);
300 ctx.endSection();
304 void gen_queries (NegativeTestContext& ctx)
306 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
308 ctx.glGenQueries (-1, &ids);
309 ctx.expectError (GL_INVALID_VALUE);
310 ctx.endSection();
313 void begin_query (NegativeTestContext& ctx)
316 ctx.glGenQueries (3, ids);
318 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
319 ctx.glBeginQuery (-1, ids[0]);
320 ctx.expectError (GL_INVALID_ENUM);
321 ctx.endSection();
323 ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glBeginQuery is executed while a query object of the same target is already active.");
324 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]);
325 ctx.expectError (GL_NO_ERROR);
326 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[1]);
327 ctx.expectError (GL_INVALID_OPERATION);
329 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]);
330 ctx.expectError (GL_INVALID_OPERATION);
331 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]);
332 ctx.expectError (GL_NO_ERROR);
333 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]);
334 ctx.expectError (GL_INVALID_OPERATION);
335 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
336 ctx.glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
337 ctx.expectError (GL_NO_ERROR);
338 ctx.endSection();
340 ctx.beginSection("GL_INVALID_OPERATION is generated if id is 0.");
341 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, 0);
342 ctx.expectError (GL_INVALID_OPERATION);
343 ctx.endSection();
345 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.");
346 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, -1);
347 ctx.expectError (GL_INVALID_OPERATION);
348 ctx.glDeleteQueries (1, &ids[2]);
349 ctx.expectError (GL_NO_ERROR);
350 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[2]);
351 ctx.expectError (GL_INVALID_OPERATION);
352 ctx.endSection();
354 ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of an already active query object.");
355 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]);
356 ctx.expectError (GL_NO_ERROR);
357 ctx.glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
358 ctx.expectError (GL_INVALID_OPERATION);
359 ctx.endSection();
361 ctx.beginSection("GL_INVALID_OPERATION is generated if id refers to an existing query object whose type does not does not match target.");
362 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
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.glDeleteQueries (2, &ids[0]);
369 ctx.expectError (GL_NO_ERROR);
372 void end_query (NegativeTestContext& ctx)
375 ctx.glGenQueries (1, &id);
377 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
378 ctx.glEndQuery (-1);
379 ctx.expectError (GL_INVALID_ENUM);
380 ctx.endSection();
382 ctx.beginSection("GL_INVALID_OPERATION is generated if ctx.glEndQuery is executed when a query object of the same target is not active.");
383 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
384 ctx.expectError (GL_INVALID_OPERATION);
385 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
386 ctx.expectError (GL_NO_ERROR);
387 ctx.glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
388 ctx.expectError (GL_INVALID_OPERATION);
389 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
390 ctx.expectError (GL_NO_ERROR);
391 ctx.endSection();
393 ctx.glDeleteQueries (1, &id);
394 ctx.expectError (GL_NO_ERROR);
397 void delete_queries (NegativeTestContext& ctx)
400 ctx.glGenQueries (1, &id);
402 ctx.beginSection("GL_INVALID_VALUE is generated if n is negative.");
403 ctx.glDeleteQueries (-1, &id);
404 ctx.expectError (GL_INVALID_VALUE);
405 ctx.endSection();
407 ctx.glDeleteQueries (1, &id);
411 void fence_sync (NegativeTestContext& ctx)
413 ctx.beginSection("GL_INVALID_ENUM is generated if condition is not GL_SYNC_GPU_COMMANDS_COMPLETE.");
414 ctx.glFenceSync(-1, 0);
415 ctx.expectError(GL_INVALID_ENUM);
416 ctx.endSection();
418 ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
419 ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0x0010);
420 ctx.expectError(GL_INVALID_VALUE);
421 ctx.endSection();
424 void wait_sync (NegativeTestContext& ctx)
426 GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
428 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
429 ctx.glWaitSync(0, 0, GL_TIMEOUT_IGNORED);
430 ctx.expectError(GL_INVALID_VALUE);
431 ctx.endSection();
433 ctx.beginSection("GL_INVALID_VALUE is generated if flags is not zero.");
434 ctx.glWaitSync(sync, 0x0010, GL_TIMEOUT_IGNORED);
435 ctx.expectError(GL_INVALID_VALUE);
436 ctx.endSection();
438 ctx.beginSection("GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED.");
439 ctx.glWaitSync(sync, 0, 0);
440 ctx.expectError(GL_INVALID_VALUE);
441 ctx.endSection();
443 ctx.glDeleteSync(sync);
446 void client_wait_sync (NegativeTestContext& ctx)
448 GLsync sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
450 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of an existing sync object.");
451 ctx.glClientWaitSync (0, 0, 10000);
452 ctx.expectError(GL_INVALID_VALUE);
453 ctx.endSection();
455 ctx.beginSection("GL_INVALID_VALUE is generated if flags contains any unsupported flag.");
456 ctx.glClientWaitSync(sync, 0x00000004, 10000);
457 ctx.expectError(GL_INVALID_VALUE);
458 ctx.endSection();
460 ctx.glDeleteSync(sync);
463 void delete_sync (NegativeTestContext& ctx)
465 ctx.beginSection("GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object.");
466 ctx.glDeleteSync((GLsync)1);
467 ctx.expectError(GL_INVALID_VALUE);
468 ctx.glDeleteSync(0);
469 ctx.expectError(GL_NO_ERROR);
470 ctx.endSection();