1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 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 tests.
22 *//*--------------------------------------------------------------------*/
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"
48 using namespace deqp::gls;
49 using namespace deqp::gls::TextureTestUtil;
50 using namespace glu::TextureTestUtil;
54 struct SupportedExtensions
60 static tcu::CubeFace getCubeFaceFromNdx (int ndx)
64 case 0: return tcu::CUBEFACE_POSITIVE_X;
65 case 1: return tcu::CUBEFACE_NEGATIVE_X;
66 case 2: return tcu::CUBEFACE_POSITIVE_Y;
67 case 3: return tcu::CUBEFACE_NEGATIVE_Y;
68 case 4: return tcu::CUBEFACE_POSITIVE_Z;
69 case 5: return tcu::CUBEFACE_NEGATIVE_Z;
72 return tcu::CUBEFACE_LAST;
79 SupportedExtensions checkSupport (const glu::ContextInfo& renderCtxInfoid)
81 SupportedExtensions supportedExtensions;
83 supportedExtensions.cubeMapArray = renderCtxInfoid.isExtensionSupported("GL_EXT_texture_cube_map_array");
84 supportedExtensions.sRGBR8 = renderCtxInfoid.isExtensionSupported("GL_EXT_texture_sRGB_R8");
86 return supportedExtensions;
91 // TextureCubeArrayFormatCase
93 class TextureCubeArrayFormatCase : public tcu::TestCase
96 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);
97 TextureCubeArrayFormatCase (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 internalFormat, int size, int depth);
98 ~TextureCubeArrayFormatCase (void);
102 IterateResult iterate (void);
105 TextureCubeArrayFormatCase (const TextureCubeArrayFormatCase& other);
106 TextureCubeArrayFormatCase& operator= (const TextureCubeArrayFormatCase& other);
108 bool testLayerFace (int layerNdx);
110 glu::RenderContext& m_renderCtx;
111 const glu::ContextInfo& m_renderCtxInfo;
113 const deUint32 m_format;
114 const deUint32 m_dataType;
118 glu::TextureCubeArray* m_texture;
119 TextureTestUtil::TextureRenderer m_renderer;
124 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)
125 : TestCase (testCtx, name, description)
126 , m_renderCtx (renderCtx)
127 , m_renderCtxInfo (renderCtxInfo)
129 , m_dataType (dataType)
132 , m_texture (DE_NULL)
133 , m_renderer (renderCtx, testCtx.getLog(), glu::getContextTypeGLSLVersion(renderCtx.getType()), glu::PRECISION_HIGHP)
138 TextureCubeArrayFormatCase::TextureCubeArrayFormatCase (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& renderCtxInfo, const char* name, const char* description, deUint32 internalFormat, int size, int depth)
139 : TestCase (testCtx, name, description)
140 , m_renderCtx (renderCtx)
141 , m_renderCtxInfo (renderCtxInfo)
142 , m_format (internalFormat)
143 , m_dataType (GL_NONE)
146 , m_texture (DE_NULL)
147 , m_renderer (renderCtx, testCtx.getLog(), glu::getContextTypeGLSLVersion(renderCtx.getType()), glu::PRECISION_HIGHP)
152 TextureCubeArrayFormatCase::~TextureCubeArrayFormatCase (void)
157 void TextureCubeArrayFormatCase::init (void)
159 const SupportedExtensions supportedExtensions = checkSupport(m_renderCtxInfo);
161 if ((supportedExtensions.cubeMapArray && m_format != GL_SR8_EXT) ||
162 (supportedExtensions.cubeMapArray && m_format == GL_SR8_EXT && supportedExtensions.sRGBR8))
164 m_texture = m_dataType != GL_NONE
165 ? new glu::TextureCubeArray(m_renderCtx, m_format, m_dataType, m_size, m_depth) // Implicit internal format.
166 : new glu::TextureCubeArray(m_renderCtx, m_format, m_size, m_depth); // Explicit internal format.
168 tcu::TextureFormatInfo spec = tcu::getTextureFormatInfo(m_texture->getRefTexture().getFormat());
171 m_texture->getRefTexture().allocLevel(0);
172 tcu::fillWithComponentGradients(m_texture->getRefTexture().getLevel(0), spec.valueMin, spec.valueMax);
175 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
180 if (supportedExtensions.cubeMapArray == false)
181 m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Cube map arrays not supported");
183 if (supportedExtensions.sRGBR8 == false)
184 m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "texture srgb r8 not supported");
188 void TextureCubeArrayFormatCase::deinit (void)
196 bool TextureCubeArrayFormatCase::testLayerFace (int layerFaceNdx)
198 const glw::Functions& gl = m_renderCtx.getFunctions();
199 TestLog& log = m_testCtx.getLog();
200 RandomViewport viewport (m_renderCtx.getRenderTarget(), m_size, m_size, deStringHash(getName()));
201 tcu::Surface renderedFrame (viewport.width, viewport.height);
202 tcu::Surface referenceFrame (viewport.width, viewport.height);
203 tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
204 vector<float> texCoord;
205 ReferenceParams renderParams (TEXTURETYPE_CUBE_ARRAY);
206 tcu::TextureFormatInfo spec = tcu::getTextureFormatInfo(m_texture->getRefTexture().getFormat());
207 const int layerNdx = layerFaceNdx / 6;
208 const tcu::CubeFace face = getCubeFaceFromNdx(layerFaceNdx % 6);
210 renderParams.samplerType = getSamplerType(m_texture->getRefTexture().getFormat());
211 renderParams.sampler = Sampler(Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, Sampler::NEAREST, Sampler::NEAREST);
212 renderParams.sampler.seamlessCubeMap = true;
213 renderParams.colorScale = spec.lookupScale;
214 renderParams.colorBias = spec.lookupBias;
216 // Layer here specifies the cube slice
217 computeQuadTexCoordCubeArray(texCoord, face, tcu::Vec2(0.0f, 0.0f), tcu::Vec2(1.0f, 1.0f), tcu::Vec2((float)layerNdx));
219 // Setup base viewport.
220 gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
221 gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
223 // Upload texture data to GL.
227 gl.activeTexture(GL_TEXTURE0);
228 gl.bindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, m_texture->getGLTexture());
230 // Setup nearest neighbor filtering and clamp-to-edge.
231 gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
232 gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
233 gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
234 gl.texParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
236 GLU_EXPECT_NO_ERROR(gl.getError(), "Set texturing state");
239 m_renderer.renderQuad(0, &texCoord[0], renderParams);
240 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
242 // Compute reference.
243 sampleTexture(tcu::SurfaceAccess(referenceFrame, m_renderCtx.getRenderTarget().getPixelFormat()), m_texture->getRefTexture(), &texCoord[0], renderParams);
246 return compareImages(log, (string("LayerFace" + de::toString(layerFaceNdx))).c_str(), (string("Layer-face " + de::toString(layerFaceNdx))).c_str(), referenceFrame, renderedFrame, threshold);
249 TextureCubeArrayFormatCase::IterateResult TextureCubeArrayFormatCase::iterate (void)
251 if (m_testCtx.getTestResult() == QP_TEST_RESULT_NOT_SUPPORTED)
254 // Execute test for all layers.
255 bool isOk = testLayerFace(m_curLayerFace);
257 if (!isOk && m_testCtx.getTestResult() == QP_TEST_RESULT_PASS)
258 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Image comparison failed");
262 return m_curLayerFace < m_texture->getRefTexture().getDepth() ? CONTINUE : STOP;
265 // TextureBufferFormatCase
267 class TextureBufferFormatCase : public TestCase
270 TextureBufferFormatCase (Context& ctx, glu::RenderContext& renderCtx, const char* name, const char* description, deUint32 internalFormat, int width);
271 ~TextureBufferFormatCase (void);
275 IterateResult iterate (void);
278 TextureBufferFormatCase (const TextureBufferFormatCase& other);
279 TextureBufferFormatCase& operator= (const TextureBufferFormatCase& other);
281 glu::RenderContext& m_renderCtx;
285 int m_maxTextureBufferSize;
287 glu::TextureBuffer* m_texture;
288 TextureRenderer m_renderer;
291 TextureBufferFormatCase::TextureBufferFormatCase (Context& ctx, glu::RenderContext& renderCtx, const char* name, const char* description, deUint32 internalFormat, int width)
292 : TestCase (ctx, name, description)
293 , m_renderCtx (renderCtx)
294 , m_format (internalFormat)
296 , m_maxTextureBufferSize (0)
297 , m_texture (DE_NULL)
298 , m_renderer (renderCtx, ctx.getTestContext().getLog(), glu::getContextTypeGLSLVersion(renderCtx.getType()), glu::PRECISION_HIGHP)
302 TextureBufferFormatCase::~TextureBufferFormatCase (void)
307 void TextureBufferFormatCase::init (void)
309 TestLog& log = m_testCtx.getLog();
310 tcu::TextureFormat fmt = glu::mapGLInternalFormat(m_format);
311 tcu::TextureFormatInfo spec = tcu::getTextureFormatInfo(fmt);
312 tcu::Vec4 colorA (spec.valueMin.x(), spec.valueMax.y(), spec.valueMin.z(), spec.valueMax.w());
313 tcu::Vec4 colorB (spec.valueMax.x(), spec.valueMin.y(), spec.valueMax.z(), spec.valueMin.w());
314 const bool supportsES32 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2));
317 && !m_context.getContextInfo().isExtensionSupported("GL_OES_texture_buffer")
318 && !m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer"))
320 TCU_THROW(NotSupportedError, "Texture buffers not supported");
323 m_maxTextureBufferSize = m_context.getContextInfo().getInt(GL_MAX_TEXTURE_BUFFER_SIZE);
325 if (m_maxTextureBufferSize <= 0)
326 TCU_THROW(NotSupportedError, "GL_MAX_TEXTURE_BUFFER_SIZE > 0 required");
328 log << TestLog::Message << "Buffer texture, " << glu::getTextureFormatStr(m_format) << ", " << m_width
329 << ",\n fill with " << formatGradient(&colorA, &colorB) << " gradient"
330 << TestLog::EndMessage;
332 m_texture = new glu::TextureBuffer(m_renderCtx, m_format, m_width * fmt.getPixelSize());
335 tcu::fillWithComponentGradients(m_texture->getFullRefTexture(), colorA, colorB);
338 void TextureBufferFormatCase::deinit (void)
346 TextureBufferFormatCase::IterateResult TextureBufferFormatCase::iterate (void)
348 TestLog& log = m_testCtx.getLog();
349 const glw::Functions& gl = m_renderCtx.getFunctions();
350 RandomViewport viewport (m_renderCtx.getRenderTarget(), m_width, 1, deStringHash(getName()));
351 tcu::Surface renderedFrame (viewport.width, viewport.height);
352 tcu::Surface referenceFrame (viewport.width, viewport.height);
353 tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
354 vector<float> texCoord;
355 RenderParams renderParams (TEXTURETYPE_BUFFER);
356 const tcu::ConstPixelBufferAccess effectiveRefTexture = glu::getTextureBufferEffectiveRefTexture(*m_texture, m_maxTextureBufferSize);
357 tcu::TextureFormatInfo spec = tcu::getTextureFormatInfo(effectiveRefTexture.getFormat());
359 renderParams.flags |= RenderParams::LOG_ALL;
360 renderParams.samplerType = getFetchSamplerType(effectiveRefTexture.getFormat());
361 renderParams.colorScale = spec.lookupScale;
362 renderParams.colorBias = spec.lookupBias;
364 computeQuadTexCoord1D(texCoord, 0.0f, (float)(effectiveRefTexture.getWidth()));
366 gl.clearColor(0.125f, 0.25f, 0.5f, 1.0f);
367 gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
369 // Setup base viewport.
370 gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
371 gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
373 // Upload texture data to GL.
377 gl.activeTexture(GL_TEXTURE0);
378 gl.bindTexture(GL_TEXTURE_BUFFER, m_texture->getGLTexture());
380 GLU_EXPECT_NO_ERROR(gl.getError(), "Set texturing state");
383 m_renderer.renderQuad(0, &texCoord[0], renderParams);
384 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
386 GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels()");
388 // Compute reference.
389 fetchTexture(tcu::SurfaceAccess(referenceFrame, m_renderCtx.getRenderTarget().getPixelFormat()), effectiveRefTexture, &texCoord[0], spec.lookupScale, spec.lookupBias);
392 bool isOk = compareImages(log, referenceFrame, renderedFrame, threshold);
394 m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
395 isOk ? "Pass" : "Image comparison failed");
400 // TextureFormatTests
402 TextureFormatTests::TextureFormatTests (Context& context)
403 : TestCaseGroup(context, "format", "Texture Format Tests")
407 TextureFormatTests::~TextureFormatTests (void)
411 vector<string> toStringVector (const char* const* str, int numStr)
415 for (int i = 0; i < numStr; i++)
420 void TextureFormatTests::init (void)
422 tcu::TestCaseGroup* unsizedGroup = DE_NULL;
423 tcu::TestCaseGroup* sizedGroup = DE_NULL;
424 tcu::TestCaseGroup* sizedBufferGroup = DE_NULL;
425 addChild((unsizedGroup = new tcu::TestCaseGroup(m_testCtx, "unsized", "Unsized formats")));
426 addChild((sizedGroup = new tcu::TestCaseGroup(m_testCtx, "sized", "Sized formats")));
427 addChild((sizedBufferGroup = new tcu::TestCaseGroup(m_testCtx, "buffer", "Sized formats (Buffer)")));
429 tcu::TestCaseGroup* sizedCubeArrayGroup = DE_NULL;
430 sizedGroup->addChild((sizedCubeArrayGroup = new tcu::TestCaseGroup(m_testCtx, "cube_array", "Sized formats (2D Array)")));
439 { "alpha", GL_ALPHA, GL_UNSIGNED_BYTE },
440 { "luminance", GL_LUMINANCE, GL_UNSIGNED_BYTE },
441 { "luminance_alpha", GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE },
442 { "rgb_unsigned_short_5_6_5", GL_RGB, GL_UNSIGNED_SHORT_5_6_5 },
443 { "rgb_unsigned_byte", GL_RGB, GL_UNSIGNED_BYTE },
444 { "rgba_unsigned_short_4_4_4_4", GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4 },
445 { "rgba_unsigned_short_5_5_5_1", GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1 },
446 { "rgba_unsigned_byte", GL_RGBA, GL_UNSIGNED_BYTE }
449 for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(texFormats); formatNdx++)
451 deUint32 format = texFormats[formatNdx].format;
452 deUint32 dataType = texFormats[formatNdx].dataType;
453 string nameBase = texFormats[formatNdx].name;
454 string descriptionBase = string(glu::getTextureFormatName(format)) + ", " + glu::getTypeName(dataType);
456 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));
457 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));
463 deUint32 internalFormat;
464 } sizedColorFormats[] =
466 { "rgba32f", GL_RGBA32F, },
467 { "rgba32i", GL_RGBA32I, },
468 { "rgba32ui", GL_RGBA32UI, },
469 { "rgba16f", GL_RGBA16F, },
470 { "rgba16i", GL_RGBA16I, },
471 { "rgba16ui", GL_RGBA16UI, },
472 { "rgba8", GL_RGBA8, },
473 { "rgba8i", GL_RGBA8I, },
474 { "rgba8ui", GL_RGBA8UI, },
475 { "srgb_r8", GL_SR8_EXT, },
476 { "srgb8_alpha8", GL_SRGB8_ALPHA8, },
477 { "rgb10_a2", GL_RGB10_A2, },
478 { "rgb10_a2ui", GL_RGB10_A2UI, },
479 { "rgba4", GL_RGBA4, },
480 { "rgb5_a1", GL_RGB5_A1, },
481 { "rgba8_snorm", GL_RGBA8_SNORM, },
482 { "rgb8", GL_RGB8, },
483 { "rgb565", GL_RGB565, },
484 { "r11f_g11f_b10f", GL_R11F_G11F_B10F, },
485 { "rgb32f", GL_RGB32F, },
486 { "rgb32i", GL_RGB32I, },
487 { "rgb32ui", GL_RGB32UI, },
488 { "rgb16f", GL_RGB16F, },
489 { "rgb16i", GL_RGB16I, },
490 { "rgb16ui", GL_RGB16UI, },
491 { "rgb8_snorm", GL_RGB8_SNORM, },
492 { "rgb8i", GL_RGB8I, },
493 { "rgb8ui", GL_RGB8UI, },
494 { "srgb8", GL_SRGB8, },
495 { "rgb9_e5", GL_RGB9_E5, },
496 { "rg32f", GL_RG32F, },
497 { "rg32i", GL_RG32I, },
498 { "rg32ui", GL_RG32UI, },
499 { "rg16f", GL_RG16F, },
500 { "rg16i", GL_RG16I, },
501 { "rg16ui", GL_RG16UI, },
503 { "rg8i", GL_RG8I, },
504 { "rg8ui", GL_RG8UI, },
505 { "rg8_snorm", GL_RG8_SNORM, },
506 { "r32f", GL_R32F, },
507 { "r32i", GL_R32I, },
508 { "r32ui", GL_R32UI, },
509 { "r16f", GL_R16F, },
510 { "r16i", GL_R16I, },
511 { "r16ui", GL_R16UI, },
514 { "r8ui", GL_R8UI, },
515 { "r8_snorm", GL_R8_SNORM, }
521 deUint32 internalFormat;
522 } sizedDepthStencilFormats[] =
524 // Depth and stencil formats
525 { "depth_component32f", GL_DEPTH_COMPONENT32F },
526 { "depth_component24", GL_DEPTH_COMPONENT24 },
527 { "depth_component16", GL_DEPTH_COMPONENT16 },
528 { "depth32f_stencil8", GL_DEPTH32F_STENCIL8 },
529 { "depth24_stencil8", GL_DEPTH24_STENCIL8 }
532 for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(sizedColorFormats); formatNdx++)
534 deUint32 internalFormat = sizedColorFormats[formatNdx].internalFormat;
535 string nameBase = sizedColorFormats[formatNdx].name;
536 string descriptionBase = glu::getTextureFormatName(internalFormat);
538 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));
539 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));
542 for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(sizedDepthStencilFormats); formatNdx++)
544 deUint32 internalFormat = sizedDepthStencilFormats[formatNdx].internalFormat;
545 string nameBase = sizedDepthStencilFormats[formatNdx].name;
546 string descriptionBase = glu::getTextureFormatName(internalFormat);
548 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));
549 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));
556 deUint32 internalFormat;
557 } bufferColorFormats[] =
560 { "r16f", GL_R16F, },
561 { "r32f", GL_R32F, },
563 { "r16i", GL_R16I, },
564 { "r32i", GL_R32I, },
565 { "r8ui", GL_R8UI, },
566 { "r16ui", GL_R16UI, },
567 { "r32ui", GL_R32UI, },
569 { "rg16f", GL_RG16F, },
570 { "rg32f", GL_RG32F, },
571 { "rg8i", GL_RG8I, },
572 { "rg16i", GL_RG16I, },
573 { "rg32i", GL_RG32I, },
574 { "rg8ui", GL_RG8UI, },
575 { "rg16ui", GL_RG16UI, },
576 { "rg32ui", GL_RG32UI, },
577 { "rgba8", GL_RGBA8, },
578 { "rgba16f", GL_RGBA16F, },
579 { "rgba32f", GL_RGBA32F, },
580 { "rgba8i", GL_RGBA8I, },
581 { "rgba16i", GL_RGBA16I, },
582 { "rgba32i", GL_RGBA32I, },
583 { "rgba8ui", GL_RGBA8UI, },
584 { "rgba16ui", GL_RGBA16UI, },
585 { "rgba32ui", GL_RGBA32UI, }
588 for (int formatNdx = 0; formatNdx < DE_LENGTH_OF_ARRAY(bufferColorFormats); formatNdx++)
590 deUint32 internalFormat = bufferColorFormats[formatNdx].internalFormat;
591 string nameBase = bufferColorFormats[formatNdx].name;
592 string descriptionBase = glu::getTextureFormatName(internalFormat);
594 sizedBufferGroup->addChild (new TextureBufferFormatCase (m_context, m_context.getRenderContext(), (nameBase + "_pot").c_str(), (descriptionBase + ", GL_TEXTURE_BUFFER").c_str(), internalFormat, 64));
595 sizedBufferGroup->addChild (new TextureBufferFormatCase (m_context, m_context.getRenderContext(), (nameBase + "_npot").c_str(), (descriptionBase + ", GL_TEXTURE_BUFFER").c_str(), internalFormat, 112));