1e5c31af7Sopenharmony_ci/*-------------------------------------------------------------------------
2e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES 3.0 Module
3e5c31af7Sopenharmony_ci * -------------------------------------------------
4e5c31af7Sopenharmony_ci *
5e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project
6e5c31af7Sopenharmony_ci *
7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License.
9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at
10e5c31af7Sopenharmony_ci *
11e5c31af7Sopenharmony_ci *      http://www.apache.org/licenses/LICENSE-2.0
12e5c31af7Sopenharmony_ci *
13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and
17e5c31af7Sopenharmony_ci * limitations under the License.
18e5c31af7Sopenharmony_ci *
19e5c31af7Sopenharmony_ci *//*!
20e5c31af7Sopenharmony_ci * \file
21e5c31af7Sopenharmony_ci * \brief Texture count performance tests.
22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci#include "es3pTextureCountTests.hpp"
25e5c31af7Sopenharmony_ci#include "es3pTextureCases.hpp"
26e5c31af7Sopenharmony_ci#include "gluStrUtil.hpp"
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_ci#include "deStringUtil.hpp"
29e5c31af7Sopenharmony_ci
30e5c31af7Sopenharmony_ci#include "glwEnums.hpp"
31e5c31af7Sopenharmony_ci
32e5c31af7Sopenharmony_ciusing std::string;
33e5c31af7Sopenharmony_ci
34e5c31af7Sopenharmony_cinamespace deqp
35e5c31af7Sopenharmony_ci{
36e5c31af7Sopenharmony_cinamespace gles3
37e5c31af7Sopenharmony_ci{
38e5c31af7Sopenharmony_cinamespace Performance
39e5c31af7Sopenharmony_ci{
40e5c31af7Sopenharmony_ci
41e5c31af7Sopenharmony_ciTextureCountTests::TextureCountTests (Context& context)
42e5c31af7Sopenharmony_ci	: TestCaseGroup(context, "count", "Texture Count Performance Tests")
43e5c31af7Sopenharmony_ci{
44e5c31af7Sopenharmony_ci}
45e5c31af7Sopenharmony_ci
46e5c31af7Sopenharmony_ciTextureCountTests::~TextureCountTests (void)
47e5c31af7Sopenharmony_ci{
48e5c31af7Sopenharmony_ci}
49e5c31af7Sopenharmony_ci
50e5c31af7Sopenharmony_civoid TextureCountTests::init (void)
51e5c31af7Sopenharmony_ci{
52e5c31af7Sopenharmony_ci	static const struct
53e5c31af7Sopenharmony_ci	{
54e5c31af7Sopenharmony_ci		const char*	name;
55e5c31af7Sopenharmony_ci		deUint32	internalFormat;
56e5c31af7Sopenharmony_ci	} texFormats[] =
57e5c31af7Sopenharmony_ci	{
58e5c31af7Sopenharmony_ci		{ "rgb565",		GL_RGB565	},
59e5c31af7Sopenharmony_ci		{ "rgb8",		GL_RGB8		},
60e5c31af7Sopenharmony_ci		{ "rgba8",		GL_RGBA8	},
61e5c31af7Sopenharmony_ci		{ "rgba8ui",	GL_RGBA8UI	},
62e5c31af7Sopenharmony_ci		{ "rg16f",		GL_RG16F	},
63e5c31af7Sopenharmony_ci		{ "rgba16f",	GL_RGBA16F	},
64e5c31af7Sopenharmony_ci		{ "rgba32f",	GL_RGBA32F	}
65e5c31af7Sopenharmony_ci	};
66e5c31af7Sopenharmony_ci	static const int texCounts[] = { 1, 2, 4, 8 };
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ci	for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(texFormats); formatNdx++)
69e5c31af7Sopenharmony_ci	{
70e5c31af7Sopenharmony_ci		for (int cntNdx = 0; cntNdx < DE_LENGTH_OF_ARRAY(texCounts); cntNdx++)
71e5c31af7Sopenharmony_ci		{
72e5c31af7Sopenharmony_ci			deUint32	format			= texFormats[formatNdx].internalFormat;
73e5c31af7Sopenharmony_ci			deUint32	wrapS			= GL_CLAMP_TO_EDGE;
74e5c31af7Sopenharmony_ci			deUint32	wrapT			= GL_CLAMP_TO_EDGE;
75e5c31af7Sopenharmony_ci			deUint32	minFilter		= GL_NEAREST;
76e5c31af7Sopenharmony_ci			deUint32	magFilter		= GL_NEAREST;
77e5c31af7Sopenharmony_ci			int			numTextures		= texCounts[cntNdx];
78e5c31af7Sopenharmony_ci			string		name			= string(texFormats[formatNdx].name) + "_" + de::toString(numTextures);
79e5c31af7Sopenharmony_ci			string		description		= glu::getTextureFormatName(format);
80e5c31af7Sopenharmony_ci
81e5c31af7Sopenharmony_ci			addChild(new Texture2DRenderCase(m_context, name.c_str(), description.c_str(), format, wrapS, wrapT, minFilter, magFilter, tcu::Mat3(), numTextures, false /* npot */));
82e5c31af7Sopenharmony_ci		}
83e5c31af7Sopenharmony_ci	}
84e5c31af7Sopenharmony_ci}
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci} // Performance
87e5c31af7Sopenharmony_ci} // gles3
88e5c31af7Sopenharmony_ci} // deqp
89