1e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 2e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL ES 2.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 format performance tests. 22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ci#include "es2pTextureFormatTests.hpp" 25e5c31af7Sopenharmony_ci#include "es2pTextureCases.hpp" 26e5c31af7Sopenharmony_ci#include "gluStrUtil.hpp" 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci#include "glwEnums.hpp" 29e5c31af7Sopenharmony_ci 30e5c31af7Sopenharmony_ciusing std::string; 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_cinamespace deqp 33e5c31af7Sopenharmony_ci{ 34e5c31af7Sopenharmony_cinamespace gles2 35e5c31af7Sopenharmony_ci{ 36e5c31af7Sopenharmony_cinamespace Performance 37e5c31af7Sopenharmony_ci{ 38e5c31af7Sopenharmony_ci 39e5c31af7Sopenharmony_ciTextureFormatTests::TextureFormatTests (Context& context) 40e5c31af7Sopenharmony_ci : TestCaseGroup(context, "format", "Texture Format Performance Tests") 41e5c31af7Sopenharmony_ci{ 42e5c31af7Sopenharmony_ci} 43e5c31af7Sopenharmony_ci 44e5c31af7Sopenharmony_ciTextureFormatTests::~TextureFormatTests (void) 45e5c31af7Sopenharmony_ci{ 46e5c31af7Sopenharmony_ci} 47e5c31af7Sopenharmony_ci 48e5c31af7Sopenharmony_civoid TextureFormatTests::init (void) 49e5c31af7Sopenharmony_ci{ 50e5c31af7Sopenharmony_ci static const struct 51e5c31af7Sopenharmony_ci { 52e5c31af7Sopenharmony_ci const char* name; 53e5c31af7Sopenharmony_ci deUint32 format; 54e5c31af7Sopenharmony_ci deUint32 dataType; 55e5c31af7Sopenharmony_ci } texFormats[] = 56e5c31af7Sopenharmony_ci { 57e5c31af7Sopenharmony_ci { "a8", GL_ALPHA, GL_UNSIGNED_BYTE }, 58e5c31af7Sopenharmony_ci { "l8", GL_LUMINANCE, GL_UNSIGNED_BYTE }, 59e5c31af7Sopenharmony_ci { "la88", GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE }, 60e5c31af7Sopenharmony_ci { "rgb565", GL_RGB, GL_UNSIGNED_SHORT_5_6_5 }, 61e5c31af7Sopenharmony_ci { "rgba4444", GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4 }, 62e5c31af7Sopenharmony_ci { "rgba5551", GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1 }, 63e5c31af7Sopenharmony_ci { "rgb888", GL_RGB, GL_UNSIGNED_BYTE }, 64e5c31af7Sopenharmony_ci { "rgba8888", GL_RGBA, GL_UNSIGNED_BYTE } 65e5c31af7Sopenharmony_ci }; 66e5c31af7Sopenharmony_ci 67e5c31af7Sopenharmony_ci for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(texFormats); formatNdx++) 68e5c31af7Sopenharmony_ci { 69e5c31af7Sopenharmony_ci deUint32 format = texFormats[formatNdx].format; 70e5c31af7Sopenharmony_ci deUint32 dataType = texFormats[formatNdx].dataType; 71e5c31af7Sopenharmony_ci string nameBase = texFormats[formatNdx].name; 72e5c31af7Sopenharmony_ci deUint32 wrapS = GL_CLAMP_TO_EDGE; 73e5c31af7Sopenharmony_ci deUint32 wrapT = GL_CLAMP_TO_EDGE; 74e5c31af7Sopenharmony_ci deUint32 minFilter = GL_NEAREST; 75e5c31af7Sopenharmony_ci deUint32 magFilter = GL_NEAREST; 76e5c31af7Sopenharmony_ci int numTextures = 1; 77e5c31af7Sopenharmony_ci string descriptionBase = string(glu::getTextureFormatName(format)) + ", " + glu::getTypeName(dataType); 78e5c31af7Sopenharmony_ci 79e5c31af7Sopenharmony_ci addChild(new Texture2DRenderCase(m_context, nameBase.c_str(), descriptionBase.c_str(), format, dataType, wrapS, wrapT, minFilter, magFilter, tcu::Mat3(), numTextures, false /* npot */)); 80e5c31af7Sopenharmony_ci } 81e5c31af7Sopenharmony_ci} 82e5c31af7Sopenharmony_ci 83e5c31af7Sopenharmony_ci} // Performance 84e5c31af7Sopenharmony_ci} // gles2 85e5c31af7Sopenharmony_ci} // deqp 86