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 Random shader tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "es2fRandomShaderTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "glsRandomShaderCase.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "deStringUtil.hpp"
27*35238bceSAndroid Build Coastguard Worker
28*35238bceSAndroid Build Coastguard Worker namespace deqp
29*35238bceSAndroid Build Coastguard Worker {
30*35238bceSAndroid Build Coastguard Worker namespace gles2
31*35238bceSAndroid Build Coastguard Worker {
32*35238bceSAndroid Build Coastguard Worker namespace Functional
33*35238bceSAndroid Build Coastguard Worker {
34*35238bceSAndroid Build Coastguard Worker
35*35238bceSAndroid Build Coastguard Worker namespace
36*35238bceSAndroid Build Coastguard Worker {
37*35238bceSAndroid Build Coastguard Worker
createRandomShaderCase(Context & context,const char * description,const rsg::ProgramParameters & baseParams,uint32_t seed,bool vertex,bool fragment)38*35238bceSAndroid Build Coastguard Worker gls::RandomShaderCase *createRandomShaderCase(Context &context, const char *description,
39*35238bceSAndroid Build Coastguard Worker const rsg::ProgramParameters &baseParams, uint32_t seed, bool vertex,
40*35238bceSAndroid Build Coastguard Worker bool fragment)
41*35238bceSAndroid Build Coastguard Worker {
42*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params = baseParams;
43*35238bceSAndroid Build Coastguard Worker
44*35238bceSAndroid Build Coastguard Worker params.seed = seed;
45*35238bceSAndroid Build Coastguard Worker params.vertexParameters.randomize = vertex;
46*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.randomize = fragment;
47*35238bceSAndroid Build Coastguard Worker
48*35238bceSAndroid Build Coastguard Worker return new gls::RandomShaderCase(context.getTestContext(), context.getRenderContext(), de::toString(seed).c_str(),
49*35238bceSAndroid Build Coastguard Worker description, params);
50*35238bceSAndroid Build Coastguard Worker }
51*35238bceSAndroid Build Coastguard Worker
52*35238bceSAndroid Build Coastguard Worker class BasicExpressionGroup : public TestCaseGroup
53*35238bceSAndroid Build Coastguard Worker {
54*35238bceSAndroid Build Coastguard Worker public:
BasicExpressionGroup(Context & context)55*35238bceSAndroid Build Coastguard Worker BasicExpressionGroup(Context &context) : TestCaseGroup(context, "basic_expression", "Basic arithmetic expressions")
56*35238bceSAndroid Build Coastguard Worker {
57*35238bceSAndroid Build Coastguard Worker }
58*35238bceSAndroid Build Coastguard Worker
init(void)59*35238bceSAndroid Build Coastguard Worker void init(void)
60*35238bceSAndroid Build Coastguard Worker {
61*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
62*35238bceSAndroid Build Coastguard Worker
63*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
64*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
65*35238bceSAndroid Build Coastguard Worker
66*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
67*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
68*35238bceSAndroid Build Coastguard Worker
69*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *combinedGroup = new tcu::TestCaseGroup(m_testCtx, "combined", "Combined tests");
70*35238bceSAndroid Build Coastguard Worker addChild(combinedGroup);
71*35238bceSAndroid Build Coastguard Worker
72*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
73*35238bceSAndroid Build Coastguard Worker {
74*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
75*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Random expressions in vertex shader", params, seed, true, false));
76*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
77*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Random expressions in fragment shader", params, seed, false, true));
78*35238bceSAndroid Build Coastguard Worker combinedGroup->addChild(createRandomShaderCase(
79*35238bceSAndroid Build Coastguard Worker m_context, "Random expressions in vertex and fragment shaders", params, seed, true, true));
80*35238bceSAndroid Build Coastguard Worker }
81*35238bceSAndroid Build Coastguard Worker }
82*35238bceSAndroid Build Coastguard Worker };
83*35238bceSAndroid Build Coastguard Worker
84*35238bceSAndroid Build Coastguard Worker class ScalarConversionGroup : public TestCaseGroup
85*35238bceSAndroid Build Coastguard Worker {
86*35238bceSAndroid Build Coastguard Worker public:
ScalarConversionGroup(Context & context)87*35238bceSAndroid Build Coastguard Worker ScalarConversionGroup(Context &context) : TestCaseGroup(context, "scalar_conversion", "Scalar conversions")
88*35238bceSAndroid Build Coastguard Worker {
89*35238bceSAndroid Build Coastguard Worker }
90*35238bceSAndroid Build Coastguard Worker
init(void)91*35238bceSAndroid Build Coastguard Worker void init(void)
92*35238bceSAndroid Build Coastguard Worker {
93*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
94*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
95*35238bceSAndroid Build Coastguard Worker
96*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
97*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
98*35238bceSAndroid Build Coastguard Worker
99*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
100*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
101*35238bceSAndroid Build Coastguard Worker
102*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *combinedGroup = new tcu::TestCaseGroup(m_testCtx, "combined", "Combined tests");
103*35238bceSAndroid Build Coastguard Worker addChild(combinedGroup);
104*35238bceSAndroid Build Coastguard Worker
105*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
106*35238bceSAndroid Build Coastguard Worker {
107*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
108*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Scalar conversions in vertex shader", params, seed, true, false));
109*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
110*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Scalar conversions in fragment shader", params, seed, false, true));
111*35238bceSAndroid Build Coastguard Worker combinedGroup->addChild(createRandomShaderCase(
112*35238bceSAndroid Build Coastguard Worker m_context, "Scalar conversions in vertex and fragment shaders", params, seed, true, true));
113*35238bceSAndroid Build Coastguard Worker }
114*35238bceSAndroid Build Coastguard Worker }
115*35238bceSAndroid Build Coastguard Worker };
116*35238bceSAndroid Build Coastguard Worker
117*35238bceSAndroid Build Coastguard Worker class SwizzleGroup : public TestCaseGroup
118*35238bceSAndroid Build Coastguard Worker {
119*35238bceSAndroid Build Coastguard Worker public:
SwizzleGroup(Context & context)120*35238bceSAndroid Build Coastguard Worker SwizzleGroup(Context &context) : TestCaseGroup(context, "swizzle", "Vector swizzles")
121*35238bceSAndroid Build Coastguard Worker {
122*35238bceSAndroid Build Coastguard Worker }
123*35238bceSAndroid Build Coastguard Worker
init(void)124*35238bceSAndroid Build Coastguard Worker void init(void)
125*35238bceSAndroid Build Coastguard Worker {
126*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
127*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
128*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
129*35238bceSAndroid Build Coastguard Worker
130*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
131*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
132*35238bceSAndroid Build Coastguard Worker
133*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
134*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
135*35238bceSAndroid Build Coastguard Worker
136*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 50; seed++)
137*35238bceSAndroid Build Coastguard Worker {
138*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
139*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Vector swizzles in vertex shader", params, seed, true, false));
140*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
141*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Vector swizzles in fragment shader", params, seed, false, true));
142*35238bceSAndroid Build Coastguard Worker }
143*35238bceSAndroid Build Coastguard Worker }
144*35238bceSAndroid Build Coastguard Worker };
145*35238bceSAndroid Build Coastguard Worker
146*35238bceSAndroid Build Coastguard Worker class ComparisonOpsGroup : public TestCaseGroup
147*35238bceSAndroid Build Coastguard Worker {
148*35238bceSAndroid Build Coastguard Worker public:
ComparisonOpsGroup(Context & context)149*35238bceSAndroid Build Coastguard Worker ComparisonOpsGroup(Context &context) : TestCaseGroup(context, "comparison_ops", "Comparison operators")
150*35238bceSAndroid Build Coastguard Worker {
151*35238bceSAndroid Build Coastguard Worker }
152*35238bceSAndroid Build Coastguard Worker
init(void)153*35238bceSAndroid Build Coastguard Worker void init(void)
154*35238bceSAndroid Build Coastguard Worker {
155*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
156*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
157*35238bceSAndroid Build Coastguard Worker params.useComparisonOps = true;
158*35238bceSAndroid Build Coastguard Worker
159*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
160*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
161*35238bceSAndroid Build Coastguard Worker
162*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
163*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
164*35238bceSAndroid Build Coastguard Worker
165*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 50; seed++)
166*35238bceSAndroid Build Coastguard Worker {
167*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
168*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Comparison operators in vertex shader", params, seed, true, false));
169*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(createRandomShaderCase(m_context, "Comparison operators in fragment shader", params,
170*35238bceSAndroid Build Coastguard Worker seed, false, true));
171*35238bceSAndroid Build Coastguard Worker }
172*35238bceSAndroid Build Coastguard Worker }
173*35238bceSAndroid Build Coastguard Worker };
174*35238bceSAndroid Build Coastguard Worker
175*35238bceSAndroid Build Coastguard Worker class ConditionalsGroup : public TestCaseGroup
176*35238bceSAndroid Build Coastguard Worker {
177*35238bceSAndroid Build Coastguard Worker public:
ConditionalsGroup(Context & context)178*35238bceSAndroid Build Coastguard Worker ConditionalsGroup(Context &context) : TestCaseGroup(context, "conditionals", "Conditional control flow (if-else)")
179*35238bceSAndroid Build Coastguard Worker {
180*35238bceSAndroid Build Coastguard Worker }
181*35238bceSAndroid Build Coastguard Worker
init(void)182*35238bceSAndroid Build Coastguard Worker void init(void)
183*35238bceSAndroid Build Coastguard Worker {
184*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
185*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
186*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
187*35238bceSAndroid Build Coastguard Worker params.useComparisonOps = true;
188*35238bceSAndroid Build Coastguard Worker params.useConditionals = true;
189*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxStatementDepth = 4;
190*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxStatementsPerBlock = 5;
191*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxStatementDepth = 4;
192*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxStatementsPerBlock = 5;
193*35238bceSAndroid Build Coastguard Worker
194*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
195*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
196*35238bceSAndroid Build Coastguard Worker
197*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
198*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
199*35238bceSAndroid Build Coastguard Worker
200*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *combinedGroup = new tcu::TestCaseGroup(m_testCtx, "combined", "Combined tests");
201*35238bceSAndroid Build Coastguard Worker addChild(combinedGroup);
202*35238bceSAndroid Build Coastguard Worker
203*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
204*35238bceSAndroid Build Coastguard Worker {
205*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(createRandomShaderCase(m_context, "Conditional control flow in vertex shader", params,
206*35238bceSAndroid Build Coastguard Worker seed, true, false));
207*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(createRandomShaderCase(m_context, "Conditional control flow in fragment shader",
208*35238bceSAndroid Build Coastguard Worker params, seed, false, true));
209*35238bceSAndroid Build Coastguard Worker combinedGroup->addChild(createRandomShaderCase(
210*35238bceSAndroid Build Coastguard Worker m_context, "Conditional control flow in vertex and fragment shaders", params, seed, true, true));
211*35238bceSAndroid Build Coastguard Worker }
212*35238bceSAndroid Build Coastguard Worker }
213*35238bceSAndroid Build Coastguard Worker };
214*35238bceSAndroid Build Coastguard Worker
215*35238bceSAndroid Build Coastguard Worker class TrigonometricGroup : public TestCaseGroup
216*35238bceSAndroid Build Coastguard Worker {
217*35238bceSAndroid Build Coastguard Worker public:
TrigonometricGroup(Context & context)218*35238bceSAndroid Build Coastguard Worker TrigonometricGroup(Context &context) : TestCaseGroup(context, "trigonometric", "Trigonometric built-in functions")
219*35238bceSAndroid Build Coastguard Worker {
220*35238bceSAndroid Build Coastguard Worker }
221*35238bceSAndroid Build Coastguard Worker
init(void)222*35238bceSAndroid Build Coastguard Worker void init(void)
223*35238bceSAndroid Build Coastguard Worker {
224*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
225*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
226*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
227*35238bceSAndroid Build Coastguard Worker params.trigonometricBaseWeight = 4.0f;
228*35238bceSAndroid Build Coastguard Worker
229*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
230*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
231*35238bceSAndroid Build Coastguard Worker
232*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
233*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
234*35238bceSAndroid Build Coastguard Worker
235*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
236*35238bceSAndroid Build Coastguard Worker {
237*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
238*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Trigonometric ops in vertex shader", params, seed, true, false));
239*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
240*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Trigonometric ops in fragment shader", params, seed, false, true));
241*35238bceSAndroid Build Coastguard Worker }
242*35238bceSAndroid Build Coastguard Worker }
243*35238bceSAndroid Build Coastguard Worker };
244*35238bceSAndroid Build Coastguard Worker
245*35238bceSAndroid Build Coastguard Worker class ExponentialGroup : public TestCaseGroup
246*35238bceSAndroid Build Coastguard Worker {
247*35238bceSAndroid Build Coastguard Worker public:
ExponentialGroup(Context & context)248*35238bceSAndroid Build Coastguard Worker ExponentialGroup(Context &context) : TestCaseGroup(context, "exponential", "Exponential built-in functions")
249*35238bceSAndroid Build Coastguard Worker {
250*35238bceSAndroid Build Coastguard Worker }
251*35238bceSAndroid Build Coastguard Worker
init(void)252*35238bceSAndroid Build Coastguard Worker void init(void)
253*35238bceSAndroid Build Coastguard Worker {
254*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
255*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
256*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
257*35238bceSAndroid Build Coastguard Worker params.exponentialBaseWeight = 4.0f;
258*35238bceSAndroid Build Coastguard Worker
259*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
260*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
261*35238bceSAndroid Build Coastguard Worker
262*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
263*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
264*35238bceSAndroid Build Coastguard Worker
265*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
266*35238bceSAndroid Build Coastguard Worker {
267*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
268*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Exponential ops in vertex shader", params, seed, true, false));
269*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
270*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Exponential ops in fragment shader", params, seed, false, true));
271*35238bceSAndroid Build Coastguard Worker }
272*35238bceSAndroid Build Coastguard Worker }
273*35238bceSAndroid Build Coastguard Worker };
274*35238bceSAndroid Build Coastguard Worker
275*35238bceSAndroid Build Coastguard Worker class TextureGroup : public TestCaseGroup
276*35238bceSAndroid Build Coastguard Worker {
277*35238bceSAndroid Build Coastguard Worker public:
TextureGroup(Context & context)278*35238bceSAndroid Build Coastguard Worker TextureGroup(Context &context) : TestCaseGroup(context, "texture", "Texture lookups")
279*35238bceSAndroid Build Coastguard Worker {
280*35238bceSAndroid Build Coastguard Worker }
281*35238bceSAndroid Build Coastguard Worker
init(void)282*35238bceSAndroid Build Coastguard Worker void init(void)
283*35238bceSAndroid Build Coastguard Worker {
284*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
285*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
286*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
287*35238bceSAndroid Build Coastguard Worker params.vertexParameters.texLookupBaseWeight = 10.0f;
288*35238bceSAndroid Build Coastguard Worker params.vertexParameters.useTexture2D = true;
289*35238bceSAndroid Build Coastguard Worker params.vertexParameters.useTextureCube = true;
290*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.texLookupBaseWeight = 10.0f;
291*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.useTexture2D = true;
292*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.useTextureCube = true;
293*35238bceSAndroid Build Coastguard Worker
294*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
295*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
296*35238bceSAndroid Build Coastguard Worker
297*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
298*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
299*35238bceSAndroid Build Coastguard Worker
300*35238bceSAndroid Build Coastguard Worker // Do only 50 vertex cases and 150 fragment cases.
301*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 50; seed++)
302*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
303*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Texture lookups in vertex shader", params, seed, true, false));
304*35238bceSAndroid Build Coastguard Worker
305*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 150; seed++)
306*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
307*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Texture lookups in fragment shader", params, seed, false, true));
308*35238bceSAndroid Build Coastguard Worker }
309*35238bceSAndroid Build Coastguard Worker };
310*35238bceSAndroid Build Coastguard Worker
311*35238bceSAndroid Build Coastguard Worker class AllFeaturesGroup : public TestCaseGroup
312*35238bceSAndroid Build Coastguard Worker {
313*35238bceSAndroid Build Coastguard Worker public:
AllFeaturesGroup(Context & context)314*35238bceSAndroid Build Coastguard Worker AllFeaturesGroup(Context &context) : TestCaseGroup(context, "all_features", "All features enabled")
315*35238bceSAndroid Build Coastguard Worker {
316*35238bceSAndroid Build Coastguard Worker }
317*35238bceSAndroid Build Coastguard Worker
init(void)318*35238bceSAndroid Build Coastguard Worker void init(void)
319*35238bceSAndroid Build Coastguard Worker {
320*35238bceSAndroid Build Coastguard Worker rsg::ProgramParameters params;
321*35238bceSAndroid Build Coastguard Worker params.useScalarConversions = true;
322*35238bceSAndroid Build Coastguard Worker params.useSwizzle = true;
323*35238bceSAndroid Build Coastguard Worker params.useComparisonOps = true;
324*35238bceSAndroid Build Coastguard Worker params.useConditionals = true;
325*35238bceSAndroid Build Coastguard Worker params.trigonometricBaseWeight = 1.0f;
326*35238bceSAndroid Build Coastguard Worker params.exponentialBaseWeight = 1.0f;
327*35238bceSAndroid Build Coastguard Worker
328*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxStatementDepth = 4;
329*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxStatementsPerBlock = 7;
330*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxExpressionDepth = 7;
331*35238bceSAndroid Build Coastguard Worker params.vertexParameters.maxCombinedVariableScalars = 64;
332*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxStatementDepth = 4;
333*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxStatementsPerBlock = 7;
334*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxExpressionDepth = 7;
335*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.maxCombinedVariableScalars = 64;
336*35238bceSAndroid Build Coastguard Worker
337*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.texLookupBaseWeight =
338*35238bceSAndroid Build Coastguard Worker 4.0f; // \note Texture lookups are enabled for fragment shaders only.
339*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.useTexture2D = true;
340*35238bceSAndroid Build Coastguard Worker params.fragmentParameters.useTextureCube = true;
341*35238bceSAndroid Build Coastguard Worker
342*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *vertexGroup = new tcu::TestCaseGroup(m_testCtx, "vertex", "Vertex-only tests");
343*35238bceSAndroid Build Coastguard Worker addChild(vertexGroup);
344*35238bceSAndroid Build Coastguard Worker
345*35238bceSAndroid Build Coastguard Worker tcu::TestCaseGroup *fragmentGroup = new tcu::TestCaseGroup(m_testCtx, "fragment", "Fragment-only tests");
346*35238bceSAndroid Build Coastguard Worker addChild(fragmentGroup);
347*35238bceSAndroid Build Coastguard Worker
348*35238bceSAndroid Build Coastguard Worker for (int seed = 0; seed < 100; seed++)
349*35238bceSAndroid Build Coastguard Worker {
350*35238bceSAndroid Build Coastguard Worker vertexGroup->addChild(
351*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Texture lookups in vertex shader", params, seed, true, false));
352*35238bceSAndroid Build Coastguard Worker fragmentGroup->addChild(
353*35238bceSAndroid Build Coastguard Worker createRandomShaderCase(m_context, "Texture lookups in fragment shader", params, seed, false, true));
354*35238bceSAndroid Build Coastguard Worker }
355*35238bceSAndroid Build Coastguard Worker }
356*35238bceSAndroid Build Coastguard Worker };
357*35238bceSAndroid Build Coastguard Worker
358*35238bceSAndroid Build Coastguard Worker } // namespace
359*35238bceSAndroid Build Coastguard Worker
RandomShaderTests(Context & context)360*35238bceSAndroid Build Coastguard Worker RandomShaderTests::RandomShaderTests(Context &context) : TestCaseGroup(context, "random", "Random shaders")
361*35238bceSAndroid Build Coastguard Worker {
362*35238bceSAndroid Build Coastguard Worker }
363*35238bceSAndroid Build Coastguard Worker
~RandomShaderTests(void)364*35238bceSAndroid Build Coastguard Worker RandomShaderTests::~RandomShaderTests(void)
365*35238bceSAndroid Build Coastguard Worker {
366*35238bceSAndroid Build Coastguard Worker }
367*35238bceSAndroid Build Coastguard Worker
368*35238bceSAndroid Build Coastguard Worker namespace
369*35238bceSAndroid Build Coastguard Worker {
370*35238bceSAndroid Build Coastguard Worker
371*35238bceSAndroid Build Coastguard Worker } // namespace
372*35238bceSAndroid Build Coastguard Worker
init(void)373*35238bceSAndroid Build Coastguard Worker void RandomShaderTests::init(void)
374*35238bceSAndroid Build Coastguard Worker {
375*35238bceSAndroid Build Coastguard Worker addChild(new BasicExpressionGroup(m_context));
376*35238bceSAndroid Build Coastguard Worker addChild(new ScalarConversionGroup(m_context));
377*35238bceSAndroid Build Coastguard Worker addChild(new SwizzleGroup(m_context));
378*35238bceSAndroid Build Coastguard Worker addChild(new ComparisonOpsGroup(m_context));
379*35238bceSAndroid Build Coastguard Worker addChild(new ConditionalsGroup(m_context));
380*35238bceSAndroid Build Coastguard Worker addChild(new TrigonometricGroup(m_context));
381*35238bceSAndroid Build Coastguard Worker addChild(new ExponentialGroup(m_context));
382*35238bceSAndroid Build Coastguard Worker addChild(new TextureGroup(m_context));
383*35238bceSAndroid Build Coastguard Worker addChild(new AllFeaturesGroup(m_context));
384*35238bceSAndroid Build Coastguard Worker }
385*35238bceSAndroid Build Coastguard Worker
386*35238bceSAndroid Build Coastguard Worker } // namespace Functional
387*35238bceSAndroid Build Coastguard Worker } // namespace gles2
388*35238bceSAndroid Build Coastguard Worker } // namespace deqp
389