1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief Texture format performance tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es3pTextureFormatTests.hpp"
25 #include "es3pTextureCases.hpp"
26 #include "gluStrUtil.hpp"
28 #include "glwEnums.hpp"
39 TextureFormatTests::TextureFormatTests (Context& context)
40 : TestCaseGroup(context, "format", "Texture Format Performance Tests")
44 TextureFormatTests::~TextureFormatTests (void)
48 void TextureFormatTests::init (void)
53 deUint32 internalFormat;
56 { "rgba32f", GL_RGBA32F, },
57 { "rgba32i", GL_RGBA32I, },
58 { "rgba32ui", GL_RGBA32UI, },
59 { "rgba16f", GL_RGBA16F, },
60 { "rgba16i", GL_RGBA16I, },
61 { "rgba16ui", GL_RGBA16UI, },
62 { "rgba8", GL_RGBA8, },
63 { "rgba8i", GL_RGBA8I, },
64 { "rgba8ui", GL_RGBA8UI, },
65 { "srgb8_alpha8", GL_SRGB8_ALPHA8, },
66 { "rgb10_a2", GL_RGB10_A2, },
67 { "rgb10_a2ui", GL_RGB10_A2UI, },
68 { "rgba4", GL_RGBA4, },
69 { "rgb5_a1", GL_RGB5_A1, },
70 { "rgba8_snorm", GL_RGBA8_SNORM, },
72 { "rgb565", GL_RGB565, },
73 { "r11f_g11f_b10f", GL_R11F_G11F_B10F, },
74 { "rgb32f", GL_RGB32F, },
75 { "rgb32i", GL_RGB32I, },
76 { "rgb32ui", GL_RGB32UI, },
77 { "rgb16f", GL_RGB16F, },
78 { "rgb16i", GL_RGB16I, },
79 { "rgb16ui", GL_RGB16UI, },
80 { "rgb8_snorm", GL_RGB8_SNORM, },
81 { "rgb8i", GL_RGB8I, },
82 { "rgb8ui", GL_RGB8UI, },
83 { "srgb8", GL_SRGB8, },
84 { "rgb9_e5", GL_RGB9_E5, },
85 { "rg32f", GL_RG32F, },
86 { "rg32i", GL_RG32I, },
87 { "rg32ui", GL_RG32UI, },
88 { "rg16f", GL_RG16F, },
89 { "rg16i", GL_RG16I, },
90 { "rg16ui", GL_RG16UI, },
93 { "rg8ui", GL_RG8UI, },
94 { "rg8_snorm", GL_RG8_SNORM, },
97 { "r32ui", GL_R32UI, },
100 { "r16ui", GL_R16UI, },
103 { "r8ui", GL_R8UI, },
104 { "r8_snorm", GL_R8_SNORM, }
107 for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(texFormats); formatNdx++)
109 deUint32 format = texFormats[formatNdx].internalFormat;
110 string nameBase = texFormats[formatNdx].name;
111 deUint32 wrapS = GL_CLAMP_TO_EDGE;
112 deUint32 wrapT = GL_CLAMP_TO_EDGE;
113 deUint32 minFilter = GL_NEAREST;
114 deUint32 magFilter = GL_NEAREST;
116 string descriptionBase = glu::getTextureFormatName(format);
118 addChild(new Texture2DRenderCase(m_context, nameBase.c_str(), descriptionBase.c_str(), format, wrapS, wrapT, minFilter, magFilter, tcu::Mat3(), numTextures, false /* npot */));