xref: /aosp_15_r20/external/deqp/modules/gles31/functional/es31fShaderTextureSizeTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
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 Multisample texture size tests
22  *//*--------------------------------------------------------------------*/
23 
24 #include "es31fShaderTextureSizeTests.hpp"
25 #include "gluRenderContext.hpp"
26 #include "gluShaderProgram.hpp"
27 #include "gluPixelTransfer.hpp"
28 #include "gluContextInfo.hpp"
29 #include "glwEnums.hpp"
30 #include "glwFunctions.hpp"
31 #include "tcuTestLog.hpp"
32 #include "tcuStringTemplate.hpp"
33 #include "tcuSurface.hpp"
34 #include "tcuRenderTarget.hpp"
35 #include "deStringUtil.hpp"
36 
37 using namespace glw;
38 
39 namespace deqp
40 {
41 namespace gles31
42 {
43 namespace Functional
44 {
45 namespace
46 {
47 
48 static const char *const s_positionVertexShaderSource = "${GLSL_VERSION_DECL}\n"
49                                                         "in highp vec4 a_position;\n"
50                                                         "void main (void)\n"
51                                                         "{\n"
52                                                         "    gl_Position = a_position;\n"
53                                                         "}\n";
54 
specializeShader(Context & context,const char * code)55 static std::string specializeShader(Context &context, const char *code)
56 {
57     glu::GLSLVersion glslVersion = glu::getContextTypeGLSLVersion(context.getRenderContext().getType());
58     std::map<std::string, std::string> specializationMap;
59 
60     specializationMap["GLSL_VERSION_DECL"] = glu::getGLSLVersionDeclaration(glslVersion);
61 
62     return tcu::StringTemplate(code).specialize(specializationMap);
63 }
64 
65 class TextureSizeCase : public TestCase
66 {
67 public:
68     enum TextureType
69     {
70         TEXTURE_FLOAT_2D = 0,
71         TEXTURE_FLOAT_2D_ARRAY,
72         TEXTURE_INT_2D,
73         TEXTURE_INT_2D_ARRAY,
74         TEXTURE_UINT_2D,
75         TEXTURE_UINT_2D_ARRAY,
76 
77         TEXTURE_LAST
78     };
79 
80     TextureSizeCase(Context &context, const char *name, const char *desc, TextureType type, int samples);
81     ~TextureSizeCase(void);
82 
83 private:
84     void init(void);
85     void deinit(void);
86     IterateResult iterate(void);
87 
88     std::string genFragmentSource(void);
89     glw::GLenum getTextureGLTarget(void);
90     glw::GLenum getTextureGLInternalFormat(void);
91 
92     void createTexture(const tcu::IVec3 &size);
93     void deleteTexture(void);
94     void runShader(tcu::Surface &dst, const tcu::IVec3 &size);
95     bool verifyImage(const tcu::Surface &dst);
96 
97     const TextureType m_type;
98     const int m_numSamples;
99     const bool m_isArrayType;
100 
101     glw::GLuint m_texture;
102     glw::GLuint m_vbo;
103     glw::GLuint m_vao;
104     glu::ShaderProgram *m_shader;
105     std::vector<tcu::IVec3> m_iterations;
106     int m_iteration;
107 
108     bool m_allIterationsPassed;
109     bool m_allCasesSkipped;
110 };
111 
TextureSizeCase(Context & context,const char * name,const char * desc,TextureType type,int samples)112 TextureSizeCase::TextureSizeCase(Context &context, const char *name, const char *desc, TextureType type, int samples)
113     : TestCase(context, name, desc)
114     , m_type(type)
115     , m_numSamples(samples)
116     , m_isArrayType(m_type == TEXTURE_FLOAT_2D_ARRAY || m_type == TEXTURE_INT_2D_ARRAY ||
117                     m_type == TEXTURE_UINT_2D_ARRAY)
118     , m_texture(0)
119     , m_vbo(0)
120     , m_vao(0)
121     , m_shader(DE_NULL)
122     , m_iteration(0)
123     , m_allIterationsPassed(true)
124     , m_allCasesSkipped(true)
125 {
126     DE_ASSERT(type < TEXTURE_LAST);
127 }
128 
~TextureSizeCase(void)129 TextureSizeCase::~TextureSizeCase(void)
130 {
131     deinit();
132 }
133 
init(void)134 void TextureSizeCase::init(void)
135 {
136     static const tcu::IVec2 testSizes2D[] = {
137         tcu::IVec2(1, 1),     tcu::IVec2(1, 4),  tcu::IVec2(4, 8),  tcu::IVec2(21, 11),
138         tcu::IVec2(107, 254), tcu::IVec2(-1, 3), tcu::IVec2(3, -1),
139     };
140     static const tcu::IVec3 testSizes3D[] = {
141         tcu::IVec3(1, 1, 1),     tcu::IVec3(1, 4, 7),  tcu::IVec3(4, 8, 12), tcu::IVec3(21, 11, 9),
142         tcu::IVec3(107, 254, 2), tcu::IVec3(-1, 3, 3), tcu::IVec3(3, -1, 3), tcu::IVec3(4, 4, -1),
143     };
144     static const tcu::Vec4 fullscreenQuad[] = {tcu::Vec4(-1.0f, 1.0f, 0.0f, 1.0f), tcu::Vec4(-1.0f, -1.0f, 0.0f, 1.0f),
145                                                tcu::Vec4(1.0f, 1.0f, 0.0f, 1.0f), tcu::Vec4(1.0f, -1.0f, 0.0f, 1.0f)};
146 
147     glu::RenderContext &rc        = m_context.getRenderContext();
148     const glw::Functions &gl      = rc.getFunctions();
149     const bool supportsES32orGL45 = glu::contextSupports(rc.getType(), glu::ApiType::es(3, 2)) ||
150                                     glu::contextSupports(rc.getType(), glu::ApiType::core(4, 5));
151 
152     // requirements
153     if (m_isArrayType && !supportsES32orGL45 &&
154         !m_context.getContextInfo().isExtensionSupported("GL_OES_texture_storage_multisample_2d_array"))
155         TCU_THROW(NotSupportedError, "Test requires OES_texture_storage_multisample_2d_array extension");
156 
157     if (m_context.getRenderTarget().getWidth() < 1 || m_context.getRenderTarget().getHeight() < 1)
158         TCU_THROW(NotSupportedError, "rendertarget size must be at least 1x1");
159 
160     glw::GLint maxTextureSize   = 0;
161     glw::GLint maxTextureLayers = 0;
162     glw::GLint maxSamples       = 0;
163 
164     gl.getIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
165     gl.getIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &maxTextureLayers);
166     gl.getInternalformativ(getTextureGLTarget(), getTextureGLInternalFormat(), GL_SAMPLES, 1, &maxSamples);
167 
168     if (m_numSamples > maxSamples)
169         TCU_THROW(NotSupportedError, "sample count is not supported");
170 
171     // gen shade
172 
173     m_shader = new glu::ShaderProgram(
174         m_context.getRenderContext(),
175         glu::ProgramSources() << glu::VertexSource(specializeShader(m_context, s_positionVertexShaderSource))
176                               << glu::FragmentSource(genFragmentSource()));
177     m_testCtx.getLog() << *m_shader;
178     if (!m_shader->isOk())
179         throw tcu::TestError("shader build failed");
180 
181     // gen buffer
182 
183     gl.genBuffers(1, &m_vbo);
184     gl.bindBuffer(GL_ARRAY_BUFFER, m_vbo);
185     gl.bufferData(GL_ARRAY_BUFFER, sizeof(fullscreenQuad), fullscreenQuad, GL_STATIC_DRAW);
186 
187     if (!glu::isContextTypeES(m_context.getRenderContext().getType()))
188         gl.genVertexArrays(1, &m_vao);
189 
190     // gen iterations
191 
192     m_testCtx.getLog() << tcu::TestLog::Message << "GL_MAX_TEXTURE_SIZE = " << maxTextureSize << "\n"
193                        << "GL_MAX_ARRAY_TEXTURE_LAYERS = " << maxTextureLayers << tcu::TestLog::EndMessage;
194 
195     if (!m_isArrayType)
196     {
197         for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(testSizes2D); ++ndx)
198         {
199             if (testSizes2D[ndx].x() <= maxTextureSize && testSizes2D[ndx].y() <= maxTextureSize)
200             {
201                 const int w = (testSizes2D[ndx].x() < 0) ? (maxTextureSize) : (testSizes2D[ndx].x());
202                 const int h = (testSizes2D[ndx].y() < 0) ? (maxTextureSize) : (testSizes2D[ndx].y());
203 
204                 m_iterations.push_back(tcu::IVec3(w, h, 0));
205             }
206         }
207     }
208     else
209     {
210         for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(testSizes3D); ++ndx)
211         {
212             if (testSizes3D[ndx].x() <= maxTextureSize && testSizes3D[ndx].y() <= maxTextureSize &&
213                 testSizes3D[ndx].z() <= maxTextureLayers)
214             {
215                 const int w = (testSizes3D[ndx].x() < 0) ? (maxTextureSize) : (testSizes3D[ndx].x());
216                 const int h = (testSizes3D[ndx].y() < 0) ? (maxTextureSize) : (testSizes3D[ndx].y());
217                 const int d = (testSizes3D[ndx].z() < 0) ? (maxTextureLayers) : (testSizes3D[ndx].z());
218 
219                 m_iterations.push_back(tcu::IVec3(w, h, d));
220             }
221         }
222     }
223 }
224 
deinit(void)225 void TextureSizeCase::deinit(void)
226 {
227     if (m_texture)
228     {
229         m_context.getRenderContext().getFunctions().deleteTextures(1, &m_texture);
230         m_texture = 0;
231     }
232 
233     if (m_vbo)
234     {
235         m_context.getRenderContext().getFunctions().deleteBuffers(1, &m_vbo);
236         m_vbo = 0;
237     }
238 
239     if (m_vao)
240     {
241         m_context.getRenderContext().getFunctions().deleteVertexArrays(1, &m_vao);
242         m_vao = 0;
243     }
244 
245     if (m_shader)
246     {
247         delete m_shader;
248         m_shader = DE_NULL;
249     }
250 }
251 
iterate(void)252 TextureSizeCase::IterateResult TextureSizeCase::iterate(void)
253 {
254     tcu::Surface result(1, 1);
255     bool skipTest = false;
256 
257     m_testCtx.getLog() << tcu::TestLog::Message << "\nIteration " << (m_iteration + 1) << " / "
258                        << (int)m_iterations.size() << tcu::TestLog::EndMessage;
259 
260     try
261     {
262         // set texture size
263 
264         createTexture(m_iterations[m_iteration]);
265 
266         // query texture size
267 
268         runShader(result, m_iterations[m_iteration]);
269     }
270     catch (glu::OutOfMemoryError &)
271     {
272         m_testCtx.getLog() << tcu::TestLog::Message << "Got GL_OUT_OF_MEMORY, skipping this size"
273                            << tcu::TestLog::EndMessage;
274 
275         skipTest = true;
276     }
277 
278     // free resources
279 
280     deleteTexture();
281 
282     // queried value was correct?
283 
284     if (!skipTest)
285     {
286         m_allCasesSkipped = false;
287 
288         if (!verifyImage(result))
289             m_allIterationsPassed = false;
290     }
291 
292     // final result
293 
294     if (++m_iteration < (int)m_iterations.size())
295         return CONTINUE;
296 
297     if (!m_allIterationsPassed)
298     {
299         m_testCtx.getLog() << tcu::TestLog::Message << "One or more test sizes failed." << tcu::TestLog::EndMessage;
300         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid texture size");
301     }
302     else if (m_allCasesSkipped)
303     {
304         m_testCtx.getLog() << tcu::TestLog::Message << "Could not test any texture size, texture creation failed."
305                            << tcu::TestLog::EndMessage;
306         m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "All test texture creations failed");
307     }
308     else
309     {
310         m_testCtx.getLog() << tcu::TestLog::Message << "All texture sizes passed." << tcu::TestLog::EndMessage;
311         m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
312     }
313 
314     return STOP;
315 }
316 
genFragmentSource(void)317 std::string TextureSizeCase::genFragmentSource(void)
318 {
319     static const char *const templateSource =
320         "${GLSL_VERSION_DECL}\n"
321         "${EXTENSION_STATEMENT}"
322         "layout(location = 0) out highp vec4 fragColor;\n"
323         "uniform highp ${SAMPLERTYPE} u_sampler;\n"
324         "uniform highp ${SIZETYPE} u_size;\n"
325         "void main (void)\n"
326         "{\n"
327         "    const highp vec4 okColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
328         "    const highp vec4 failColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
329         "    fragColor = (textureSize(u_sampler) == u_size) ? (okColor) : (failColor);\n"
330         "}\n";
331 
332     std::map<std::string, std::string> args;
333 
334     switch (m_type)
335     {
336     case TEXTURE_FLOAT_2D:
337         args["SAMPLERTYPE"] = "sampler2DMS";
338         break;
339     case TEXTURE_FLOAT_2D_ARRAY:
340         args["SAMPLERTYPE"] = "sampler2DMSArray";
341         break;
342     case TEXTURE_INT_2D:
343         args["SAMPLERTYPE"] = "isampler2DMS";
344         break;
345     case TEXTURE_INT_2D_ARRAY:
346         args["SAMPLERTYPE"] = "isampler2DMSArray";
347         break;
348     case TEXTURE_UINT_2D:
349         args["SAMPLERTYPE"] = "usampler2DMS";
350         break;
351     case TEXTURE_UINT_2D_ARRAY:
352         args["SAMPLERTYPE"] = "usampler2DMSArray";
353         break;
354     default:
355         DE_ASSERT(false);
356     }
357 
358     if (!m_isArrayType)
359         args["SIZETYPE"] = "ivec2";
360     else
361         args["SIZETYPE"] = "ivec3";
362 
363     const glu::ContextType contextType = m_context.getRenderContext().getType();
364     const bool supportsES32orGL45      = glu::contextSupports(contextType, glu::ApiType::es(3, 2)) ||
365                                     glu::contextSupports(contextType, glu::ApiType::core(4, 5));
366 
367     if (m_isArrayType && !supportsES32orGL45)
368         args["EXTENSION_STATEMENT"] = "#extension GL_OES_texture_storage_multisample_2d_array : require\n";
369     else
370         args["EXTENSION_STATEMENT"] = "";
371 
372     args["GLSL_VERSION_DECL"] = glu::getGLSLVersionDeclaration(glu::getContextTypeGLSLVersion(contextType));
373 
374     return tcu::StringTemplate(templateSource).specialize(args);
375 }
376 
getTextureGLTarget(void)377 glw::GLenum TextureSizeCase::getTextureGLTarget(void)
378 {
379     switch (m_type)
380     {
381     case TEXTURE_FLOAT_2D:
382         return GL_TEXTURE_2D_MULTISAMPLE;
383     case TEXTURE_FLOAT_2D_ARRAY:
384         return GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
385     case TEXTURE_INT_2D:
386         return GL_TEXTURE_2D_MULTISAMPLE;
387     case TEXTURE_INT_2D_ARRAY:
388         return GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
389     case TEXTURE_UINT_2D:
390         return GL_TEXTURE_2D_MULTISAMPLE;
391     case TEXTURE_UINT_2D_ARRAY:
392         return GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
393     default:
394         DE_ASSERT(false);
395         return 0;
396     }
397 }
398 
getTextureGLInternalFormat(void)399 glw::GLenum TextureSizeCase::getTextureGLInternalFormat(void)
400 {
401     switch (m_type)
402     {
403     case TEXTURE_FLOAT_2D:
404         return GL_RGBA8;
405     case TEXTURE_FLOAT_2D_ARRAY:
406         return GL_RGBA8;
407     case TEXTURE_INT_2D:
408         return GL_R8I;
409     case TEXTURE_INT_2D_ARRAY:
410         return GL_R8I;
411     case TEXTURE_UINT_2D:
412         return GL_R8UI;
413     case TEXTURE_UINT_2D_ARRAY:
414         return GL_R8UI;
415     default:
416         DE_ASSERT(false);
417         return 0;
418     }
419 }
420 
createTexture(const tcu::IVec3 & size)421 void TextureSizeCase::createTexture(const tcu::IVec3 &size)
422 {
423     const glw::Functions &gl = m_context.getRenderContext().getFunctions();
424 
425     if (!m_isArrayType)
426         m_testCtx.getLog() << tcu::TestLog::Message << "Creating texture with size " << size.x() << "x" << size.y()
427                            << tcu::TestLog::EndMessage;
428     else
429         m_testCtx.getLog() << tcu::TestLog::Message << "Creating texture with size " << size.x() << "x" << size.y()
430                            << "x" << size.z() << tcu::TestLog::EndMessage;
431 
432     gl.genTextures(1, &m_texture);
433     gl.bindTexture(getTextureGLTarget(), m_texture);
434     GLU_EXPECT_NO_ERROR(gl.getError(), "texture gen");
435 
436     if (!m_isArrayType)
437         gl.texStorage2DMultisample(getTextureGLTarget(), m_numSamples, getTextureGLInternalFormat(), size.x(), size.y(),
438                                    GL_FALSE);
439     else
440         gl.texStorage3DMultisample(getTextureGLTarget(), m_numSamples, getTextureGLInternalFormat(), size.x(), size.y(),
441                                    size.z(), GL_FALSE);
442     GLU_EXPECT_NO_ERROR(gl.getError(), "texStorage");
443 }
444 
deleteTexture(void)445 void TextureSizeCase::deleteTexture(void)
446 {
447     const glw::Functions &gl = m_context.getRenderContext().getFunctions();
448 
449     if (m_texture)
450     {
451         gl.deleteTextures(1, &m_texture);
452         m_texture = 0;
453 
454         GLU_EXPECT_NO_ERROR(gl.getError(), "texture delete");
455     }
456 }
457 
runShader(tcu::Surface & dst,const tcu::IVec3 & size)458 void TextureSizeCase::runShader(tcu::Surface &dst, const tcu::IVec3 &size)
459 {
460     const glw::Functions &gl   = m_context.getRenderContext().getFunctions();
461     const int positionLoc      = gl.getAttribLocation(m_shader->getProgram(), "a_position");
462     const int shaderSamplerLoc = gl.getUniformLocation(m_shader->getProgram(), "u_sampler");
463     const int shaderSizeLoc    = gl.getUniformLocation(m_shader->getProgram(), "u_size");
464 
465     m_testCtx.getLog() << tcu::TestLog::Message << "Running the verification shader." << tcu::TestLog::EndMessage;
466 
467     GLU_EXPECT_NO_ERROR(gl.getError(), "preclear");
468     gl.viewport(0, 0, 1, 1);
469     gl.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
470     gl.clear(GL_COLOR_BUFFER_BIT);
471     GLU_EXPECT_NO_ERROR(gl.getError(), "clear");
472 
473     if (m_vao)
474         gl.bindVertexArray(m_vao);
475 
476     gl.bindBuffer(GL_ARRAY_BUFFER, m_vbo);
477     gl.vertexAttribPointer(positionLoc, 4, GL_FLOAT, GL_FALSE, 0, DE_NULL);
478     gl.enableVertexAttribArray(positionLoc);
479     GLU_EXPECT_NO_ERROR(gl.getError(), "vertexAttrib");
480 
481     gl.useProgram(m_shader->getProgram());
482     gl.uniform1i(shaderSamplerLoc, 0);
483     if (m_isArrayType)
484         gl.uniform3iv(shaderSizeLoc, 1, size.getPtr());
485     else
486         gl.uniform2iv(shaderSizeLoc, 1, size.getPtr());
487     GLU_EXPECT_NO_ERROR(gl.getError(), "setup program");
488 
489     gl.bindTexture(getTextureGLTarget(), m_texture);
490     GLU_EXPECT_NO_ERROR(gl.getError(), "bindtex");
491 
492     gl.drawArrays(GL_TRIANGLE_STRIP, 0, 4);
493     GLU_EXPECT_NO_ERROR(gl.getError(), "drawArrays");
494 
495     gl.disableVertexAttribArray(positionLoc);
496     gl.useProgram(0);
497     if (m_vao)
498         gl.bindVertexArray(0);
499     GLU_EXPECT_NO_ERROR(gl.getError(), "cleanup");
500 
501     gl.finish();
502     glu::readPixels(m_context.getRenderContext(), 0, 0, dst.getAccess());
503     GLU_EXPECT_NO_ERROR(gl.getError(), "readPixels");
504 }
505 
verifyImage(const tcu::Surface & dst)506 bool TextureSizeCase::verifyImage(const tcu::Surface &dst)
507 {
508     DE_ASSERT(dst.getWidth() == 1 && dst.getHeight() == 1);
509 
510     const int colorThresholdRed   = 1 << (8 - m_context.getRenderTarget().getPixelFormat().redBits);
511     const int colorThresholdGreen = 1 << (8 - m_context.getRenderTarget().getPixelFormat().greenBits);
512     const int colorThresholdBlue  = 1 << (8 - m_context.getRenderTarget().getPixelFormat().blueBits);
513     const tcu::RGBA color         = dst.getPixel(0, 0);
514 
515     m_testCtx.getLog() << tcu::TestLog::Message << "Verifying image." << tcu::TestLog::EndMessage;
516 
517     // green
518     if (color.getRed() < colorThresholdRed && color.getGreen() > 255 - colorThresholdGreen &&
519         color.getBlue() < colorThresholdBlue)
520     {
521         m_testCtx.getLog() << tcu::TestLog::Message << "Result ok." << tcu::TestLog::EndMessage;
522         return true;
523     }
524     // red
525     else if (color.getRed() > 255 - colorThresholdRed && color.getGreen() < colorThresholdGreen &&
526              color.getBlue() < colorThresholdBlue)
527     {
528         m_testCtx.getLog() << tcu::TestLog::Message << "Image size incorrect." << tcu::TestLog::EndMessage;
529         return false;
530     }
531 
532     m_testCtx.getLog() << tcu::TestLog::Message << "Expected either green or red pixel, got " << color
533                        << tcu::TestLog::EndMessage;
534     return false;
535 }
536 
537 } // namespace
538 
ShaderTextureSizeTests(Context & context)539 ShaderTextureSizeTests::ShaderTextureSizeTests(Context &context)
540     : TestCaseGroup(context, "texture_size", "Texture size tests")
541 {
542 }
543 
~ShaderTextureSizeTests(void)544 ShaderTextureSizeTests::~ShaderTextureSizeTests(void)
545 {
546 }
547 
init(void)548 void ShaderTextureSizeTests::init(void)
549 {
550     static const struct SamplerType
551     {
552         TextureSizeCase::TextureType type;
553         const char *name;
554     } samplerTypes[] = {
555         {TextureSizeCase::TEXTURE_FLOAT_2D, "texture_2d"},
556         {TextureSizeCase::TEXTURE_FLOAT_2D_ARRAY, "texture_2d_array"},
557         {TextureSizeCase::TEXTURE_INT_2D, "texture_int_2d"},
558         {TextureSizeCase::TEXTURE_INT_2D_ARRAY, "texture_int_2d_array"},
559         {TextureSizeCase::TEXTURE_UINT_2D, "texture_uint_2d"},
560         {TextureSizeCase::TEXTURE_UINT_2D_ARRAY, "texture_uint_2d_array"},
561     };
562 
563     static const int sampleCounts[] = {1, 4};
564 
565     for (int samplerTypeNdx = 0; samplerTypeNdx < DE_LENGTH_OF_ARRAY(samplerTypes); ++samplerTypeNdx)
566     {
567         for (int sampleCountNdx = 0; sampleCountNdx < DE_LENGTH_OF_ARRAY(sampleCounts); ++sampleCountNdx)
568         {
569             const std::string name = std::string() + "samples_" + de::toString(sampleCounts[sampleCountNdx]) + "_" +
570                                      samplerTypes[samplerTypeNdx].name;
571             const std::string desc = std::string() + "samples count = " + de::toString(sampleCounts[sampleCountNdx]) +
572                                      ", type = " + samplerTypes[samplerTypeNdx].name;
573 
574             addChild(new TextureSizeCase(m_context, name.c_str(), desc.c_str(), samplerTypes[samplerTypeNdx].type,
575                                          sampleCounts[sampleCountNdx]));
576         }
577     }
578 }
579 
580 } // namespace Functional
581 } // namespace gles31
582 } // namespace deqp
583