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 Shader - render state interaction tests.
22 *//*--------------------------------------------------------------------*/
23
24#include "es3fFragOpInteractionTests.hpp"
25#include "glsFragOpInteractionCase.hpp"
26#include "deStringUtil.hpp"
27
28namespace deqp
29{
30namespace gles3
31{
32namespace Functional
33{
34
35using gls::FragOpInteractionCase;
36
37FragOpInteractionTests::FragOpInteractionTests (Context& context)
38	: TestCaseGroup(context, "interaction", "Shader - Render State Interaction Tests")
39{
40}
41
42FragOpInteractionTests::~FragOpInteractionTests (void)
43{
44}
45
46void FragOpInteractionTests::init (void)
47{
48	// .basic
49	{
50		tcu::TestCaseGroup* const	basicGroup	= new tcu::TestCaseGroup(m_testCtx, "basic_shader", "Basic shaders");
51		const deUint32				baseSeed	= 0xac2301cf;
52		const int					numCases	= 100;
53		rsg::ProgramParameters		params;
54
55		addChild(basicGroup);
56
57		params.version					= rsg::VERSION_300;
58
59		params.useScalarConversions		= true;
60		params.useSwizzle				= true;
61		params.useComparisonOps			= true;
62		params.useConditionals			= true;
63
64		params.vertexParameters.randomize						= true;
65		params.vertexParameters.maxStatementDepth				= 3;
66		params.vertexParameters.maxStatementsPerBlock			= 4;
67		params.vertexParameters.maxExpressionDepth				= 4;
68		params.vertexParameters.maxCombinedVariableScalars		= 64;
69
70		params.fragmentParameters.randomize						= true;
71		params.fragmentParameters.maxStatementDepth				= 3;
72		params.fragmentParameters.maxStatementsPerBlock			= 4;
73		params.fragmentParameters.maxExpressionDepth			= 4;
74		params.fragmentParameters.maxCombinedVariableScalars	= 64;
75
76		for (int ndx = 0; ndx < numCases; ndx++)
77		{
78			params.seed = baseSeed ^ deInt32Hash(ndx);
79			basicGroup->addChild(new FragOpInteractionCase(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), de::toString(ndx).c_str(), params));
80		}
81	}
82}
83
84} // Functional
85} // gles3
86} // deqp
87