Home | History | Annotate | Download | only in functional
      1 /*-------------------------------------------------------------------------
      2  * drawElements Quality Program OpenGL ES 3.1 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 Texture format tests.
     22  *//*--------------------------------------------------------------------*/
     23 
     24 #include "es31fTextureFormatTests.hpp"
     25 #include "gluContextInfo.hpp"
     26 #include "gluPixelTransfer.hpp"
     27 #include "gluStrUtil.hpp"
     28 #include "gluTexture.hpp"
     29 #include "gluTextureUtil.hpp"
     30 #include "glsTextureTestUtil.hpp"
     31 #include "tcuTextureUtil.hpp"
     32 #include "deStringUtil.hpp"
     33 #include "deRandom.hpp"
     34 #include "glwEnums.hpp"
     35 #include "glwFunctions.hpp"
     36 
     37 using std::vector;
     38 using std::string;
     39 using tcu::TestLog;
     40 
     41 namespace deqp
     42 {
     43 namespace gles31
     44 {
     45 namespace Functional
     46 {
     47 
     48 using namespace deqp::gls;
     49 using namespace deqp::gls::TextureTestUtil;
     50 using tcu::Sampler;
     51 
     52 static tcu::CubeFace getCubeFaceFromNdx (int ndx)
     53 {
     54 	switch (ndx)
     55 	{
     56 		case 0:	return tcu::CUBEFACE_POSITIVE_X;
     57 		case 1:	return tcu::CUBEFACE_NEGATIVE_X;
     58 		case 2:	return tcu::CUBEFACE_POSITIVE_Y;
     59 		case 3:	return tcu::CUBEFACE_NEGATIVE_Y;
     60 		case 4:	return tcu::CUBEFACE_POSITIVE_Z;
     61 		case 5:	return tcu::CUBEFACE_NEGATIVE_Z;
     62 		default:
     63 			DE_ASSERT(false);
     64 			return tcu::CUBEFACE_LAST;
     65 	}
     66 }
     67 
     68 // TextureCubeArrayFormatCase
     69 
     70 class TextureCubeArrayFormatCase : public tcu::TestCase
     71 {
     72 public:
     73 										TextureCubeArrayFormatCase	(tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 format, deUint32 dataType, int size, int depth);
     74 										TextureCubeArrayFormatCase	(tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 internalFormat, int size, int depth);
     75 										~TextureCubeArrayFormatCase	(void);
     76 
     77 	void								init						(void);
     78 	void								deinit						(void);
     79 	IterateResult						iterate						(void);
     80 
     81 private:
     82 										TextureCubeArrayFormatCase	(const TextureCubeArrayFormatCase& other);
     83 	TextureCubeArrayFormatCase&			operator=					(const TextureCubeArrayFormatCase& other);
     84 
     85 	bool								checkSupport				(void);
     86 	bool								testLayerFace				(int layerNdx);
     87 
     88 	glu::RenderContext&					m_renderCtx;
     89 	const glu::ContextInfo&				m_renderCtxInfo;
     90 
     91 	const deUint32						m_format;
     92 	const deUint32						m_dataType;
     93 	const int							m_size;
     94 	const int							m_depth;
     95 
     96 	glu::TextureCubeArray*				m_texture;
     97 	TextureTestUtil::TextureRenderer	m_renderer;
     98 
     99 	int									m_curLayerFace;
    100 };
    101 
    102 TextureCubeArrayFormatCase::TextureCubeArrayFormatCase (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 format, deUint32 dataType, int size, int depth)
    103 	: TestCase			(testCtx, name, description)
    104 	, m_renderCtx		(renderCtx)
    105 	, m_renderCtxInfo	(renderCtxInfo)
    106 	, m_format			(format)
    107 	, m_dataType		(dataType)
    108 	, m_size			(size)
    109 	, m_depth			(depth)
    110 	, m_texture			(DE_NULL)
    111 	, m_renderer		(renderCtx, testCtx, glu::GLSL_VERSION_310_ES, glu::PRECISION_HIGHP)
    112 	, m_curLayerFace	(0)
    113 {
    114 }
    115 
    116 TextureCubeArrayFormatCase::TextureCubeArrayFormatCase (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 internalFormat, int size, int depth)
    117 	: TestCase			(testCtx, name, description)
    118 	, m_renderCtx		(renderCtx)
    119 	, m_renderCtxInfo	(renderCtxInfo)
    120 	, m_format			(internalFormat)
    121 	, m_dataType		(GL_NONE)
    122 	, m_size			(size)
    123 	, m_depth			(depth)
    124 	, m_texture			(DE_NULL)
    125 	, m_renderer		(renderCtx, testCtx, glu::GLSL_VERSION_310_ES, glu::PRECISION_HIGHP)
    126 	, m_curLayerFace	(0)
    127 {
    128 }
    129 
    130 TextureCubeArrayFormatCase::~TextureCubeArrayFormatCase (void)
    131 {
    132 	deinit();
    133 }
    134 
    135 void TextureCubeArrayFormatCase::init (void)
    136 {
    137 	if (checkSupport())
    138 	{
    139 		m_texture = m_dataType != GL_NONE
    140 				  ? new glu::TextureCubeArray(m_renderCtx, m_format, m_dataType, m_size, m_depth)	// Implicit internal format.
    141 				  : new glu::TextureCubeArray(m_renderCtx, m_format, m_size, m_depth);				// Explicit internal format.
    142 
    143 		tcu::TextureFormatInfo spec = tcu::getTextureFormatInfo(m_texture->getRefTexture().getFormat());
    144 
    145 		// Fill level 0.
    146 		m_texture->getRefTexture().allocLevel(0);
    147 		tcu::fillWithComponentGradients(m_texture->getRefTexture().getLevel(0), spec.valueMin, spec.valueMax);
    148 
    149 		// Initialize state.
    150 		m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
    151 		m_curLayerFace = 0;
    152 	}
    153 	else
    154 	{
    155 		m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Cube map arrays not supported");
    156 	}
    157 }
    158 
    159 void TextureCubeArrayFormatCase::deinit (void)
    160 {
    161 	delete m_texture;
    162 	m_texture = DE_NULL;
    163 
    164 	m_renderer.clear();
    165 }
    166 
    167 bool TextureCubeArrayFormatCase::checkSupport (void)
    168 {
    169 	return m_renderCtxInfo.isExtensionSupported("GL_EXT_texture_cube_map_array");
    170 }
    171 
    172 bool TextureCubeArrayFormatCase::testLayerFace (int layerFaceNdx)
    173 {
    174 	const glw::Functions&	gl				= m_renderCtx.getFunctions();
    175 	TestLog&				log				= m_testCtx.getLog();
    176 	RandomViewport			viewport		(m_renderCtx.getRenderTarget(), m_size, m_size, deStringHash(getName()));
    177 	tcu::Surface			renderedFrame	(viewport.width, viewport.height);
    178 	tcu::Surface			referenceFrame	(viewport.width, viewport.height);
    179 	tcu::RGBA				threshold		= m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
    180 	vector<float>			texCoord;
    181 	ReferenceParams			renderParams	(TEXTURETYPE_CUBE_ARRAY);
    182 	tcu::TextureFormatInfo	spec			= tcu::getTextureFormatInfo(m_texture->getRefTexture().getFormat());
    183 	const int				layerNdx		= layerFaceNdx / 6;
    184 	const tcu::CubeFace		face			= getCubeFaceFromNdx(layerFaceNdx % 6);
    185 
    186 	renderParams.samplerType				= getSamplerType(m_texture->getRefTexture().getFormat());
    187 	renderParams.sampler					= Sampler(Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::NEAREST, Sampler::NEAREST);
    188 	renderParams.sampler.seamlessCubeMap	= true;
    189 	renderParams.colorScale					= spec.lookupScale;
    190 	renderParams.colorBias					= spec.lookupBias;
    191 
    192 	// Layer here specifies the cube slice
    193 	computeQuadTexCoordCubeArray(texCoord, face, tcu::Vec2(0.0f, 0.0f), tcu::Vec2(1.0f, 1.0f), tcu::Vec2((float)layerNdx));
    194 
    195 	// Setup base viewport.
    196 	gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
    197 	gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
    198 
    199 	// Upload texture data to GL.
    200 	m_texture->upload();
    201 
    202 	// Bind to unit 0.
    203 	gl.activeTexture(GL_TEXTURE0);
    204 	gl.bindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, m_texture->getGLTexture());
    205 
    206 	// Setup nearest neighbor filtering and clamp-to-edge.
    207 	gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    208 	gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    209 	gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    210 	gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    211 
    212 	GLU_EXPECT_NO_ERROR(gl.getError(), "Set texturing state");
    213 
    214 	// Draw.
    215 	m_renderer.renderQuad(0, &texCoord[0], renderParams);
    216 	glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
    217 
    218 	// Compute reference.
    219 	sampleTexture(SurfaceAccess(referenceFrame, m_renderCtx.getRenderTarget().getPixelFormat()), m_texture->getRefTexture(), &texCoord[0], renderParams);
    220 
    221 	// Compare and log.
    222 	return compareImages(log, (string("LayerFace" + de::toString(layerFaceNdx))).c_str(), (string("Layer-face " + de::toString(layerFaceNdx))).c_str(), referenceFrame, renderedFrame, threshold);
    223 }
    224 
    225 TextureCubeArrayFormatCase::IterateResult TextureCubeArrayFormatCase::iterate (void)
    226 {
    227 	if (m_testCtx.getTestResult() == QP_TEST_RESULT_NOT_SUPPORTED)
    228 		return STOP;
    229 
    230 	// Execute test for all layers.
    231 	bool isOk = testLayerFace(m_curLayerFace);
    232 
    233 	if (!isOk && m_testCtx.getTestResult() == QP_TEST_RESULT_PASS)
    234 		m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Image comparison failed");
    235 
    236 	m_curLayerFace += 1;
    237 
    238 	return m_curLayerFace < m_texture->getRefTexture().getDepth() ? CONTINUE : STOP;
    239 }
    240 
    241 // TextureBufferFormatCase
    242 
    243 class TextureBufferFormatCase : public tcu::TestCase
    244 {
    245 public:
    246 								TextureBufferFormatCase		(tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, deUint32 internalFormat, int width);
    247 								~TextureBufferFormatCase	(void);
    248 
    249 	void						init						(void);
    250 	void						deinit						(void);
    251 	IterateResult				iterate						(void);
    252 
    253 private:
    254 								TextureBufferFormatCase		(const TextureBufferFormatCase& other);
    255 	TextureBufferFormatCase&	operator=					(const TextureBufferFormatCase& other);
    256 
    257 	glu::RenderContext&			m_renderCtx;
    258 
    259 	deUint32					m_format;
    260 	int							m_width;
    261 
    262 	glu::TextureBuffer*			m_texture;
    263 	TextureRenderer				m_renderer;
    264 };
    265 
    266 TextureBufferFormatCase::TextureBufferFormatCase (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* description, deUint32 internalFormat, int width)
    267 	: TestCase		(testCtx, name, description)
    268 	, m_renderCtx	(renderCtx)
    269 	, m_format		(internalFormat)
    270 	, m_width		(width)
    271 	, m_texture		(DE_NULL)
    272 	, m_renderer	(renderCtx, testCtx, glu::GLSL_VERSION_310_ES, glu::PRECISION_HIGHP)
    273 {
    274 }
    275 
    276 TextureBufferFormatCase::~TextureBufferFormatCase (void)
    277 {
    278 	deinit();
    279 }
    280 
    281 void TextureBufferFormatCase::init (void)
    282 {
    283 	TestLog&				log		= m_testCtx.getLog();
    284 	tcu::TextureFormat		fmt		= glu::mapGLInternalFormat(m_format);
    285 	tcu::TextureFormatInfo	spec	= tcu::getTextureFormatInfo(fmt);
    286 	tcu::Vec4				colorA	(spec.valueMin.x(), spec.valueMax.y(), spec.valueMin.z(), spec.valueMax.w());
    287 	tcu::Vec4				colorB	(spec.valueMax.x(), spec.valueMin.y(), spec.valueMax.z(), spec.valueMin.w());
    288 	std::ostringstream		fmtName;
    289 
    290 	fmtName << glu::getPixelFormatStr(m_format);
    291 
    292 	log << TestLog::Message << "Buffer texture, " << fmtName.str() << ", " << m_width
    293 							<< ",\n  fill with " << formatGradient(&colorA, &colorB) << " gradient"
    294 		<< TestLog::EndMessage;
    295 
    296 	m_texture = new glu::TextureBuffer(m_renderCtx, m_format, m_width * fmt.getPixelSize());
    297 
    298 	// Fill level 0.
    299 	tcu::fillWithComponentGradients(m_texture->getRefTexture(), colorA, colorB);
    300 }
    301 
    302 void TextureBufferFormatCase::deinit (void)
    303 {
    304 	delete m_texture;
    305 	m_texture = DE_NULL;
    306 
    307 	m_renderer.clear();
    308 }
    309 
    310 TextureBufferFormatCase::IterateResult TextureBufferFormatCase::iterate (void)
    311 {
    312 	TestLog&				log					= m_testCtx.getLog();
    313 	const glw::Functions&	gl					= m_renderCtx.getFunctions();
    314 	RandomViewport			viewport			(m_renderCtx.getRenderTarget(), m_width, 1, deStringHash(getName()));
    315 	tcu::Surface			renderedFrame		(viewport.width, viewport.height);
    316 	tcu::Surface			referenceFrame		(viewport.width, viewport.height);
    317 	tcu::RGBA				threshold			= m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
    318 	vector<float>			texCoord;
    319 	RenderParams			renderParams		(TEXTURETYPE_BUFFER);
    320 	tcu::TextureFormatInfo	spec				= tcu::getTextureFormatInfo(m_texture->getRefTexture().getFormat());
    321 
    322 	renderParams.flags			|= RenderParams::LOG_ALL;
    323 	renderParams.samplerType	= getFetchSamplerType(m_texture->getRefTexture().getFormat());
    324 	renderParams.colorScale		= spec.lookupScale;
    325 	renderParams.colorBias		= spec.lookupBias;
    326 
    327 	computeQuadTexCoord1D(texCoord, 0.0f, (float)(m_texture->getRefTexture().getWidth()));
    328 
    329 	gl.clearColor(0.125f, 0.25f, 0.5f, 1.0f);
    330 	gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
    331 
    332 	// Setup base viewport.
    333 	gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
    334 	gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
    335 
    336 	// Upload texture data to GL.
    337 	m_texture->upload();
    338 
    339 	// Bind to unit 0.
    340 	gl.activeTexture(GL_TEXTURE0);
    341 	gl.bindTexture(GL_TEXTURE_BUFFER, m_texture->getGLTexture());
    342 
    343 	GLU_EXPECT_NO_ERROR(gl.getError(), "Set texturing state");
    344 
    345 	// Draw.
    346 	m_renderer.renderQuad(0, &texCoord[0], renderParams);
    347 	glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
    348 
    349 	GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels()");
    350 
    351 	// Compute reference.
    352 	fetchTexture(SurfaceAccess(referenceFrame, m_renderCtx.getRenderTarget().getPixelFormat()), m_texture->getRefTexture(), &texCoord[0], spec.lookupScale, spec.lookupBias);
    353 
    354 	// Compare and log.
    355 	bool isOk = compareImages(log, referenceFrame, renderedFrame, threshold);
    356 
    357 	m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS	: QP_TEST_RESULT_FAIL,
    358 							isOk ? "Pass"				: "Image comparison failed");
    359 
    360 	return STOP;
    361 }
    362 
    363 // TextureFormatTests
    364 
    365 TextureFormatTests::TextureFormatTests (Context& context)
    366 	: TestCaseGroup(context, "format", "Texture Format Tests")
    367 {
    368 }
    369 
    370 TextureFormatTests::~TextureFormatTests (void)
    371 {
    372 }
    373 
    374 vector<string> toStringVector (const char* const* str, int numStr)
    375 {
    376 	vector<string> v;
    377 	v.resize(numStr);
    378 	for (int i = 0; i < numStr; i++)
    379 		v[i] = str[i];
    380 	return v;
    381 }
    382 
    383 void TextureFormatTests::init (void)
    384 {
    385 	tcu::TestCaseGroup* unsizedGroup	= DE_NULL;
    386 	tcu::TestCaseGroup*	sizedGroup		= DE_NULL;
    387 	tcu::TestCaseGroup*	sizedBufferGroup = DE_NULL;
    388 	addChild((unsizedGroup		= new tcu::TestCaseGroup(m_testCtx,	"unsized",	"Unsized formats")));
    389 	addChild((sizedGroup		= new tcu::TestCaseGroup(m_testCtx,	"sized",	"Sized formats")));
    390 	addChild((sizedBufferGroup	= new tcu::TestCaseGroup(m_testCtx,	"buffer",	"Sized formats (Buffer)")));
    391 
    392 	tcu::TestCaseGroup*	sizedCubeArrayGroup	= DE_NULL;
    393 	sizedGroup->addChild((sizedCubeArrayGroup = new tcu::TestCaseGroup(m_testCtx, "cube_array", "Sized formats (2D Array)")));
    394 
    395 	struct
    396 	{
    397 		const char*	name;
    398 		deUint32	format;
    399 		deUint32	dataType;
    400 	} texFormats[] =
    401 	{
    402 		{ "alpha",							GL_ALPHA,			GL_UNSIGNED_BYTE },
    403 		{ "luminance",						GL_LUMINANCE,		GL_UNSIGNED_BYTE },
    404 		{ "luminance_alpha",				GL_LUMINANCE_ALPHA,	GL_UNSIGNED_BYTE },
    405 		{ "rgb_unsigned_short_5_6_5",		GL_RGB,				GL_UNSIGNED_SHORT_5_6_5 },
    406 		{ "rgb_unsigned_byte",				GL_RGB,				GL_UNSIGNED_BYTE },
    407 		{ "rgba_unsigned_short_4_4_4_4",	GL_RGBA,			GL_UNSIGNED_SHORT_4_4_4_4 },
    408 		{ "rgba_unsigned_short_5_5_5_1",	GL_RGBA,			GL_UNSIGNED_SHORT_5_5_5_1 },
    409 		{ "rgba_unsigned_byte",				GL_RGBA,			GL_UNSIGNED_BYTE }
    410 	};
    411 
    412 	for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(texFormats); formatNdx++)
    413 	{
    414 		deUint32	format		= texFormats[formatNdx].format;
    415 		deUint32	dataType	= texFormats[formatNdx].dataType;
    416 		string	nameBase		= texFormats[formatNdx].name;
    417 		string	descriptionBase	= string(glu::getPixelFormatName(format)) + ", " + glu::getTypeName(dataType);
    418 
    419 		unsizedGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_cube_array_pot").c_str(),		(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), format, dataType, 64, 12));
    420 		unsizedGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_cube_array_npot").c_str(),	(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), format, dataType, 64, 12));
    421 	}
    422 
    423 	struct
    424 	{
    425 		const char*	name;
    426 		deUint32	internalFormat;
    427 	} sizedColorFormats[] =
    428 	{
    429 		{ "rgba32f",			GL_RGBA32F,			},
    430 		{ "rgba32i",			GL_RGBA32I,			},
    431 		{ "rgba32ui",			GL_RGBA32UI,		},
    432 		{ "rgba16f",			GL_RGBA16F,			},
    433 		{ "rgba16i",			GL_RGBA16I,			},
    434 		{ "rgba16ui",			GL_RGBA16UI,		},
    435 		{ "rgba8",				GL_RGBA8,			},
    436 		{ "rgba8i",				GL_RGBA8I,			},
    437 		{ "rgba8ui",			GL_RGBA8UI,			},
    438 		{ "srgb8_alpha8",		GL_SRGB8_ALPHA8,	},
    439 		{ "rgb10_a2",			GL_RGB10_A2,		},
    440 		{ "rgb10_a2ui",			GL_RGB10_A2UI,		},
    441 		{ "rgba4",				GL_RGBA4,			},
    442 		{ "rgb5_a1",			GL_RGB5_A1,			},
    443 		{ "rgba8_snorm",		GL_RGBA8_SNORM,		},
    444 		{ "rgb8",				GL_RGB8,			},
    445 		{ "rgb565",				GL_RGB565,			},
    446 		{ "r11f_g11f_b10f",		GL_R11F_G11F_B10F,	},
    447 		{ "rgb32f",				GL_RGB32F,			},
    448 		{ "rgb32i",				GL_RGB32I,			},
    449 		{ "rgb32ui",			GL_RGB32UI,			},
    450 		{ "rgb16f",				GL_RGB16F,			},
    451 		{ "rgb16i",				GL_RGB16I,			},
    452 		{ "rgb16ui",			GL_RGB16UI,			},
    453 		{ "rgb8_snorm",			GL_RGB8_SNORM,		},
    454 		{ "rgb8i",				GL_RGB8I,			},
    455 		{ "rgb8ui",				GL_RGB8UI,			},
    456 		{ "srgb8",				GL_SRGB8,			},
    457 		{ "rgb9_e5",			GL_RGB9_E5,			},
    458 		{ "rg32f",				GL_RG32F,			},
    459 		{ "rg32i",				GL_RG32I,			},
    460 		{ "rg32ui",				GL_RG32UI,			},
    461 		{ "rg16f",				GL_RG16F,			},
    462 		{ "rg16i",				GL_RG16I,			},
    463 		{ "rg16ui",				GL_RG16UI,			},
    464 		{ "rg8",				GL_RG8,				},
    465 		{ "rg8i",				GL_RG8I,			},
    466 		{ "rg8ui",				GL_RG8UI,			},
    467 		{ "rg8_snorm",			GL_RG8_SNORM,		},
    468 		{ "r32f",				GL_R32F,			},
    469 		{ "r32i",				GL_R32I,			},
    470 		{ "r32ui",				GL_R32UI,			},
    471 		{ "r16f",				GL_R16F,			},
    472 		{ "r16i",				GL_R16I,			},
    473 		{ "r16ui",				GL_R16UI,			},
    474 		{ "r8",					GL_R8,				},
    475 		{ "r8i",				GL_R8I,				},
    476 		{ "r8ui",				GL_R8UI,			},
    477 		{ "r8_snorm",			GL_R8_SNORM,		}
    478 	};
    479 
    480 	struct
    481 	{
    482 		const char*	name;
    483 		deUint32	internalFormat;
    484 	} sizedDepthStencilFormats[] =
    485 	{
    486 		// Depth and stencil formats
    487 		{ "depth_component32f",	GL_DEPTH_COMPONENT32F	},
    488 		{ "depth_component24",	GL_DEPTH_COMPONENT24	},
    489 		{ "depth_component16",	GL_DEPTH_COMPONENT16	},
    490 		{ "depth32f_stencil8",	GL_DEPTH32F_STENCIL8	},
    491 		{ "depth24_stencil8",	GL_DEPTH24_STENCIL8		}
    492 	};
    493 
    494 	for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(sizedColorFormats); formatNdx++)
    495 	{
    496 		deUint32	internalFormat	= sizedColorFormats[formatNdx].internalFormat;
    497 		string		nameBase		= sizedColorFormats[formatNdx].name;
    498 		string		descriptionBase	= glu::getPixelFormatName(internalFormat);
    499 
    500 		sizedCubeArrayGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_pot").c_str(),		(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), internalFormat, 64, 12));
    501 		sizedCubeArrayGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_npot").c_str(),	(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), internalFormat, 64, 12));
    502 	}
    503 
    504 	for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(sizedDepthStencilFormats); formatNdx++)
    505 	{
    506 		deUint32	internalFormat	= sizedDepthStencilFormats[formatNdx].internalFormat;
    507 		string		nameBase		= sizedDepthStencilFormats[formatNdx].name;
    508 		string		descriptionBase	= glu::getPixelFormatName(internalFormat);
    509 
    510 		sizedCubeArrayGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_pot").c_str(),		(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), internalFormat, 64, 12));
    511 		sizedCubeArrayGroup->addChild(new TextureCubeArrayFormatCase (m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(), (nameBase + "_npot").c_str(),	(descriptionBase + ", GL_TEXTURE_CUBE_MAP_ARRAY").c_str(), internalFormat, 64, 12));
    512 	}
    513 
    514 	// \todo Check
    515 	struct
    516 	{
    517 		const char*	name;
    518 		deUint32	internalFormat;
    519 	} bufferColorFormats[] =
    520 	{
    521 		{ "r8",					GL_R8,				},
    522 		{ "r16f",				GL_R16F,			},
    523 		{ "r32f",				GL_R32F,			},
    524 		{ "r8i",				GL_R8I,				},
    525 		{ "r16i",				GL_R16I,			},
    526 		{ "r32i",				GL_R32I,			},
    527 		{ "r8ui",				GL_R8UI,			},
    528 		{ "r16ui",				GL_R16UI,			},
    529 		{ "r32ui",				GL_R32UI,			},
    530 		{ "rg8",				GL_RG8,				},
    531 		{ "rg16f",				GL_RG16F,			},
    532 		{ "rg32f",				GL_RG32F,			},
    533 		{ "rg8i",				GL_RG8I,			},
    534 		{ "rg16i",				GL_RG16I,			},
    535 		{ "rg32i",				GL_RG32I,			},
    536 		{ "rg8ui",				GL_RG8UI,			},
    537 		{ "rg16ui",				GL_RG16UI,			},
    538 		{ "rg32ui",				GL_RG32UI,			},
    539 		{ "rgba8",				GL_RGBA8,			},
    540 		{ "rgba16f",			GL_RGBA16F,			},
    541 		{ "rgba32f",			GL_RGBA32F,			},
    542 		{ "rgba8i",				GL_RGBA8I,			},
    543 		{ "rgba16i",			GL_RGBA16I,			},
    544 		{ "rgba32i",			GL_RGBA32I,			},
    545 		{ "rgba8ui",			GL_RGBA8UI,			},
    546 		{ "rgba16ui",			GL_RGBA16UI,		},
    547 		{ "rgba32ui",			GL_RGBA32UI,		}
    548 	};
    549 
    550 	for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(bufferColorFormats); formatNdx++)
    551 	{
    552 		deUint32	internalFormat	= bufferColorFormats[formatNdx].internalFormat;
    553 		string		nameBase		= bufferColorFormats[formatNdx].name;
    554 		string		descriptionBase	= glu::getPixelFormatName(internalFormat);
    555 
    556 		sizedBufferGroup->addChild	(new TextureBufferFormatCase	(m_testCtx, m_context.getRenderContext(),	(nameBase + "_pot").c_str(),	(descriptionBase + ", GL_TEXTURE_BUFFER").c_str(),	internalFormat, 64));
    557 		sizedBufferGroup->addChild	(new TextureBufferFormatCase	(m_testCtx, m_context.getRenderContext(),	(nameBase + "_npot").c_str(),	(descriptionBase + ", GL_TEXTURE_BUFFER").c_str(),	internalFormat, 112));
    558 	}
    559 }
    560 
    561 } // Functional
    562 } // gles31
    563 } // deqp
    564