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 State change call performance tests.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "es3pStateChangeCallTests.hpp"
25 #include "glsStateChangePerfTestCases.hpp"
26 #include "glwFunctions.hpp"
27 #include "glwEnums.hpp"
28 
29 namespace deqp
30 {
31 namespace gles3
32 {
33 namespace Performance
34 {
35 
36 using namespace glw;
37 
StateChangeCallTests(Context & context)38 StateChangeCallTests::StateChangeCallTests (Context& context)
39 	: TestCaseGroup(context, "state_change_only", "Test cost of state change calls without rendering anything")
40 {
41 }
42 
~StateChangeCallTests(void)43 StateChangeCallTests::~StateChangeCallTests (void)
44 {
45 }
46 
47 #define ARG_LIST(...) __VA_ARGS__
48 
49 #define ADD_ARG_CASE1(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0)\
50 do {\
51 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
52 	{\
53 	public:\
54 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
55 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
56 		{\
57 		}\
58 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
59 		{\
60 			const TYPE0 args0[] = ARGS0;\
61 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
62 			{\
63 				const int		baseNdx		= iterNdx*callCount + callNdx;\
64 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
65 				gl.FUNCNAME(arg0);\
66 			}\
67 		}\
68 	};\
69 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
70 }while (0);
71 
72 #define ADD_ARG_CASE2(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1)\
73 do {\
74 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
75 	{\
76 	public:\
77 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
78 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
79 		{\
80 		}\
81 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
82 		{\
83 			const TYPE0 args0[] = ARGS0;\
84 			const TYPE1 args1[] = ARGS1;\
85 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
86 			{\
87 				const int		baseNdx		= iterNdx*callCount + callNdx;\
88 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
89 				const TYPE1		arg1		= args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
90 				gl.FUNCNAME(arg0, arg1);\
91 			}\
92 		}\
93 	};\
94 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
95 }while (0);
96 
97 #define ADD_ARG_CASE3(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2)\
98 do {\
99 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
100 	{\
101 	public:\
102 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
103 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
104 		{\
105 		}\
106 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
107 		{\
108 			const TYPE0 args0[] = ARGS0;\
109 			const TYPE1 args1[] = ARGS1;\
110 			const TYPE2 args2[] = ARGS2;\
111 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
112 			{\
113 				const int		baseNdx		= iterNdx*callCount + callNdx;\
114 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
115 				const TYPE1		arg1		= args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
116 				const TYPE2		arg2		= args2[baseNdx%DE_LENGTH_OF_ARRAY(args2)];\
117 				gl.FUNCNAME(arg0, arg1, arg2);\
118 			}\
119 		}\
120 	};\
121 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
122 }while (0);
123 
124 #define ADD_ARG_CASE4(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3)\
125 do {\
126 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
127 	{\
128 	public:\
129 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
130 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
131 		{\
132 		}\
133 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
134 		{\
135 			const TYPE0 args0[] = ARGS0;\
136 			const TYPE1 args1[] = ARGS1;\
137 			const TYPE2 args2[] = ARGS2;\
138 			const TYPE3 args3[] = ARGS3;\
139 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
140 			{\
141 				const int		baseNdx		= iterNdx*callCount + callNdx;\
142 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
143 				const TYPE1		arg1		= args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
144 				const TYPE2		arg2		= args2[baseNdx%DE_LENGTH_OF_ARRAY(args2)];\
145 				const TYPE3		arg3		= args3[baseNdx%DE_LENGTH_OF_ARRAY(args3)];\
146 				gl.FUNCNAME(arg0, arg1, arg2, arg3);\
147 			}\
148 		}\
149 	};\
150 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
151 }while (0);
152 
153 #define ADD_ARG_CASE5(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3, TYPE4, ARGS4)\
154 do {\
155 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
156 	{\
157 	public:\
158 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
159 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
160 		{\
161 		}\
162 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
163 		{\
164 			const TYPE0 args0[] = ARGS0;\
165 			const TYPE1 args1[] = ARGS1;\
166 			const TYPE2 args2[] = ARGS2;\
167 			const TYPE3 args3[] = ARGS3;\
168 			const TYPE4 args4[] = ARGS4;\
169 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
170 			{\
171 				const int		baseNdx		= iterNdx*callCount + callNdx;\
172 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
173 				const TYPE1		arg1		= args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
174 				const TYPE2		arg2		= args2[baseNdx%DE_LENGTH_OF_ARRAY(args2)];\
175 				const TYPE3		arg3		= args3[baseNdx%DE_LENGTH_OF_ARRAY(args3)];\
176 				const TYPE4		arg4		= args4[baseNdx%DE_LENGTH_OF_ARRAY(args4)];\
177 				gl.FUNCNAME(arg0, arg1, arg2, arg3, arg4);\
178 			}\
179 		}\
180 	};\
181 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
182 }while (0);
183 
184 #define ADD_ARG_CASE6(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3, TYPE4, ARGS4, TYPE5, ARGS5)\
185 do {\
186 	class StateChangeCallTest_ ## NAME : public gls::StateChangeCallPerformanceCase\
187 	{\
188 	public:\
189 		StateChangeCallTest_ ## NAME (Context& context, const char* name, const char* description)\
190 			: gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, description)\
191 		{\
192 		}\
193 		virtual void execCalls (const glw::Functions& gl, int iterNdx, int callCount)\
194 		{\
195 			const TYPE0 args0[] = ARGS0;\
196 			const TYPE1 args1[] = ARGS1;\
197 			const TYPE2 args2[] = ARGS2;\
198 			const TYPE3 args3[] = ARGS3;\
199 			const TYPE4 args4[] = ARGS4;\
200 			const TYPE5 args5[] = ARGS5;\
201 			for (int callNdx = 0; callNdx < callCount; callNdx++)\
202 			{\
203 				const int		baseNdx		= iterNdx*callCount + callNdx;\
204 				const TYPE0		arg0		= args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
205 				const TYPE1		arg1		= args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
206 				const TYPE2		arg2		= args2[baseNdx%DE_LENGTH_OF_ARRAY(args2)];\
207 				const TYPE3		arg3		= args3[baseNdx%DE_LENGTH_OF_ARRAY(args3)];\
208 				const TYPE4		arg4		= args4[baseNdx%DE_LENGTH_OF_ARRAY(args4)];\
209 				const TYPE5		arg5		= args5[baseNdx%DE_LENGTH_OF_ARRAY(args5)];\
210 				gl.FUNCNAME(arg0, arg1, arg2, arg3, arg4, arg5);\
211 			}\
212 		}\
213 	};\
214 	addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
215 }while (0);
216 
init(void)217 void StateChangeCallTests::init (void)
218 {
219 	ADD_ARG_CASE1(enable, "Test cost of glEnable() calls",
220 		enable,
221 		GLenum,
222 		ARG_LIST({
223 			GL_CULL_FACE,
224 			GL_POLYGON_OFFSET_FILL,
225 			GL_SAMPLE_ALPHA_TO_COVERAGE,
226 			GL_SAMPLE_COVERAGE,
227 			GL_SCISSOR_TEST,
228 			GL_STENCIL_TEST,
229 			GL_DEPTH_TEST,
230 			GL_BLEND,
231 			GL_DITHER,
232 			GL_RASTERIZER_DISCARD,
233 			GL_PRIMITIVE_RESTART_FIXED_INDEX
234 		})
235 	);
236 
237 	ADD_ARG_CASE1(disable, "Test cost of glDisable() calls",
238 		disable,
239 		GLenum,
240 		ARG_LIST({
241 			GL_CULL_FACE,
242 			GL_POLYGON_OFFSET_FILL,
243 			GL_SAMPLE_ALPHA_TO_COVERAGE,
244 			GL_SAMPLE_COVERAGE,
245 			GL_SCISSOR_TEST,
246 			GL_STENCIL_TEST,
247 			GL_DEPTH_TEST,
248 			GL_BLEND,
249 			GL_DITHER,
250 			GL_RASTERIZER_DISCARD,
251 			GL_PRIMITIVE_RESTART_FIXED_INDEX
252 		})
253 	);
254 
255 	ADD_ARG_CASE1(depth_func, "Test cost of glDepthFunc() calls",
256 		depthFunc,
257 		GLenum,
258 		ARG_LIST({
259 			GL_NEVER,
260 			GL_ALWAYS,
261 			GL_LESS,
262 			GL_LEQUAL,
263 			GL_EQUAL,
264 			GL_GREATER,
265 			GL_GEQUAL,
266 			GL_NOTEQUAL
267 		})
268 	);
269 
270 	ADD_ARG_CASE1(depth_mask, "Test cost of glDepthMask() calls",
271 		depthMask,
272 		GLboolean,
273 		ARG_LIST({
274 			GL_TRUE,
275 			GL_FALSE
276 		})
277 	);
278 
279 	ADD_ARG_CASE1(stencil_mask, "Test cost of glStencilMask() calls",
280 		stencilMask,
281 		GLboolean,
282 		ARG_LIST({
283 			GL_TRUE,
284 			GL_FALSE
285 		})
286 	);
287 
288 	ADD_ARG_CASE1(clear_depth, "Test cost of glClearDepth() calls",
289 		clearDepthf,
290 		GLclampf,
291 		ARG_LIST({
292 			0.0f,
293 			0.5f,
294 			1.0f
295 		})
296 	);
297 
298 	ADD_ARG_CASE1(clear_stencil, "Test cost of glClearStencil() calls",
299 		clearStencil,
300 		GLint,
301 		ARG_LIST({
302 			0,
303 			128,
304 			28
305 		})
306 	);
307 
308 	ADD_ARG_CASE1(line_width, "Test cost of glLineWidth() calls",
309 		lineWidth,
310 		GLfloat,
311 		ARG_LIST({
312 			1.0f,
313 			0.5f,
314 			10.0f
315 		})
316 	);
317 
318 	ADD_ARG_CASE1(cull_face, "Test cost of glCullFace() calls",
319 		cullFace,
320 		GLenum,
321 		ARG_LIST({
322 			GL_FRONT,
323 			GL_BACK,
324 			GL_FRONT_AND_BACK
325 		})
326 	);
327 
328 	ADD_ARG_CASE1(front_face, "Test cost of glFrontFace() calls",
329 		frontFace,
330 		GLenum,
331 		ARG_LIST({
332 			GL_CCW,
333 			GL_CW
334 		})
335 	);
336 
337 	ADD_ARG_CASE1(blend_equation, "Test cost of glBlendEquation() calls",
338 		blendEquation,
339 		GLenum,
340 		ARG_LIST({
341 			GL_FUNC_ADD,
342 			GL_FUNC_SUBTRACT,
343 			GL_FUNC_REVERSE_SUBTRACT
344 		})
345 	);
346 
347 	ADD_ARG_CASE1(enable_vertex_attrib_array, "Test cost of glEnableVertexAttribArray() calls",
348 		enableVertexAttribArray,
349 		GLuint,
350 		ARG_LIST({
351 			0,
352 			1,
353 			2,
354 			3,
355 			4,
356 			5,
357 			6,
358 			7,
359 		})
360 	);
361 
362 	ADD_ARG_CASE1(disable_vertex_attrib_array, "Test cost of glDisableVertexAttribArray() calls",
363 		disableVertexAttribArray,
364 		GLuint,
365 		ARG_LIST({
366 			0,
367 			1,
368 			2,
369 			3,
370 			4,
371 			5,
372 			6,
373 			7,
374 		})
375 	);
376 
377 	ADD_ARG_CASE1(use_program, "Test cost of glUseProgram() calls. Note: Uses only program 0.",
378 		useProgram,
379 		GLuint,
380 		ARG_LIST({
381 			0,
382 		})
383 	);
384 
385 	ADD_ARG_CASE1(active_texture, "Test cost of glActiveTexture() calls",
386 		activeTexture,
387 		GLenum,
388 		ARG_LIST({
389 			GL_TEXTURE0,
390 			GL_TEXTURE1,
391 			GL_TEXTURE2,
392 			GL_TEXTURE3,
393 			GL_TEXTURE4,
394 			GL_TEXTURE5,
395 			GL_TEXTURE6,
396 			GL_TEXTURE7
397 		})
398 	);
399 
400 	ADD_ARG_CASE2(depth_range, "Test cost of glDepthRangef() calls",
401 		depthRangef,
402 		GLclampf,
403 		ARG_LIST({
404 			0.0f,
405 			1.0f,
406 			0.5f
407 		}),
408 		GLclampf,
409 		ARG_LIST({
410 			0.0f,
411 			1.0f,
412 			0.5f
413 		})
414 	);
415 
416 	ADD_ARG_CASE2(polygon_offset, "Test cost of glPolygonOffset() calls",
417 		polygonOffset,
418 		GLfloat,
419 		ARG_LIST({
420 			0.0f,
421 			1.0f,
422 			0.5f,
423 			10.0f
424 		}),
425 		GLfloat,
426 		ARG_LIST({
427 			0.0f,
428 			1.0f,
429 			0.5f,
430 			1000.0f
431 		})
432 	);
433 
434 	ADD_ARG_CASE2(sample_coverage, "Test cost of glSampleCoverage() calls",
435 		sampleCoverage,
436 		GLclampf,
437 		ARG_LIST({
438 			0.0f,
439 			1.0f,
440 			0.5f,
441 			0.67f
442 		}),
443 		GLboolean,
444 		ARG_LIST({
445 			GL_TRUE,
446 			GL_FALSE
447 		})
448 	);
449 
450 	ADD_ARG_CASE2(blend_func, "Test cost of glBlendFunc() calls",
451 		blendFunc,
452 		GLenum,
453 		ARG_LIST({
454 			GL_ZERO,
455 			GL_ONE,
456 			GL_SRC_COLOR,
457 			GL_ONE_MINUS_SRC_COLOR,
458 			GL_DST_COLOR,
459 			GL_ONE_MINUS_DST_COLOR,
460 			GL_SRC_ALPHA,
461 			GL_ONE_MINUS_SRC_ALPHA,
462 			GL_DST_ALPHA,
463 			GL_ONE_MINUS_DST_ALPHA,
464 			GL_CONSTANT_COLOR,
465 			GL_ONE_MINUS_CONSTANT_COLOR,
466 			GL_CONSTANT_ALPHA,
467 			GL_ONE_MINUS_CONSTANT_ALPHA
468 		}),
469 		GLenum,
470 		ARG_LIST({
471 			GL_ZERO,
472 			GL_ONE,
473 			GL_SRC_COLOR,
474 			GL_ONE_MINUS_SRC_COLOR,
475 			GL_DST_COLOR,
476 			GL_ONE_MINUS_DST_COLOR,
477 			GL_SRC_ALPHA,
478 			GL_ONE_MINUS_SRC_ALPHA,
479 			GL_DST_ALPHA,
480 			GL_ONE_MINUS_DST_ALPHA,
481 			GL_CONSTANT_COLOR,
482 			GL_ONE_MINUS_CONSTANT_COLOR,
483 			GL_CONSTANT_ALPHA,
484 			GL_ONE_MINUS_CONSTANT_ALPHA
485 		})
486 	);
487 
488 	ADD_ARG_CASE2(blend_equation_separate, "Test cost of glBlendEquationSeparate() calls",
489 		blendEquationSeparate,
490 		GLenum,
491 		ARG_LIST({
492 			GL_FUNC_ADD,
493 			GL_FUNC_SUBTRACT,
494 			GL_FUNC_REVERSE_SUBTRACT
495 		}),
496 		GLenum,
497 		ARG_LIST({
498 			GL_FUNC_ADD,
499 			GL_FUNC_SUBTRACT,
500 			GL_FUNC_REVERSE_SUBTRACT
501 		})
502 	);
503 
504 	ADD_ARG_CASE2(stencil_mask_separate, "Test cost of glStencilMaskSeparate() calls",
505 		stencilMaskSeparate,
506 		GLenum,
507 		ARG_LIST({
508 			GL_FRONT,
509 			GL_BACK,
510 			GL_FRONT_AND_BACK
511 		}),
512 		GLboolean,
513 		ARG_LIST({
514 			GL_TRUE,
515 			GL_FALSE
516 		})
517 	);
518 
519 	ADD_ARG_CASE2(bind_buffer, "Test cost of glBindBuffer() calls. Note: Uses only buffer 0",
520 		bindBuffer,
521 		GLenum,
522 		ARG_LIST({
523 			GL_ELEMENT_ARRAY_BUFFER,
524 			GL_ARRAY_BUFFER
525 		}),
526 		GLuint,
527 		ARG_LIST({
528 			0
529 		})
530 	);
531 
532 	ADD_ARG_CASE2(bind_texture, "Test cost of glBindTexture() calls. Note: Uses only texture 0",
533 		bindTexture,
534 		GLenum,
535 		ARG_LIST({
536 			GL_TEXTURE_2D,
537 			GL_TEXTURE_CUBE_MAP
538 		}),
539 		GLuint,
540 		ARG_LIST({
541 			0
542 		})
543 	);
544 
545 	ADD_ARG_CASE2(bind_sampler, "Test cost of glBindSampler() calls. Note: Uses only sampler 0",
546 		bindSampler,
547 		GLuint,
548 		ARG_LIST({
549 			0,
550 			1,
551 			2,
552 			3,
553 			4,
554 			5,
555 			6,
556 			7
557 		}),
558 		GLuint,
559 		ARG_LIST({
560 			0
561 		})
562 	);
563 
564 	ADD_ARG_CASE1(bind_vertex_array, "Test cost of glBindVertexArray() calls. Note: Uses only VAO 0",
565 		bindVertexArray,
566 		GLuint,
567 		ARG_LIST({
568 			0
569 		})
570 	);
571 
572 	ADD_ARG_CASE2(hint, "Test cost of glHint() calls",
573 		hint,
574 		GLenum,
575 		ARG_LIST({
576 			GL_GENERATE_MIPMAP_HINT
577 		}),
578 		GLenum,
579 		ARG_LIST({
580 			GL_FASTEST,
581 			GL_NICEST,
582 			GL_DONT_CARE
583 		})
584 	);
585 
586 	ADD_ARG_CASE3(stencil_func, "Test cost of glStencilFunc() calls",
587 		stencilFunc,
588 		GLenum,
589 		ARG_LIST({
590 			GL_NEVER,
591 			GL_ALWAYS,
592 			GL_LESS,
593 			GL_LEQUAL,
594 			GL_EQUAL,
595 			GL_GEQUAL,
596 			GL_GREATER,
597 			GL_NOTEQUAL
598 		}),
599 		GLint,
600 		ARG_LIST({
601 			0,
602 			1,
603 			255,
604 			128,
605 			7
606 		}),
607 		GLuint,
608 		ARG_LIST({
609 			0,
610 			1,
611 			255,
612 			128,
613 			7,
614 			0xFFFFFFFF
615 		})
616 	);
617 
618 	ADD_ARG_CASE3(stencil_op, "Test cost of glStencilOp() calls",
619 		stencilOp,
620 		GLenum,
621 		ARG_LIST({
622 			GL_KEEP,
623 			GL_ZERO,
624 			GL_REPLACE,
625 			GL_INCR,
626 			GL_DECR,
627 			GL_INVERT,
628 			GL_INCR_WRAP,
629 			GL_DECR_WRAP
630 		}),
631 		GLenum,
632 		ARG_LIST({
633 			GL_KEEP,
634 			GL_ZERO,
635 			GL_REPLACE,
636 			GL_INCR,
637 			GL_DECR,
638 			GL_INVERT,
639 			GL_INCR_WRAP,
640 			GL_DECR_WRAP
641 		}),
642 		GLenum,
643 		ARG_LIST({
644 			GL_KEEP,
645 			GL_ZERO,
646 			GL_REPLACE,
647 			GL_INCR,
648 			GL_DECR,
649 			GL_INVERT,
650 			GL_INCR_WRAP,
651 			GL_DECR_WRAP
652 		})
653 	);
654 
655 	ADD_ARG_CASE4(viewport, "Test cost of glViewport() calls",
656 		viewport,
657 		GLint,
658 		ARG_LIST({
659 			0,
660 			1,
661 			100,
662 			1145235
663 		}),
664 		GLint,
665 		ARG_LIST({
666 			0,
667 			1,
668 			100,
669 			1145235
670 		}),
671 		GLint,
672 		ARG_LIST({
673 			0,
674 			1,
675 			100,
676 			1145235
677 		}),
678 		GLint,
679 		ARG_LIST({
680 			0,
681 			1,
682 			100,
683 			1145235
684 		})
685 	);
686 
687 	ADD_ARG_CASE4(scissor, "Test cost of glScissor() calls",
688 		scissor,
689 		GLint,
690 		ARG_LIST({
691 			0,
692 			1,
693 			100,
694 			1145235
695 		}),
696 		GLint,
697 		ARG_LIST({
698 			0,
699 			1,
700 			100,
701 			1145235
702 		}),
703 		GLint,
704 		ARG_LIST({
705 			0,
706 			1,
707 			100,
708 			1145235
709 		}),
710 		GLint,
711 		ARG_LIST({
712 			0,
713 			1,
714 			100,
715 			1145235
716 		})
717 	);
718 
719 	ADD_ARG_CASE4(stencil_func_separate, "Test cost of glStencilFuncSeparate() calls",
720 		stencilFuncSeparate,
721 		GLenum,
722 		ARG_LIST({
723 			GL_FRONT,
724 			GL_BACK,
725 			GL_FRONT_AND_BACK
726 		}),
727 		GLenum,
728 		ARG_LIST({
729 			GL_NEVER,
730 			GL_ALWAYS,
731 			GL_LESS,
732 			GL_LEQUAL,
733 			GL_EQUAL,
734 			GL_GEQUAL,
735 			GL_GREATER,
736 			GL_NOTEQUAL
737 		}),
738 		GLint,
739 		ARG_LIST({
740 			0,
741 			1,
742 			255,
743 			128,
744 			7
745 		}),
746 		GLuint,
747 		ARG_LIST({
748 			0,
749 			1,
750 			255,
751 			128,
752 			7,
753 			0xFFFFFFFF
754 		})
755 	);
756 
757 	ADD_ARG_CASE4(stencil_op_separatae, "Test cost of glStencilOpSeparate() calls",
758 		stencilOpSeparate,
759 		GLenum,
760 		ARG_LIST({
761 			GL_FRONT,
762 			GL_BACK,
763 			GL_FRONT_AND_BACK
764 		}),
765 		GLenum,
766 		ARG_LIST({
767 			GL_KEEP,
768 			GL_ZERO,
769 			GL_REPLACE,
770 			GL_INCR,
771 			GL_DECR,
772 			GL_INVERT,
773 			GL_INCR_WRAP,
774 			GL_DECR_WRAP
775 		}),
776 		GLenum,
777 		ARG_LIST({
778 			GL_KEEP,
779 			GL_ZERO,
780 			GL_REPLACE,
781 			GL_INCR,
782 			GL_DECR,
783 			GL_INVERT,
784 			GL_INCR_WRAP,
785 			GL_DECR_WRAP
786 		}),
787 		GLenum,
788 		ARG_LIST({
789 			GL_KEEP,
790 			GL_ZERO,
791 			GL_REPLACE,
792 			GL_INCR,
793 			GL_DECR,
794 			GL_INVERT,
795 			GL_INCR_WRAP,
796 			GL_DECR_WRAP
797 		})
798 	);
799 
800 	ADD_ARG_CASE4(blend_func_separate, "Test cost of glBlendFuncSeparate() calls",
801 		blendFuncSeparate,
802 		GLenum,
803 		ARG_LIST({
804 			GL_ZERO,
805 			GL_ONE,
806 			GL_SRC_COLOR,
807 			GL_ONE_MINUS_SRC_COLOR,
808 			GL_DST_COLOR,
809 			GL_ONE_MINUS_DST_COLOR,
810 			GL_SRC_ALPHA,
811 			GL_ONE_MINUS_SRC_ALPHA,
812 			GL_DST_ALPHA,
813 			GL_ONE_MINUS_DST_ALPHA,
814 			GL_CONSTANT_COLOR,
815 			GL_ONE_MINUS_CONSTANT_COLOR,
816 			GL_CONSTANT_ALPHA,
817 			GL_ONE_MINUS_CONSTANT_ALPHA
818 		}),
819 		GLenum,
820 		ARG_LIST({
821 			GL_ZERO,
822 			GL_ONE,
823 			GL_SRC_COLOR,
824 			GL_ONE_MINUS_SRC_COLOR,
825 			GL_DST_COLOR,
826 			GL_ONE_MINUS_DST_COLOR,
827 			GL_SRC_ALPHA,
828 			GL_ONE_MINUS_SRC_ALPHA,
829 			GL_DST_ALPHA,
830 			GL_ONE_MINUS_DST_ALPHA,
831 			GL_CONSTANT_COLOR,
832 			GL_ONE_MINUS_CONSTANT_COLOR,
833 			GL_CONSTANT_ALPHA,
834 			GL_ONE_MINUS_CONSTANT_ALPHA
835 		}),
836 		GLenum,
837 		ARG_LIST({
838 			GL_ZERO,
839 			GL_ONE,
840 			GL_SRC_COLOR,
841 			GL_ONE_MINUS_SRC_COLOR,
842 			GL_DST_COLOR,
843 			GL_ONE_MINUS_DST_COLOR,
844 			GL_SRC_ALPHA,
845 			GL_ONE_MINUS_SRC_ALPHA,
846 			GL_DST_ALPHA,
847 			GL_ONE_MINUS_DST_ALPHA,
848 			GL_CONSTANT_COLOR,
849 			GL_ONE_MINUS_CONSTANT_COLOR,
850 			GL_CONSTANT_ALPHA,
851 			GL_ONE_MINUS_CONSTANT_ALPHA
852 		}),
853 		GLenum,
854 		ARG_LIST({
855 			GL_ZERO,
856 			GL_ONE,
857 			GL_SRC_COLOR,
858 			GL_ONE_MINUS_SRC_COLOR,
859 			GL_DST_COLOR,
860 			GL_ONE_MINUS_DST_COLOR,
861 			GL_SRC_ALPHA,
862 			GL_ONE_MINUS_SRC_ALPHA,
863 			GL_DST_ALPHA,
864 			GL_ONE_MINUS_DST_ALPHA,
865 			GL_CONSTANT_COLOR,
866 			GL_ONE_MINUS_CONSTANT_COLOR,
867 			GL_CONSTANT_ALPHA,
868 			GL_ONE_MINUS_CONSTANT_ALPHA
869 		})
870 	);
871 
872 	ADD_ARG_CASE4(color_mask, "Test cost of glColorMask() calls",
873 		colorMask,
874 		GLboolean,
875 		ARG_LIST({
876 			GL_TRUE,
877 			GL_FALSE
878 		}),
879 		GLboolean,
880 		ARG_LIST({
881 			GL_TRUE,
882 			GL_FALSE
883 		}),
884 		GLboolean,
885 		ARG_LIST({
886 			GL_TRUE,
887 			GL_FALSE
888 		}),
889 		GLboolean,
890 		ARG_LIST({
891 			GL_TRUE,
892 			GL_FALSE
893 		})
894 	);
895 
896 	ADD_ARG_CASE4(clear_color, "Test cost of glClearColor() calls",
897 		clearColor,
898 		GLclampf,
899 		ARG_LIST({
900 			0.0f,
901 			1.0f,
902 			0.5f,
903 			0.33f
904 		}),
905 		GLclampf,
906 		ARG_LIST({
907 			0.0f,
908 			1.0f,
909 			0.5f,
910 			0.33f
911 		}),
912 		GLclampf,
913 		ARG_LIST({
914 			0.0f,
915 			1.0f,
916 			0.5f,
917 			0.33f
918 		}),
919 		GLclampf,
920 		ARG_LIST({
921 			0.0f,
922 			1.0f,
923 			0.5f,
924 			0.33f
925 		})
926 	);
927 
928 	ADD_ARG_CASE6(vertex_attrib_pointer, "Test cost of glVertexAttribPointer() calls",
929 		vertexAttribPointer,
930 		GLuint,
931 		ARG_LIST({
932 			0,
933 			1,
934 			2,
935 			3,
936 			4,
937 			5,
938 			6,
939 			7
940 		}),
941 		GLint,
942 		ARG_LIST({
943 			1,
944 			2,
945 			3,
946 			4
947 		}),
948 		GLenum,
949 		ARG_LIST({
950 			GL_UNSIGNED_BYTE,
951 			GL_BYTE,
952 			GL_UNSIGNED_SHORT,
953 			GL_SHORT,
954 			GL_FLOAT
955 		}),
956 		GLboolean,
957 		ARG_LIST({
958 			GL_FALSE,
959 			GL_TRUE
960 		}),
961 		GLsizei,
962 		ARG_LIST({
963 			0,
964 			2,
965 			4
966 		}),
967 		void*,
968 		ARG_LIST({
969 			(void*)(deUintptr)(0x0FF),
970 			(void*)(deUintptr)(0x0EF)
971 		})
972 	);
973 
974 	ADD_ARG_CASE2(vertex_attrib_divisor, "Test cost of glVertexAttribDivisor() calls",
975 		vertexAttribDivisor,
976 		GLuint,
977 		ARG_LIST({
978 			0,
979 			1,
980 			2,
981 			3,
982 			4,
983 			5,
984 			6,
985 			7
986 		}),
987 		GLuint,
988 		ARG_LIST({
989 			0,
990 			1,
991 			3,
992 			7,
993 			11,
994 			127,
995 			256
996 		})
997 	);
998 
999 	ADD_ARG_CASE3(bind_buffer_base, "Test cost of glBindBufferBase() calls. Note: uses only buffer 0.",
1000 		bindBufferBase,
1001 		GLuint,
1002 		ARG_LIST({
1003 			GL_UNIFORM_BUFFER
1004 		}),
1005 		GLuint,
1006 		ARG_LIST({
1007 			0,
1008 			1,
1009 			2,
1010 			3
1011 		}),
1012 		GLuint,
1013 		ARG_LIST({
1014 			0
1015 		})
1016 	);
1017 
1018 	ADD_ARG_CASE5(bind_buffer_range, "Test cost of glBindBufferRange() calls. Note: uses only buffer 0.",
1019 		bindBufferRange,
1020 		GLuint,
1021 		ARG_LIST({
1022 			GL_UNIFORM_BUFFER
1023 		}),
1024 		GLuint,
1025 		ARG_LIST({
1026 			0,
1027 			1,
1028 			2,
1029 			3
1030 		}),
1031 		GLuint,
1032 		ARG_LIST({
1033 			0
1034 		}),
1035 		GLintptr,
1036 		ARG_LIST({
1037 			0
1038 		}),
1039 		GLsizeiptr,
1040 		ARG_LIST({
1041 			0
1042 		})
1043 	);
1044 }
1045 
1046 } // Performance
1047 } // gles3
1048 } // deqp
1049