1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 2.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 "es2pStateChangeCallTests.hpp"
25 #include "glsStateChangePerfTestCases.hpp"
26 #include "glwFunctions.hpp"
27 #include "glwEnums.hpp"
28
29 namespace deqp
30 {
31 namespace gles2
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_CASE6(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3, TYPE4, ARGS4, TYPE5, ARGS5)\
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 const TYPE5 args5[] = ARGS5;\
170 for (int callNdx = 0; callNdx < callCount; callNdx++)\
171 {\
172 const int baseNdx = iterNdx*callCount + callNdx;\
173 const TYPE0 arg0 = args0[baseNdx%DE_LENGTH_OF_ARRAY(args0)];\
174 const TYPE1 arg1 = args1[baseNdx%DE_LENGTH_OF_ARRAY(args1)];\
175 const TYPE2 arg2 = args2[baseNdx%DE_LENGTH_OF_ARRAY(args2)];\
176 const TYPE3 arg3 = args3[baseNdx%DE_LENGTH_OF_ARRAY(args3)];\
177 const TYPE4 arg4 = args4[baseNdx%DE_LENGTH_OF_ARRAY(args4)];\
178 const TYPE5 arg5 = args5[baseNdx%DE_LENGTH_OF_ARRAY(args5)];\
179 gl.FUNCNAME(arg0, arg1, arg2, arg3, arg4, arg5);\
180 }\
181 }\
182 };\
183 addChild(new StateChangeCallTest_ ## NAME (m_context, #NAME, DESCRIPTION));\
184 }while (0);
185
init(void)186 void StateChangeCallTests::init (void)
187 {
188 ADD_ARG_CASE1(enable, "Test cost of glEnable() calls",
189 enable,
190 GLenum,
191 ARG_LIST({
192 GL_CULL_FACE,
193 GL_POLYGON_OFFSET_FILL,
194 GL_SAMPLE_ALPHA_TO_COVERAGE,
195 GL_SAMPLE_COVERAGE,
196 GL_SCISSOR_TEST,
197 GL_STENCIL_TEST,
198 GL_DEPTH_TEST,
199 GL_BLEND,
200 GL_DITHER
201 })
202 );
203
204 ADD_ARG_CASE1(disable, "Test cost of glDisable() calls",
205 disable,
206 GLenum,
207 ARG_LIST({
208 GL_CULL_FACE,
209 GL_POLYGON_OFFSET_FILL,
210 GL_SAMPLE_ALPHA_TO_COVERAGE,
211 GL_SAMPLE_COVERAGE,
212 GL_SCISSOR_TEST,
213 GL_STENCIL_TEST,
214 GL_DEPTH_TEST,
215 GL_BLEND,
216 GL_DITHER
217 })
218 );
219
220 ADD_ARG_CASE1(depth_func, "Test cost of glDepthFunc() calls",
221 depthFunc,
222 GLenum,
223 ARG_LIST({
224 GL_NEVER,
225 GL_ALWAYS,
226 GL_LESS,
227 GL_LEQUAL,
228 GL_EQUAL,
229 GL_GREATER,
230 GL_GEQUAL,
231 GL_NOTEQUAL
232 })
233 );
234
235 ADD_ARG_CASE1(depth_mask, "Test cost of glDepthMask() calls",
236 depthMask,
237 GLboolean,
238 ARG_LIST({
239 GL_TRUE,
240 GL_FALSE
241 })
242 );
243
244 ADD_ARG_CASE1(stencil_mask, "Test cost of glStencilMask() calls",
245 stencilMask,
246 GLboolean,
247 ARG_LIST({
248 GL_TRUE,
249 GL_FALSE
250 })
251 );
252
253 ADD_ARG_CASE1(clear_depth, "Test cost of glClearDepth() calls",
254 clearDepthf,
255 GLclampf,
256 ARG_LIST({
257 0.0f,
258 0.5f,
259 1.0f
260 })
261 );
262
263 ADD_ARG_CASE1(clear_stencil, "Test cost of glClearStencil() calls",
264 clearStencil,
265 GLint,
266 ARG_LIST({
267 0,
268 128,
269 28
270 })
271 );
272
273 ADD_ARG_CASE1(line_width, "Test cost of glLineWidth() calls",
274 lineWidth,
275 GLfloat,
276 ARG_LIST({
277 1.0f,
278 0.5f,
279 10.0f
280 })
281 );
282
283 ADD_ARG_CASE1(cull_face, "Test cost of glCullFace() calls",
284 cullFace,
285 GLenum,
286 ARG_LIST({
287 GL_FRONT,
288 GL_BACK,
289 GL_FRONT_AND_BACK
290 })
291 );
292
293 ADD_ARG_CASE1(front_face, "Test cost of glFrontFace() calls",
294 frontFace,
295 GLenum,
296 ARG_LIST({
297 GL_CCW,
298 GL_CW
299 })
300 );
301
302 ADD_ARG_CASE1(blend_equation, "Test cost of glBlendEquation() calls",
303 blendEquation,
304 GLenum,
305 ARG_LIST({
306 GL_FUNC_ADD,
307 GL_FUNC_SUBTRACT,
308 GL_FUNC_REVERSE_SUBTRACT
309 })
310 );
311
312 ADD_ARG_CASE1(enable_vertex_attrib_array, "Test cost of glEnableVertexAttribArray() calls",
313 enableVertexAttribArray,
314 GLuint,
315 ARG_LIST({
316 0,
317 1,
318 2,
319 3,
320 4,
321 5,
322 6,
323 7,
324 })
325 );
326
327 ADD_ARG_CASE1(disable_vertex_attrib_array, "Test cost of glDisableVertexAttribArray() calls",
328 disableVertexAttribArray,
329 GLuint,
330 ARG_LIST({
331 0,
332 1,
333 2,
334 3,
335 4,
336 5,
337 6,
338 7,
339 })
340 );
341
342 ADD_ARG_CASE1(use_program, "Test cost of glUseProgram() calls. Note: Uses only program 0.",
343 useProgram,
344 GLuint,
345 ARG_LIST({
346 0,
347 })
348 );
349
350 ADD_ARG_CASE1(active_texture, "Test cost of glActiveTexture() calls",
351 activeTexture,
352 GLenum,
353 ARG_LIST({
354 GL_TEXTURE0,
355 GL_TEXTURE1,
356 GL_TEXTURE2,
357 GL_TEXTURE3,
358 GL_TEXTURE4,
359 GL_TEXTURE5,
360 GL_TEXTURE6,
361 GL_TEXTURE7
362 })
363 );
364
365 ADD_ARG_CASE2(depth_range, "Test cost of glDepthRangef() calls",
366 depthRangef,
367 GLclampf,
368 ARG_LIST({
369 0.0f,
370 1.0f,
371 0.5f
372 }),
373 GLclampf,
374 ARG_LIST({
375 0.0f,
376 1.0f,
377 0.5f
378 })
379 );
380
381 ADD_ARG_CASE2(polygon_offset, "Test cost of glPolygonOffset() calls",
382 polygonOffset,
383 GLfloat,
384 ARG_LIST({
385 0.0f,
386 1.0f,
387 0.5f,
388 10.0f
389 }),
390 GLfloat,
391 ARG_LIST({
392 0.0f,
393 1.0f,
394 0.5f,
395 1000.0f
396 })
397 );
398
399 ADD_ARG_CASE2(sample_coverage, "Test cost of glSampleCoverage() calls",
400 sampleCoverage,
401 GLclampf,
402 ARG_LIST({
403 0.0f,
404 1.0f,
405 0.5f,
406 0.67f
407 }),
408 GLboolean,
409 ARG_LIST({
410 GL_TRUE,
411 GL_FALSE
412 })
413 );
414
415 ADD_ARG_CASE2(blend_func, "Test cost of glBlendFunc() calls",
416 blendFunc,
417 GLenum,
418 ARG_LIST({
419 GL_ZERO,
420 GL_ONE,
421 GL_SRC_COLOR,
422 GL_ONE_MINUS_SRC_COLOR,
423 GL_DST_COLOR,
424 GL_ONE_MINUS_DST_COLOR,
425 GL_SRC_ALPHA,
426 GL_ONE_MINUS_SRC_ALPHA,
427 GL_DST_ALPHA,
428 GL_ONE_MINUS_DST_ALPHA,
429 GL_CONSTANT_COLOR,
430 GL_ONE_MINUS_CONSTANT_COLOR,
431 GL_CONSTANT_ALPHA,
432 GL_ONE_MINUS_CONSTANT_ALPHA
433 }),
434 GLenum,
435 ARG_LIST({
436 GL_ZERO,
437 GL_ONE,
438 GL_SRC_COLOR,
439 GL_ONE_MINUS_SRC_COLOR,
440 GL_DST_COLOR,
441 GL_ONE_MINUS_DST_COLOR,
442 GL_SRC_ALPHA,
443 GL_ONE_MINUS_SRC_ALPHA,
444 GL_DST_ALPHA,
445 GL_ONE_MINUS_DST_ALPHA,
446 GL_CONSTANT_COLOR,
447 GL_ONE_MINUS_CONSTANT_COLOR,
448 GL_CONSTANT_ALPHA,
449 GL_ONE_MINUS_CONSTANT_ALPHA
450 })
451 );
452
453 ADD_ARG_CASE2(blend_equation_separate, "Test cost of glBlendEquationSeparate() calls",
454 blendEquationSeparate,
455 GLenum,
456 ARG_LIST({
457 GL_FUNC_ADD,
458 GL_FUNC_SUBTRACT,
459 GL_FUNC_REVERSE_SUBTRACT
460 }),
461 GLenum,
462 ARG_LIST({
463 GL_FUNC_ADD,
464 GL_FUNC_SUBTRACT,
465 GL_FUNC_REVERSE_SUBTRACT
466 })
467 );
468
469 ADD_ARG_CASE2(stencil_mask_separate, "Test cost of glStencilMaskSeparate() calls",
470 stencilMaskSeparate,
471 GLenum,
472 ARG_LIST({
473 GL_FRONT,
474 GL_BACK,
475 GL_FRONT_AND_BACK
476 }),
477 GLboolean,
478 ARG_LIST({
479 GL_TRUE,
480 GL_FALSE
481 })
482 );
483
484 ADD_ARG_CASE2(bind_buffer, "Test cost of glBindBuffer() calls. Note: Uses only buffer 0",
485 bindBuffer,
486 GLenum,
487 ARG_LIST({
488 GL_ELEMENT_ARRAY_BUFFER,
489 GL_ARRAY_BUFFER
490 }),
491 GLuint,
492 ARG_LIST({
493 0
494 })
495 );
496
497 ADD_ARG_CASE2(bind_texture, "Test cost of glBindTexture() calls. Note: Uses only texture 0",
498 bindTexture,
499 GLenum,
500 ARG_LIST({
501 GL_TEXTURE_2D,
502 GL_TEXTURE_CUBE_MAP
503 }),
504 GLuint,
505 ARG_LIST({
506 0
507 })
508 );
509
510 ADD_ARG_CASE2(hint, "Test cost of glHint() calls",
511 hint,
512 GLenum,
513 ARG_LIST({
514 GL_GENERATE_MIPMAP_HINT
515 }),
516 GLenum,
517 ARG_LIST({
518 GL_FASTEST,
519 GL_NICEST,
520 GL_DONT_CARE
521 })
522 );
523
524 ADD_ARG_CASE3(stencil_func, "Test cost of glStencilFunc() calls",
525 stencilFunc,
526 GLenum,
527 ARG_LIST({
528 GL_NEVER,
529 GL_ALWAYS,
530 GL_LESS,
531 GL_LEQUAL,
532 GL_EQUAL,
533 GL_GEQUAL,
534 GL_GREATER,
535 GL_NOTEQUAL
536 }),
537 GLint,
538 ARG_LIST({
539 0,
540 1,
541 255,
542 128,
543 7
544 }),
545 GLuint,
546 ARG_LIST({
547 0,
548 1,
549 255,
550 128,
551 7,
552 0xFFFFFFFF
553 })
554 );
555
556 ADD_ARG_CASE3(stencil_op, "Test cost of glStencilOp() calls",
557 stencilOp,
558 GLenum,
559 ARG_LIST({
560 GL_KEEP,
561 GL_ZERO,
562 GL_REPLACE,
563 GL_INCR,
564 GL_DECR,
565 GL_INVERT,
566 GL_INCR_WRAP,
567 GL_DECR_WRAP
568 }),
569 GLenum,
570 ARG_LIST({
571 GL_KEEP,
572 GL_ZERO,
573 GL_REPLACE,
574 GL_INCR,
575 GL_DECR,
576 GL_INVERT,
577 GL_INCR_WRAP,
578 GL_DECR_WRAP
579 }),
580 GLenum,
581 ARG_LIST({
582 GL_KEEP,
583 GL_ZERO,
584 GL_REPLACE,
585 GL_INCR,
586 GL_DECR,
587 GL_INVERT,
588 GL_INCR_WRAP,
589 GL_DECR_WRAP
590 })
591 );
592
593 ADD_ARG_CASE4(viewport, "Test cost of glViewport() calls",
594 viewport,
595 GLint,
596 ARG_LIST({
597 0,
598 1,
599 100,
600 1145235
601 }),
602 GLint,
603 ARG_LIST({
604 0,
605 1,
606 100,
607 1145235
608 }),
609 GLint,
610 ARG_LIST({
611 0,
612 1,
613 100,
614 1145235
615 }),
616 GLint,
617 ARG_LIST({
618 0,
619 1,
620 100,
621 1145235
622 })
623 );
624
625 ADD_ARG_CASE4(scissor, "Test cost of glScissor() calls",
626 scissor,
627 GLint,
628 ARG_LIST({
629 0,
630 1,
631 100,
632 1145235
633 }),
634 GLint,
635 ARG_LIST({
636 0,
637 1,
638 100,
639 1145235
640 }),
641 GLint,
642 ARG_LIST({
643 0,
644 1,
645 100,
646 1145235
647 }),
648 GLint,
649 ARG_LIST({
650 0,
651 1,
652 100,
653 1145235
654 })
655 );
656
657 ADD_ARG_CASE4(stencil_func_separate, "Test cost of glStencilFuncSeparate() calls",
658 stencilFuncSeparate,
659 GLenum,
660 ARG_LIST({
661 GL_FRONT,
662 GL_BACK,
663 GL_FRONT_AND_BACK
664 }),
665 GLenum,
666 ARG_LIST({
667 GL_NEVER,
668 GL_ALWAYS,
669 GL_LESS,
670 GL_LEQUAL,
671 GL_EQUAL,
672 GL_GEQUAL,
673 GL_GREATER,
674 GL_NOTEQUAL
675 }),
676 GLint,
677 ARG_LIST({
678 0,
679 1,
680 255,
681 128,
682 7
683 }),
684 GLuint,
685 ARG_LIST({
686 0,
687 1,
688 255,
689 128,
690 7,
691 0xFFFFFFFF
692 })
693 );
694
695 ADD_ARG_CASE4(stencil_op_separatae, "Test cost of glStencilOpSeparate() calls",
696 stencilOpSeparate,
697 GLenum,
698 ARG_LIST({
699 GL_FRONT,
700 GL_BACK,
701 GL_FRONT_AND_BACK
702 }),
703 GLenum,
704 ARG_LIST({
705 GL_KEEP,
706 GL_ZERO,
707 GL_REPLACE,
708 GL_INCR,
709 GL_DECR,
710 GL_INVERT,
711 GL_INCR_WRAP,
712 GL_DECR_WRAP
713 }),
714 GLenum,
715 ARG_LIST({
716 GL_KEEP,
717 GL_ZERO,
718 GL_REPLACE,
719 GL_INCR,
720 GL_DECR,
721 GL_INVERT,
722 GL_INCR_WRAP,
723 GL_DECR_WRAP
724 }),
725 GLenum,
726 ARG_LIST({
727 GL_KEEP,
728 GL_ZERO,
729 GL_REPLACE,
730 GL_INCR,
731 GL_DECR,
732 GL_INVERT,
733 GL_INCR_WRAP,
734 GL_DECR_WRAP
735 })
736 );
737
738 ADD_ARG_CASE4(blend_func_separate, "Test cost of glBlendFuncSeparate() calls",
739 blendFuncSeparate,
740 GLenum,
741 ARG_LIST({
742 GL_ZERO,
743 GL_ONE,
744 GL_SRC_COLOR,
745 GL_ONE_MINUS_SRC_COLOR,
746 GL_DST_COLOR,
747 GL_ONE_MINUS_DST_COLOR,
748 GL_SRC_ALPHA,
749 GL_ONE_MINUS_SRC_ALPHA,
750 GL_DST_ALPHA,
751 GL_ONE_MINUS_DST_ALPHA,
752 GL_CONSTANT_COLOR,
753 GL_ONE_MINUS_CONSTANT_COLOR,
754 GL_CONSTANT_ALPHA,
755 GL_ONE_MINUS_CONSTANT_ALPHA
756 }),
757 GLenum,
758 ARG_LIST({
759 GL_ZERO,
760 GL_ONE,
761 GL_SRC_COLOR,
762 GL_ONE_MINUS_SRC_COLOR,
763 GL_DST_COLOR,
764 GL_ONE_MINUS_DST_COLOR,
765 GL_SRC_ALPHA,
766 GL_ONE_MINUS_SRC_ALPHA,
767 GL_DST_ALPHA,
768 GL_ONE_MINUS_DST_ALPHA,
769 GL_CONSTANT_COLOR,
770 GL_ONE_MINUS_CONSTANT_COLOR,
771 GL_CONSTANT_ALPHA,
772 GL_ONE_MINUS_CONSTANT_ALPHA
773 }),
774 GLenum,
775 ARG_LIST({
776 GL_ZERO,
777 GL_ONE,
778 GL_SRC_COLOR,
779 GL_ONE_MINUS_SRC_COLOR,
780 GL_DST_COLOR,
781 GL_ONE_MINUS_DST_COLOR,
782 GL_SRC_ALPHA,
783 GL_ONE_MINUS_SRC_ALPHA,
784 GL_DST_ALPHA,
785 GL_ONE_MINUS_DST_ALPHA,
786 GL_CONSTANT_COLOR,
787 GL_ONE_MINUS_CONSTANT_COLOR,
788 GL_CONSTANT_ALPHA,
789 GL_ONE_MINUS_CONSTANT_ALPHA
790 }),
791 GLenum,
792 ARG_LIST({
793 GL_ZERO,
794 GL_ONE,
795 GL_SRC_COLOR,
796 GL_ONE_MINUS_SRC_COLOR,
797 GL_DST_COLOR,
798 GL_ONE_MINUS_DST_COLOR,
799 GL_SRC_ALPHA,
800 GL_ONE_MINUS_SRC_ALPHA,
801 GL_DST_ALPHA,
802 GL_ONE_MINUS_DST_ALPHA,
803 GL_CONSTANT_COLOR,
804 GL_ONE_MINUS_CONSTANT_COLOR,
805 GL_CONSTANT_ALPHA,
806 GL_ONE_MINUS_CONSTANT_ALPHA
807 })
808 );
809
810 ADD_ARG_CASE4(color_mask, "Test cost of glColorMask() calls",
811 colorMask,
812 GLboolean,
813 ARG_LIST({
814 GL_TRUE,
815 GL_FALSE
816 }),
817 GLboolean,
818 ARG_LIST({
819 GL_TRUE,
820 GL_FALSE
821 }),
822 GLboolean,
823 ARG_LIST({
824 GL_TRUE,
825 GL_FALSE
826 }),
827 GLboolean,
828 ARG_LIST({
829 GL_TRUE,
830 GL_FALSE
831 })
832 );
833
834 ADD_ARG_CASE4(clear_color, "Test cost of glClearColor() calls",
835 clearColor,
836 GLclampf,
837 ARG_LIST({
838 0.0f,
839 1.0f,
840 0.5f,
841 0.33f
842 }),
843 GLclampf,
844 ARG_LIST({
845 0.0f,
846 1.0f,
847 0.5f,
848 0.33f
849 }),
850 GLclampf,
851 ARG_LIST({
852 0.0f,
853 1.0f,
854 0.5f,
855 0.33f
856 }),
857 GLclampf,
858 ARG_LIST({
859 0.0f,
860 1.0f,
861 0.5f,
862 0.33f
863 })
864 );
865
866 ADD_ARG_CASE6(vertex_attrib_pointer, "Test cost of glVertexAttribPointer() calls",
867 vertexAttribPointer,
868 GLuint,
869 ARG_LIST({
870 0,
871 1,
872 2,
873 3,
874 4,
875 5,
876 6,
877 7
878 }),
879 GLint,
880 ARG_LIST({
881 1,
882 2,
883 3,
884 4
885 }),
886 GLenum,
887 ARG_LIST({
888 GL_UNSIGNED_BYTE,
889 GL_BYTE,
890 GL_UNSIGNED_SHORT,
891 GL_SHORT,
892 GL_FLOAT
893 }),
894 GLboolean,
895 ARG_LIST({
896 GL_FALSE,
897 GL_TRUE
898 }),
899 GLsizei,
900 ARG_LIST({
901 0,
902 2,
903 4
904 }),
905 void*,
906 ARG_LIST({
907 (void*)(deUintptr)(0x0FF),
908 (void*)(deUintptr)(0x0EF)
909 })
910 );
911 }
912
913 } // Performance
914 } // gles2
915 } // deqp
916