1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Quality Program OpenGL ES 2.0 Module
3*35238bceSAndroid Build Coastguard Worker * -------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker *
5*35238bceSAndroid Build Coastguard Worker * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker *
7*35238bceSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker *
11*35238bceSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker *
13*35238bceSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker *
19*35238bceSAndroid Build Coastguard Worker *//*!
20*35238bceSAndroid Build Coastguard Worker * \file
21*35238bceSAndroid Build Coastguard Worker * \brief State change call performance tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "es2pStateChangeCallTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "glsStateChangePerfTestCases.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "glwFunctions.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "glwEnums.hpp"
28*35238bceSAndroid Build Coastguard Worker
29*35238bceSAndroid Build Coastguard Worker namespace deqp
30*35238bceSAndroid Build Coastguard Worker {
31*35238bceSAndroid Build Coastguard Worker namespace gles2
32*35238bceSAndroid Build Coastguard Worker {
33*35238bceSAndroid Build Coastguard Worker namespace Performance
34*35238bceSAndroid Build Coastguard Worker {
35*35238bceSAndroid Build Coastguard Worker
36*35238bceSAndroid Build Coastguard Worker using namespace glw;
37*35238bceSAndroid Build Coastguard Worker
StateChangeCallTests(Context & context)38*35238bceSAndroid Build Coastguard Worker StateChangeCallTests::StateChangeCallTests(Context &context)
39*35238bceSAndroid Build Coastguard Worker : TestCaseGroup(context, "state_change_only", "Test cost of state change calls without rendering anything")
40*35238bceSAndroid Build Coastguard Worker {
41*35238bceSAndroid Build Coastguard Worker }
42*35238bceSAndroid Build Coastguard Worker
~StateChangeCallTests(void)43*35238bceSAndroid Build Coastguard Worker StateChangeCallTests::~StateChangeCallTests(void)
44*35238bceSAndroid Build Coastguard Worker {
45*35238bceSAndroid Build Coastguard Worker }
46*35238bceSAndroid Build Coastguard Worker
47*35238bceSAndroid Build Coastguard Worker #define ARG_LIST(...) __VA_ARGS__
48*35238bceSAndroid Build Coastguard Worker
49*35238bceSAndroid Build Coastguard Worker #define ADD_ARG_CASE1(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0) \
50*35238bceSAndroid Build Coastguard Worker do \
51*35238bceSAndroid Build Coastguard Worker { \
52*35238bceSAndroid Build Coastguard Worker class StateChangeCallTest_##NAME : public gls::StateChangeCallPerformanceCase \
53*35238bceSAndroid Build Coastguard Worker { \
54*35238bceSAndroid Build Coastguard Worker public: \
55*35238bceSAndroid Build Coastguard Worker StateChangeCallTest_##NAME(Context &context, const char *name, const char *description) \
56*35238bceSAndroid Build Coastguard Worker : gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, \
57*35238bceSAndroid Build Coastguard Worker description) \
58*35238bceSAndroid Build Coastguard Worker { \
59*35238bceSAndroid Build Coastguard Worker } \
60*35238bceSAndroid Build Coastguard Worker virtual void execCalls(const glw::Functions &gl, int iterNdx, int callCount) \
61*35238bceSAndroid Build Coastguard Worker { \
62*35238bceSAndroid Build Coastguard Worker const TYPE0 args0[] = ARGS0; \
63*35238bceSAndroid Build Coastguard Worker for (int callNdx = 0; callNdx < callCount; callNdx++) \
64*35238bceSAndroid Build Coastguard Worker { \
65*35238bceSAndroid Build Coastguard Worker const int baseNdx = iterNdx * callCount + callNdx; \
66*35238bceSAndroid Build Coastguard Worker const TYPE0 arg0 = args0[baseNdx % DE_LENGTH_OF_ARRAY(args0)]; \
67*35238bceSAndroid Build Coastguard Worker gl.FUNCNAME(arg0); \
68*35238bceSAndroid Build Coastguard Worker } \
69*35238bceSAndroid Build Coastguard Worker } \
70*35238bceSAndroid Build Coastguard Worker }; \
71*35238bceSAndroid Build Coastguard Worker addChild(new StateChangeCallTest_##NAME(m_context, #NAME, DESCRIPTION)); \
72*35238bceSAndroid Build Coastguard Worker } while (0);
73*35238bceSAndroid Build Coastguard Worker
74*35238bceSAndroid Build Coastguard Worker #define ADD_ARG_CASE2(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1) \
75*35238bceSAndroid Build Coastguard Worker do \
76*35238bceSAndroid Build Coastguard Worker { \
77*35238bceSAndroid Build Coastguard Worker class StateChangeCallTest_##NAME : public gls::StateChangeCallPerformanceCase \
78*35238bceSAndroid Build Coastguard Worker { \
79*35238bceSAndroid Build Coastguard Worker public: \
80*35238bceSAndroid Build Coastguard Worker StateChangeCallTest_##NAME(Context &context, const char *name, const char *description) \
81*35238bceSAndroid Build Coastguard Worker : gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, \
82*35238bceSAndroid Build Coastguard Worker description) \
83*35238bceSAndroid Build Coastguard Worker { \
84*35238bceSAndroid Build Coastguard Worker } \
85*35238bceSAndroid Build Coastguard Worker virtual void execCalls(const glw::Functions &gl, int iterNdx, int callCount) \
86*35238bceSAndroid Build Coastguard Worker { \
87*35238bceSAndroid Build Coastguard Worker const TYPE0 args0[] = ARGS0; \
88*35238bceSAndroid Build Coastguard Worker const TYPE1 args1[] = ARGS1; \
89*35238bceSAndroid Build Coastguard Worker for (int callNdx = 0; callNdx < callCount; callNdx++) \
90*35238bceSAndroid Build Coastguard Worker { \
91*35238bceSAndroid Build Coastguard Worker const int baseNdx = iterNdx * callCount + callNdx; \
92*35238bceSAndroid Build Coastguard Worker const TYPE0 arg0 = args0[baseNdx % DE_LENGTH_OF_ARRAY(args0)]; \
93*35238bceSAndroid Build Coastguard Worker const TYPE1 arg1 = args1[baseNdx % DE_LENGTH_OF_ARRAY(args1)]; \
94*35238bceSAndroid Build Coastguard Worker gl.FUNCNAME(arg0, arg1); \
95*35238bceSAndroid Build Coastguard Worker } \
96*35238bceSAndroid Build Coastguard Worker } \
97*35238bceSAndroid Build Coastguard Worker }; \
98*35238bceSAndroid Build Coastguard Worker addChild(new StateChangeCallTest_##NAME(m_context, #NAME, DESCRIPTION)); \
99*35238bceSAndroid Build Coastguard Worker } while (0);
100*35238bceSAndroid Build Coastguard Worker
101*35238bceSAndroid Build Coastguard Worker #define ADD_ARG_CASE3(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2) \
102*35238bceSAndroid Build Coastguard Worker do \
103*35238bceSAndroid Build Coastguard Worker { \
104*35238bceSAndroid Build Coastguard Worker class StateChangeCallTest_##NAME : public gls::StateChangeCallPerformanceCase \
105*35238bceSAndroid Build Coastguard Worker { \
106*35238bceSAndroid Build Coastguard Worker public: \
107*35238bceSAndroid Build Coastguard Worker StateChangeCallTest_##NAME(Context &context, const char *name, const char *description) \
108*35238bceSAndroid Build Coastguard Worker : gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, \
109*35238bceSAndroid Build Coastguard Worker description) \
110*35238bceSAndroid Build Coastguard Worker { \
111*35238bceSAndroid Build Coastguard Worker } \
112*35238bceSAndroid Build Coastguard Worker virtual void execCalls(const glw::Functions &gl, int iterNdx, int callCount) \
113*35238bceSAndroid Build Coastguard Worker { \
114*35238bceSAndroid Build Coastguard Worker const TYPE0 args0[] = ARGS0; \
115*35238bceSAndroid Build Coastguard Worker const TYPE1 args1[] = ARGS1; \
116*35238bceSAndroid Build Coastguard Worker const TYPE2 args2[] = ARGS2; \
117*35238bceSAndroid Build Coastguard Worker for (int callNdx = 0; callNdx < callCount; callNdx++) \
118*35238bceSAndroid Build Coastguard Worker { \
119*35238bceSAndroid Build Coastguard Worker const int baseNdx = iterNdx * callCount + callNdx; \
120*35238bceSAndroid Build Coastguard Worker const TYPE0 arg0 = args0[baseNdx % DE_LENGTH_OF_ARRAY(args0)]; \
121*35238bceSAndroid Build Coastguard Worker const TYPE1 arg1 = args1[baseNdx % DE_LENGTH_OF_ARRAY(args1)]; \
122*35238bceSAndroid Build Coastguard Worker const TYPE2 arg2 = args2[baseNdx % DE_LENGTH_OF_ARRAY(args2)]; \
123*35238bceSAndroid Build Coastguard Worker gl.FUNCNAME(arg0, arg1, arg2); \
124*35238bceSAndroid Build Coastguard Worker } \
125*35238bceSAndroid Build Coastguard Worker } \
126*35238bceSAndroid Build Coastguard Worker }; \
127*35238bceSAndroid Build Coastguard Worker addChild(new StateChangeCallTest_##NAME(m_context, #NAME, DESCRIPTION)); \
128*35238bceSAndroid Build Coastguard Worker } while (0);
129*35238bceSAndroid Build Coastguard Worker
130*35238bceSAndroid Build Coastguard Worker #define ADD_ARG_CASE4(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3) \
131*35238bceSAndroid Build Coastguard Worker do \
132*35238bceSAndroid Build Coastguard Worker { \
133*35238bceSAndroid Build Coastguard Worker class StateChangeCallTest_##NAME : public gls::StateChangeCallPerformanceCase \
134*35238bceSAndroid Build Coastguard Worker { \
135*35238bceSAndroid Build Coastguard Worker public: \
136*35238bceSAndroid Build Coastguard Worker StateChangeCallTest_##NAME(Context &context, const char *name, const char *description) \
137*35238bceSAndroid Build Coastguard Worker : gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, \
138*35238bceSAndroid Build Coastguard Worker description) \
139*35238bceSAndroid Build Coastguard Worker { \
140*35238bceSAndroid Build Coastguard Worker } \
141*35238bceSAndroid Build Coastguard Worker virtual void execCalls(const glw::Functions &gl, int iterNdx, int callCount) \
142*35238bceSAndroid Build Coastguard Worker { \
143*35238bceSAndroid Build Coastguard Worker const TYPE0 args0[] = ARGS0; \
144*35238bceSAndroid Build Coastguard Worker const TYPE1 args1[] = ARGS1; \
145*35238bceSAndroid Build Coastguard Worker const TYPE2 args2[] = ARGS2; \
146*35238bceSAndroid Build Coastguard Worker const TYPE3 args3[] = ARGS3; \
147*35238bceSAndroid Build Coastguard Worker for (int callNdx = 0; callNdx < callCount; callNdx++) \
148*35238bceSAndroid Build Coastguard Worker { \
149*35238bceSAndroid Build Coastguard Worker const int baseNdx = iterNdx * callCount + callNdx; \
150*35238bceSAndroid Build Coastguard Worker const TYPE0 arg0 = args0[baseNdx % DE_LENGTH_OF_ARRAY(args0)]; \
151*35238bceSAndroid Build Coastguard Worker const TYPE1 arg1 = args1[baseNdx % DE_LENGTH_OF_ARRAY(args1)]; \
152*35238bceSAndroid Build Coastguard Worker const TYPE2 arg2 = args2[baseNdx % DE_LENGTH_OF_ARRAY(args2)]; \
153*35238bceSAndroid Build Coastguard Worker const TYPE3 arg3 = args3[baseNdx % DE_LENGTH_OF_ARRAY(args3)]; \
154*35238bceSAndroid Build Coastguard Worker gl.FUNCNAME(arg0, arg1, arg2, arg3); \
155*35238bceSAndroid Build Coastguard Worker } \
156*35238bceSAndroid Build Coastguard Worker } \
157*35238bceSAndroid Build Coastguard Worker }; \
158*35238bceSAndroid Build Coastguard Worker addChild(new StateChangeCallTest_##NAME(m_context, #NAME, DESCRIPTION)); \
159*35238bceSAndroid Build Coastguard Worker } while (0);
160*35238bceSAndroid Build Coastguard Worker
161*35238bceSAndroid Build Coastguard Worker #define ADD_ARG_CASE6(NAME, DESCRIPTION, FUNCNAME, TYPE0, ARGS0, TYPE1, ARGS1, TYPE2, ARGS2, TYPE3, ARGS3, TYPE4, \
162*35238bceSAndroid Build Coastguard Worker ARGS4, TYPE5, ARGS5) \
163*35238bceSAndroid Build Coastguard Worker do \
164*35238bceSAndroid Build Coastguard Worker { \
165*35238bceSAndroid Build Coastguard Worker class StateChangeCallTest_##NAME : public gls::StateChangeCallPerformanceCase \
166*35238bceSAndroid Build Coastguard Worker { \
167*35238bceSAndroid Build Coastguard Worker public: \
168*35238bceSAndroid Build Coastguard Worker StateChangeCallTest_##NAME(Context &context, const char *name, const char *description) \
169*35238bceSAndroid Build Coastguard Worker : gls::StateChangeCallPerformanceCase(context.getTestContext(), context.getRenderContext(), name, \
170*35238bceSAndroid Build Coastguard Worker description) \
171*35238bceSAndroid Build Coastguard Worker { \
172*35238bceSAndroid Build Coastguard Worker } \
173*35238bceSAndroid Build Coastguard Worker virtual void execCalls(const glw::Functions &gl, int iterNdx, int callCount) \
174*35238bceSAndroid Build Coastguard Worker { \
175*35238bceSAndroid Build Coastguard Worker const TYPE0 args0[] = ARGS0; \
176*35238bceSAndroid Build Coastguard Worker const TYPE1 args1[] = ARGS1; \
177*35238bceSAndroid Build Coastguard Worker const TYPE2 args2[] = ARGS2; \
178*35238bceSAndroid Build Coastguard Worker const TYPE3 args3[] = ARGS3; \
179*35238bceSAndroid Build Coastguard Worker const TYPE4 args4[] = ARGS4; \
180*35238bceSAndroid Build Coastguard Worker const TYPE5 args5[] = ARGS5; \
181*35238bceSAndroid Build Coastguard Worker for (int callNdx = 0; callNdx < callCount; callNdx++) \
182*35238bceSAndroid Build Coastguard Worker { \
183*35238bceSAndroid Build Coastguard Worker const int baseNdx = iterNdx * callCount + callNdx; \
184*35238bceSAndroid Build Coastguard Worker const TYPE0 arg0 = args0[baseNdx % DE_LENGTH_OF_ARRAY(args0)]; \
185*35238bceSAndroid Build Coastguard Worker const TYPE1 arg1 = args1[baseNdx % DE_LENGTH_OF_ARRAY(args1)]; \
186*35238bceSAndroid Build Coastguard Worker const TYPE2 arg2 = args2[baseNdx % DE_LENGTH_OF_ARRAY(args2)]; \
187*35238bceSAndroid Build Coastguard Worker const TYPE3 arg3 = args3[baseNdx % DE_LENGTH_OF_ARRAY(args3)]; \
188*35238bceSAndroid Build Coastguard Worker const TYPE4 arg4 = args4[baseNdx % DE_LENGTH_OF_ARRAY(args4)]; \
189*35238bceSAndroid Build Coastguard Worker const TYPE5 arg5 = args5[baseNdx % DE_LENGTH_OF_ARRAY(args5)]; \
190*35238bceSAndroid Build Coastguard Worker gl.FUNCNAME(arg0, arg1, arg2, arg3, arg4, arg5); \
191*35238bceSAndroid Build Coastguard Worker } \
192*35238bceSAndroid Build Coastguard Worker } \
193*35238bceSAndroid Build Coastguard Worker }; \
194*35238bceSAndroid Build Coastguard Worker addChild(new StateChangeCallTest_##NAME(m_context, #NAME, DESCRIPTION)); \
195*35238bceSAndroid Build Coastguard Worker } while (0);
196*35238bceSAndroid Build Coastguard Worker
init(void)197*35238bceSAndroid Build Coastguard Worker void StateChangeCallTests::init(void)
198*35238bceSAndroid Build Coastguard Worker {
199*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(enable, "Test cost of glEnable() calls", enable, GLenum,
200*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_CULL_FACE, GL_POLYGON_OFFSET_FILL, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_COVERAGE,
201*35238bceSAndroid Build Coastguard Worker GL_SCISSOR_TEST, GL_STENCIL_TEST, GL_DEPTH_TEST, GL_BLEND, GL_DITHER}))
202*35238bceSAndroid Build Coastguard Worker
203*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(disable, "Test cost of glDisable() calls", disable, GLenum,
204*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_CULL_FACE, GL_POLYGON_OFFSET_FILL, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_COVERAGE,
205*35238bceSAndroid Build Coastguard Worker GL_SCISSOR_TEST, GL_STENCIL_TEST, GL_DEPTH_TEST, GL_BLEND, GL_DITHER}))
206*35238bceSAndroid Build Coastguard Worker
207*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(depth_func, "Test cost of glDepthFunc() calls", depthFunc, GLenum,
208*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GREATER, GL_GEQUAL, GL_NOTEQUAL}))
209*35238bceSAndroid Build Coastguard Worker
210*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(depth_mask, "Test cost of glDepthMask() calls", depthMask, GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}))
211*35238bceSAndroid Build Coastguard Worker
212*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(stencil_mask, "Test cost of glStencilMask() calls", stencilMask, GLboolean,
213*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_TRUE, GL_FALSE}))
214*35238bceSAndroid Build Coastguard Worker
215*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(clear_depth, "Test cost of glClearDepth() calls", clearDepthf, GLclampf, ARG_LIST({0.0f, 0.5f, 1.0f}))
216*35238bceSAndroid Build Coastguard Worker
217*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(clear_stencil, "Test cost of glClearStencil() calls", clearStencil, GLint, ARG_LIST({0, 128, 28}))
218*35238bceSAndroid Build Coastguard Worker
219*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(line_width, "Test cost of glLineWidth() calls", lineWidth, GLfloat, ARG_LIST({1.0f, 0.5f, 10.0f}))
220*35238bceSAndroid Build Coastguard Worker
221*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(cull_face, "Test cost of glCullFace() calls", cullFace, GLenum,
222*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FRONT, GL_BACK, GL_FRONT_AND_BACK}))
223*35238bceSAndroid Build Coastguard Worker
224*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(front_face, "Test cost of glFrontFace() calls", frontFace, GLenum, ARG_LIST({GL_CCW, GL_CW}))
225*35238bceSAndroid Build Coastguard Worker
226*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(blend_equation, "Test cost of glBlendEquation() calls", blendEquation, GLenum,
227*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT}))
228*35238bceSAndroid Build Coastguard Worker
229*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(enable_vertex_attrib_array, "Test cost of glEnableVertexAttribArray() calls", enableVertexAttribArray,
230*35238bceSAndroid Build Coastguard Worker GLuint,
231*35238bceSAndroid Build Coastguard Worker ARG_LIST({
232*35238bceSAndroid Build Coastguard Worker 0,
233*35238bceSAndroid Build Coastguard Worker 1,
234*35238bceSAndroid Build Coastguard Worker 2,
235*35238bceSAndroid Build Coastguard Worker 3,
236*35238bceSAndroid Build Coastguard Worker 4,
237*35238bceSAndroid Build Coastguard Worker 5,
238*35238bceSAndroid Build Coastguard Worker 6,
239*35238bceSAndroid Build Coastguard Worker 7,
240*35238bceSAndroid Build Coastguard Worker }))
241*35238bceSAndroid Build Coastguard Worker
242*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(disable_vertex_attrib_array, "Test cost of glDisableVertexAttribArray() calls",
243*35238bceSAndroid Build Coastguard Worker disableVertexAttribArray, GLuint,
244*35238bceSAndroid Build Coastguard Worker ARG_LIST({
245*35238bceSAndroid Build Coastguard Worker 0,
246*35238bceSAndroid Build Coastguard Worker 1,
247*35238bceSAndroid Build Coastguard Worker 2,
248*35238bceSAndroid Build Coastguard Worker 3,
249*35238bceSAndroid Build Coastguard Worker 4,
250*35238bceSAndroid Build Coastguard Worker 5,
251*35238bceSAndroid Build Coastguard Worker 6,
252*35238bceSAndroid Build Coastguard Worker 7,
253*35238bceSAndroid Build Coastguard Worker }))
254*35238bceSAndroid Build Coastguard Worker
255*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(use_program, "Test cost of glUseProgram() calls. Note: Uses only program 0.", useProgram, GLuint,
256*35238bceSAndroid Build Coastguard Worker ARG_LIST({
257*35238bceSAndroid Build Coastguard Worker 0,
258*35238bceSAndroid Build Coastguard Worker }))
259*35238bceSAndroid Build Coastguard Worker
260*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE1(active_texture, "Test cost of glActiveTexture() calls", activeTexture, GLenum,
261*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_TEXTURE0, GL_TEXTURE1, GL_TEXTURE2, GL_TEXTURE3, GL_TEXTURE4, GL_TEXTURE5, GL_TEXTURE6,
262*35238bceSAndroid Build Coastguard Worker GL_TEXTURE7}))
263*35238bceSAndroid Build Coastguard Worker
264*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(depth_range, "Test cost of glDepthRangef() calls", depthRangef, GLclampf,
265*35238bceSAndroid Build Coastguard Worker ARG_LIST({0.0f, 1.0f, 0.5f}), GLclampf, ARG_LIST({0.0f, 1.0f, 0.5f}))
266*35238bceSAndroid Build Coastguard Worker
267*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(polygon_offset, "Test cost of glPolygonOffset() calls", polygonOffset, GLfloat,
268*35238bceSAndroid Build Coastguard Worker ARG_LIST({0.0f, 1.0f, 0.5f, 10.0f}), GLfloat, ARG_LIST({0.0f, 1.0f, 0.5f, 1000.0f}))
269*35238bceSAndroid Build Coastguard Worker
270*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(sample_coverage, "Test cost of glSampleCoverage() calls", sampleCoverage, GLclampf,
271*35238bceSAndroid Build Coastguard Worker ARG_LIST({0.0f, 1.0f, 0.5f, 0.67f}), GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}))
272*35238bceSAndroid Build Coastguard Worker
273*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(
274*35238bceSAndroid Build Coastguard Worker blend_func, "Test cost of glBlendFunc() calls", blendFunc, GLenum,
275*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
276*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
277*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}),
278*35238bceSAndroid Build Coastguard Worker GLenum,
279*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
280*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
281*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}))
282*35238bceSAndroid Build Coastguard Worker
283*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(blend_equation_separate, "Test cost of glBlendEquationSeparate() calls", blendEquationSeparate,
284*35238bceSAndroid Build Coastguard Worker GLenum, ARG_LIST({GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT}), GLenum,
285*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT}))
286*35238bceSAndroid Build Coastguard Worker
287*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(stencil_mask_separate, "Test cost of glStencilMaskSeparate() calls", stencilMaskSeparate, GLenum,
288*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FRONT, GL_BACK, GL_FRONT_AND_BACK}), GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}))
289*35238bceSAndroid Build Coastguard Worker
290*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(bind_buffer, "Test cost of glBindBuffer() calls. Note: Uses only buffer 0", bindBuffer, GLenum,
291*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ELEMENT_ARRAY_BUFFER, GL_ARRAY_BUFFER}), GLuint, ARG_LIST({0}))
292*35238bceSAndroid Build Coastguard Worker
293*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(bind_texture, "Test cost of glBindTexture() calls. Note: Uses only texture 0", bindTexture, GLenum,
294*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP}), GLuint, ARG_LIST({0}))
295*35238bceSAndroid Build Coastguard Worker
296*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE2(hint, "Test cost of glHint() calls", hint, GLenum, ARG_LIST({GL_GENERATE_MIPMAP_HINT}), GLenum,
297*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FASTEST, GL_NICEST, GL_DONT_CARE}))
298*35238bceSAndroid Build Coastguard Worker
299*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE3(stencil_func, "Test cost of glStencilFunc() calls", stencilFunc, GLenum,
300*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL}),
301*35238bceSAndroid Build Coastguard Worker GLint, ARG_LIST({0, 1, 255, 128, 7}), GLuint, ARG_LIST({0, 1, 255, 128, 7, 0xFFFFFFFF}))
302*35238bceSAndroid Build Coastguard Worker
303*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE3(
304*35238bceSAndroid Build Coastguard Worker stencil_op, "Test cost of glStencilOp() calls", stencilOp, GLenum,
305*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}), GLenum,
306*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}), GLenum,
307*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}))
308*35238bceSAndroid Build Coastguard Worker
309*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(viewport, "Test cost of glViewport() calls", viewport, GLint, ARG_LIST({0, 1, 100, 1145235}), GLint,
310*35238bceSAndroid Build Coastguard Worker ARG_LIST({0, 1, 100, 1145235}), GLint, ARG_LIST({0, 1, 100, 1145235}), GLint,
311*35238bceSAndroid Build Coastguard Worker ARG_LIST({0, 1, 100, 1145235}))
312*35238bceSAndroid Build Coastguard Worker
313*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(scissor, "Test cost of glScissor() calls", scissor, GLint, ARG_LIST({0, 1, 100, 1145235}), GLint,
314*35238bceSAndroid Build Coastguard Worker ARG_LIST({0, 1, 100, 1145235}), GLint, ARG_LIST({0, 1, 100, 1145235}), GLint,
315*35238bceSAndroid Build Coastguard Worker ARG_LIST({0, 1, 100, 1145235}))
316*35238bceSAndroid Build Coastguard Worker
317*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(stencil_func_separate, "Test cost of glStencilFuncSeparate() calls", stencilFuncSeparate, GLenum,
318*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FRONT, GL_BACK, GL_FRONT_AND_BACK}), GLenum,
319*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL}),
320*35238bceSAndroid Build Coastguard Worker GLint, ARG_LIST({0, 1, 255, 128, 7}), GLuint, ARG_LIST({0, 1, 255, 128, 7, 0xFFFFFFFF}))
321*35238bceSAndroid Build Coastguard Worker
322*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(
323*35238bceSAndroid Build Coastguard Worker stencil_op_separatae, "Test cost of glStencilOpSeparate() calls", stencilOpSeparate, GLenum,
324*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FRONT, GL_BACK, GL_FRONT_AND_BACK}), GLenum,
325*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}), GLenum,
326*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}), GLenum,
327*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP}))
328*35238bceSAndroid Build Coastguard Worker
329*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(
330*35238bceSAndroid Build Coastguard Worker blend_func_separate, "Test cost of glBlendFuncSeparate() calls", blendFuncSeparate, GLenum,
331*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
332*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
333*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}),
334*35238bceSAndroid Build Coastguard Worker GLenum,
335*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
336*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
337*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}),
338*35238bceSAndroid Build Coastguard Worker GLenum,
339*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
340*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
341*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}),
342*35238bceSAndroid Build Coastguard Worker GLenum,
343*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
344*35238bceSAndroid Build Coastguard Worker GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
345*35238bceSAndroid Build Coastguard Worker GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA}))
346*35238bceSAndroid Build Coastguard Worker
347*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(color_mask, "Test cost of glColorMask() calls", colorMask, GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}),
348*35238bceSAndroid Build Coastguard Worker GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}), GLboolean, ARG_LIST({GL_TRUE, GL_FALSE}), GLboolean,
349*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_TRUE, GL_FALSE}))
350*35238bceSAndroid Build Coastguard Worker
351*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE4(clear_color, "Test cost of glClearColor() calls", clearColor, GLclampf,
352*35238bceSAndroid Build Coastguard Worker ARG_LIST({0.0f, 1.0f, 0.5f, 0.33f}), GLclampf, ARG_LIST({0.0f, 1.0f, 0.5f, 0.33f}), GLclampf,
353*35238bceSAndroid Build Coastguard Worker ARG_LIST({0.0f, 1.0f, 0.5f, 0.33f}), GLclampf, ARG_LIST({0.0f, 1.0f, 0.5f, 0.33f}))
354*35238bceSAndroid Build Coastguard Worker
355*35238bceSAndroid Build Coastguard Worker ADD_ARG_CASE6(vertex_attrib_pointer, "Test cost of glVertexAttribPointer() calls", vertexAttribPointer, GLuint,
356*35238bceSAndroid Build Coastguard Worker ARG_LIST({0, 1, 2, 3, 4, 5, 6, 7}), GLint, ARG_LIST({1, 2, 3, 4}), GLenum,
357*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_FLOAT}), GLboolean,
358*35238bceSAndroid Build Coastguard Worker ARG_LIST({GL_FALSE, GL_TRUE}), GLsizei, ARG_LIST({0, 2, 4}), void *,
359*35238bceSAndroid Build Coastguard Worker ARG_LIST({(void *)(uintptr_t)(0x0FF), (void *)(uintptr_t)(0x0EF)}))
360*35238bceSAndroid Build Coastguard Worker }
361*35238bceSAndroid Build Coastguard Worker
362*35238bceSAndroid Build Coastguard Worker } // namespace Performance
363*35238bceSAndroid Build Coastguard Worker } // namespace gles2
364*35238bceSAndroid Build Coastguard Worker } // namespace deqp
365