1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
4 *
5 * Copyright 2014 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 *//*!
20 * \file
21 * \brief Negative Fragment Pipe API tests.
22 *//*--------------------------------------------------------------------*/
23
24 #include "es3fNegativeFragmentApiTests.hpp"
25 #include "es3fApiCase.hpp"
26
27 #include "gluContextInfo.hpp"
28 #include "glwDefs.hpp"
29 #include "glwEnums.hpp"
30
31 using namespace glw; // GL types
32
33 namespace deqp
34 {
35 namespace gles3
36 {
37 namespace Functional
38 {
39
40 using tcu::TestLog;
41
checkDrawBuffersIndexedSupport(Context & ctx)42 static bool checkDrawBuffersIndexedSupport(Context &ctx)
43 {
44 return contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
45 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::core(4, 5)) ||
46 ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed");
47 }
48
NegativeFragmentApiTests(Context & context)49 NegativeFragmentApiTests::NegativeFragmentApiTests(Context &context)
50 : TestCaseGroup(context, "fragment", "Negative Fragment API Cases")
51 {
52 }
53
~NegativeFragmentApiTests(void)54 NegativeFragmentApiTests::~NegativeFragmentApiTests(void)
55 {
56 }
57
init(void)58 void NegativeFragmentApiTests::init(void)
59 {
60 ES3F_ADD_API_CASE(scissor, "Invalid glScissor() usage", {
61 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if either width or height is negative.");
62 glScissor(0, 0, -1, 0);
63 expectError(GL_INVALID_VALUE);
64 glScissor(0, 0, 0, -1);
65 expectError(GL_INVALID_VALUE);
66 glScissor(0, 0, -1, -1);
67 expectError(GL_INVALID_VALUE);
68 m_log << TestLog::EndSection;
69 });
70 ES3F_ADD_API_CASE(depth_func, "Invalid glDepthFunc() usage", {
71 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not an accepted value.");
72 glDepthFunc(-1);
73 expectError(GL_INVALID_ENUM);
74 m_log << TestLog::EndSection;
75 });
76 ES3F_ADD_API_CASE(viewport, "Invalid glViewport() usage", {
77 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if either width or height is negative.");
78 glViewport(0, 0, -1, 1);
79 expectError(GL_INVALID_VALUE);
80 glViewport(0, 0, 1, -1);
81 expectError(GL_INVALID_VALUE);
82 glViewport(0, 0, -1, -1);
83 expectError(GL_INVALID_VALUE);
84 m_log << TestLog::EndSection;
85 });
86
87 // Stencil functions
88
89 ES3F_ADD_API_CASE(stencil_func, "Invalid glStencilFunc() usage", {
90 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
91 glStencilFunc(-1, 0, 1);
92 expectError(GL_INVALID_ENUM);
93 m_log << TestLog::EndSection;
94 });
95 ES3F_ADD_API_CASE(stencil_func_separate, "Invalid glStencilFuncSeparate() usage", {
96 m_log << TestLog::Section(
97 "", "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
98 glStencilFuncSeparate(-1, GL_NEVER, 0, 1);
99 expectError(GL_INVALID_ENUM);
100 m_log << TestLog::EndSection;
101
102 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not one of the eight accepted values.");
103 glStencilFuncSeparate(GL_FRONT, -1, 0, 1);
104 expectError(GL_INVALID_ENUM);
105 m_log << TestLog::EndSection;
106 });
107 ES3F_ADD_API_CASE(stencil_op, "Invalid glStencilOp() usage", {
108 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other "
109 "than the defined symbolic constant values.");
110 glStencilOp(-1, GL_ZERO, GL_REPLACE);
111 expectError(GL_INVALID_ENUM);
112 glStencilOp(GL_KEEP, -1, GL_REPLACE);
113 expectError(GL_INVALID_ENUM);
114 glStencilOp(GL_KEEP, GL_ZERO, -1);
115 expectError(GL_INVALID_ENUM);
116 m_log << TestLog::EndSection;
117 });
118 ES3F_ADD_API_CASE(stencil_op_separate, "Invalid glStencilOpSeparate() usage", {
119 m_log << TestLog::Section(
120 "",
121 "GL_INVALID_ENUM is generated if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
122 glStencilOpSeparate(-1, GL_KEEP, GL_ZERO, GL_REPLACE);
123 expectError(GL_INVALID_ENUM);
124 m_log << TestLog::EndSection;
125
126 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other "
127 "than the eight defined symbolic constant values.");
128 glStencilOpSeparate(GL_FRONT, -1, GL_ZERO, GL_REPLACE);
129 expectError(GL_INVALID_ENUM);
130 glStencilOpSeparate(GL_FRONT, GL_KEEP, -1, GL_REPLACE);
131 expectError(GL_INVALID_ENUM);
132 glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_ZERO, -1);
133 expectError(GL_INVALID_ENUM);
134 m_log << TestLog::EndSection;
135 });
136 ES3F_ADD_API_CASE(stencil_mask_separate, "Invalid glStencilMaskSeparate() usage", {
137 m_log << TestLog::Section(
138 "", "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.");
139 glStencilMaskSeparate(-1, 0);
140 expectError(GL_INVALID_ENUM);
141 m_log << TestLog::EndSection;
142 });
143
144 // Blend functions
145
146 ES3F_ADD_API_CASE(blend_equation, "Invalid glBlendEquation() usage", {
147 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
148 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
149 glBlendEquation(-1);
150 expectError(GL_INVALID_ENUM);
151 m_log << TestLog::EndSection;
152 });
153 ES3F_ADD_API_CASE(blend_equation_separate, "Invalid glBlendEquationSeparate() usage", {
154 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
155 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
156 glBlendEquationSeparate(-1, GL_FUNC_ADD);
157 expectError(GL_INVALID_ENUM);
158 m_log << TestLog::EndSection;
159 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
160 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
161 glBlendEquationSeparate(GL_FUNC_ADD, -1);
162 expectError(GL_INVALID_ENUM);
163 m_log << TestLog::EndSection;
164 });
165 ES3F_ADD_API_CASE(blend_func, "Invalid glBlendFunc() usage", {
166 m_log << TestLog::Section(
167 "", "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
168 glBlendFunc(-1, GL_ONE);
169 expectError(GL_INVALID_ENUM);
170 glBlendFunc(GL_ONE, -1);
171 expectError(GL_INVALID_ENUM);
172 m_log << TestLog::EndSection;
173 });
174 ES3F_ADD_API_CASE(blend_func_separate, "Invalid glBlendFuncSeparate() usage", {
175 m_log << TestLog::Section(
176 "", "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
177 glBlendFuncSeparate(-1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
178 expectError(GL_INVALID_ENUM);
179 glBlendFuncSeparate(GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
180 expectError(GL_INVALID_ENUM);
181 glBlendFuncSeparate(GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
182 expectError(GL_INVALID_ENUM);
183 glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
184 expectError(GL_INVALID_ENUM);
185 m_log << TestLog::EndSection;
186 });
187 ES3F_ADD_API_CASE(blend_equationi, "Invalid glBlendEquationi() usage", {
188 glw::GLint maxDrawBuffers = -1;
189 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
190 if (!checkDrawBuffersIndexedSupport(m_context))
191 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
192 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
193 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
194 glBlendEquationi(0, -1);
195 expectError(GL_INVALID_ENUM);
196 m_log << TestLog::EndSection;
197 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of "
198 "MAX_DRAW_BUFFERS minus one.");
199 glBlendEquationi(-1, GL_FUNC_ADD);
200 expectError(GL_INVALID_VALUE);
201 glBlendEquationi(maxDrawBuffers, GL_FUNC_ADD);
202 expectError(GL_INVALID_VALUE);
203 m_log << TestLog::EndSection;
204 });
205 ES3F_ADD_API_CASE(blend_equation_separatei, "Invalid glBlendEquationSeparatei() usage", {
206 glw::GLint maxDrawBuffers = -1;
207 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
208 if (!checkDrawBuffersIndexedSupport(m_context))
209 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
210 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
211 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
212 glBlendEquationSeparatei(0, -1, GL_FUNC_ADD);
213 expectError(GL_INVALID_ENUM);
214 m_log << TestLog::EndSection;
215 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, "
216 "GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN.");
217 glBlendEquationSeparatei(0, GL_FUNC_ADD, -1);
218 expectError(GL_INVALID_ENUM);
219 m_log << TestLog::EndSection;
220 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of "
221 "MAX_DRAW_BUFFERS minus one.");
222 glBlendEquationSeparatei(-1, GL_FUNC_ADD, GL_FUNC_ADD);
223 expectError(GL_INVALID_VALUE);
224 glBlendEquationSeparatei(maxDrawBuffers, GL_FUNC_ADD, GL_FUNC_ADD);
225 expectError(GL_INVALID_VALUE);
226 m_log << TestLog::EndSection;
227 });
228 ES3F_ADD_API_CASE(blend_funci, "Invalid glBlendFunci() usage", {
229 glw::GLint maxDrawBuffers = -1;
230 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
231 if (!checkDrawBuffersIndexedSupport(m_context))
232 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
233 m_log << TestLog::Section(
234 "", "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.");
235 glBlendFunci(0, -1, GL_ONE);
236 expectError(GL_INVALID_ENUM);
237 glBlendFunci(0, GL_ONE, -1);
238 expectError(GL_INVALID_ENUM);
239 m_log << TestLog::EndSection;
240 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of "
241 "MAX_DRAW_BUFFERS minus one.");
242 glBlendFunci(-1, GL_ONE, GL_ONE);
243 expectError(GL_INVALID_VALUE);
244 glBlendFunci(maxDrawBuffers, GL_ONE, GL_ONE);
245 expectError(GL_INVALID_VALUE);
246 m_log << TestLog::EndSection;
247 });
248 ES3F_ADD_API_CASE(blend_func_separatei, "Invalid glBlendFuncSeparatei() usage", {
249 glw::GLint maxDrawBuffers = -1;
250 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
251 if (!checkDrawBuffersIndexedSupport(m_context))
252 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__);
253 m_log << TestLog::Section(
254 "", "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.");
255 glBlendFuncSeparatei(0, -1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
256 expectError(GL_INVALID_ENUM);
257 glBlendFuncSeparatei(0, GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
258 expectError(GL_INVALID_ENUM);
259 glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR);
260 expectError(GL_INVALID_ENUM);
261 glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, GL_SRC_COLOR, -1);
262 expectError(GL_INVALID_ENUM);
263 m_log << TestLog::EndSection;
264 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of "
265 "MAX_DRAW_BUFFERS minus one.");
266 glBlendFuncSeparatei(-1, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
267 expectError(GL_INVALID_VALUE);
268 glBlendFuncSeparatei(maxDrawBuffers, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR);
269 expectError(GL_INVALID_VALUE);
270 m_log << TestLog::EndSection;
271 });
272
273 // Rasterization API functions
274
275 ES3F_ADD_API_CASE(cull_face, "Invalid glCullFace() usage", {
276 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not an accepted value.");
277 glCullFace(-1);
278 expectError(GL_INVALID_ENUM);
279 m_log << TestLog::EndSection;
280 });
281 ES3F_ADD_API_CASE(front_face, "Invalid glFrontFace() usage", {
282 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not an accepted value.");
283 glFrontFace(-1);
284 expectError(GL_INVALID_ENUM);
285 m_log << TestLog::EndSection;
286 });
287 ES3F_ADD_API_CASE(line_width, "Invalid glLineWidth() usage", {
288 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width is less than or equal to 0.");
289 glLineWidth(0);
290 expectError(GL_INVALID_VALUE);
291 glLineWidth(-1);
292 expectError(GL_INVALID_VALUE);
293 m_log << TestLog::EndSection;
294 });
295
296 // Asynchronous queries
297
298 ES3F_ADD_API_CASE(gen_queries, "Invalid glGenQueries() usage", {
299 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
300 GLuint ids;
301 glGenQueries(-1, &ids);
302 expectError(GL_INVALID_VALUE);
303 m_log << TestLog::EndSection;
304 });
305 ES3F_ADD_API_CASE(begin_query, "Invalid glBeginQuery() usage", {
306 GLuint ids[3];
307 glGenQueries(3, ids);
308
309 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
310 glBeginQuery(-1, ids[0]);
311 expectError(GL_INVALID_ENUM);
312 m_log << TestLog::EndSection;
313
314 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if glBeginQuery is executed while a query "
315 "object of the same target is already active.");
316 glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[0]);
317 expectError(GL_NO_ERROR);
318 glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[1]);
319 expectError(GL_INVALID_OPERATION);
320 // \note GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE alias to the same target for the purposes of this error.
321 glBeginQuery(GL_ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]);
322 expectError(GL_INVALID_OPERATION);
323 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]);
324 expectError(GL_NO_ERROR);
325 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]);
326 expectError(GL_INVALID_OPERATION);
327 glEndQuery(GL_ANY_SAMPLES_PASSED);
328 glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
329 expectError(GL_NO_ERROR);
330 m_log << TestLog::EndSection;
331
332 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id is 0.");
333 glBeginQuery(GL_ANY_SAMPLES_PASSED, 0);
334 expectError(GL_INVALID_OPERATION);
335 m_log << TestLog::EndSection;
336
337 m_log << TestLog::Section("",
338 "GL_INVALID_OPERATION is generated if id not a name returned from a previous call to "
339 "glGenQueries, or if such a name has since been deleted with glDeleteQueries.");
340 glBeginQuery(GL_ANY_SAMPLES_PASSED, -1);
341 expectError(GL_INVALID_OPERATION);
342 glDeleteQueries(1, &ids[2]);
343 expectError(GL_NO_ERROR);
344 glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[2]);
345 expectError(GL_INVALID_OPERATION);
346 m_log << TestLog::EndSection;
347
348 m_log << TestLog::Section(
349 "", "GL_INVALID_OPERATION is generated if id is the name of an already active query object.");
350 glBeginQuery(GL_ANY_SAMPLES_PASSED, ids[0]);
351 expectError(GL_NO_ERROR);
352 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
353 expectError(GL_INVALID_OPERATION);
354 m_log << TestLog::EndSection;
355
356 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id refers to an existing query object "
357 "whose type does not does not match target.");
358 glEndQuery(GL_ANY_SAMPLES_PASSED);
359 expectError(GL_NO_ERROR);
360 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
361 expectError(GL_INVALID_OPERATION);
362 m_log << TestLog::EndSection;
363
364 glDeleteQueries(2, &ids[0]);
365 expectError(GL_NO_ERROR);
366 });
367 ES3F_ADD_API_CASE(end_query, "Invalid glEndQuery() usage", {
368 GLuint id;
369 glGenQueries(1, &id);
370
371 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
372 glEndQuery(-1);
373 expectError(GL_INVALID_ENUM);
374 m_log << TestLog::EndSection;
375
376 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if glEndQuery is executed when a query object "
377 "of the same target is not active.");
378 glEndQuery(GL_ANY_SAMPLES_PASSED);
379 expectError(GL_INVALID_OPERATION);
380 glBeginQuery(GL_ANY_SAMPLES_PASSED, id);
381 expectError(GL_NO_ERROR);
382 glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
383 expectError(GL_INVALID_OPERATION);
384 glEndQuery(GL_ANY_SAMPLES_PASSED);
385 expectError(GL_NO_ERROR);
386 m_log << TestLog::EndSection;
387
388 glDeleteQueries(1, &id);
389 expectError(GL_NO_ERROR);
390 });
391 ES3F_ADD_API_CASE(delete_queries, "Invalid glDeleteQueries() usage", {
392 GLuint id;
393 glGenQueries(1, &id);
394
395 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
396 glDeleteQueries(-1, &id);
397 expectError(GL_INVALID_VALUE);
398 m_log << TestLog::EndSection;
399
400 glDeleteQueries(1, &id);
401 });
402
403 // Sync objects
404
405 ES3F_ADD_API_CASE(fence_sync, "Invalid glFenceSync() usage", {
406 m_log << TestLog::Section("",
407 "GL_INVALID_ENUM is generated if condition is not GL_SYNC_GPU_COMMANDS_COMPLETE.");
408 glFenceSync(-1, 0);
409 expectError(GL_INVALID_ENUM);
410 m_log << TestLog::EndSection;
411
412 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags is not zero.");
413 glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0x0010);
414 expectError(GL_INVALID_VALUE);
415 m_log << TestLog::EndSection;
416 });
417 ES3F_ADD_API_CASE(wait_sync, "Invalid glWaitSync() usage", {
418 GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
419
420 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
421 glWaitSync(0, 0, GL_TIMEOUT_IGNORED);
422 expectError(GL_INVALID_VALUE);
423 m_log << TestLog::EndSection;
424
425 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags is not zero.");
426 glWaitSync(sync, 0x0010, GL_TIMEOUT_IGNORED);
427 expectError(GL_INVALID_VALUE);
428 m_log << TestLog::EndSection;
429
430 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED.");
431 glWaitSync(sync, 0, 0);
432 expectError(GL_INVALID_VALUE);
433 m_log << TestLog::EndSection;
434
435 glDeleteSync(sync);
436 });
437 ES3F_ADD_API_CASE(client_wait_sync, "Invalid glClientWaitSync() usage", {
438 GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
439
440 m_log << TestLog::Section("",
441 "GL_INVALID_VALUE is generated if sync is not the name of an existing sync object.");
442 glClientWaitSync(0, 0, 10000);
443 expectError(GL_INVALID_VALUE);
444 m_log << TestLog::EndSection;
445
446 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags contains any unsupported flag.");
447 glClientWaitSync(sync, 0x00000004, 10000);
448 expectError(GL_INVALID_VALUE);
449 m_log << TestLog::EndSection;
450
451 glDeleteSync(sync);
452 });
453 ES3F_ADD_API_CASE(delete_sync, "Invalid glDeleteSync() usage", {
454 m_log << TestLog::Section(
455 "", "GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object.");
456 glDeleteSync((GLsync)1);
457 expectError(GL_INVALID_VALUE);
458 glDeleteSync(0);
459 expectError(GL_NO_ERROR);
460 m_log << TestLog::EndSection;
461 });
462 }
463
464 } // namespace Functional
465 } // namespace gles3
466 } // namespace deqp
467