xref: /aosp_15_r20/external/deqp/modules/egl/teglQueryConfigTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program EGL 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 Config query tests.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "teglQueryConfigTests.hpp"
25 #include "teglSimpleConfigCase.hpp"
26 #include "tcuTestLog.hpp"
27 #include "tcuTestContext.hpp"
28 #include "tcuCommandLine.hpp"
29 #include "egluCallLogWrapper.hpp"
30 #include "egluStrUtil.hpp"
31 #include "egluUtil.hpp"
32 #include "eglwLibrary.hpp"
33 #include "eglwEnums.hpp"
34 #include "deRandom.hpp"
35 
36 #include <string>
37 #include <vector>
38 
39 namespace deqp
40 {
41 namespace egl
42 {
43 
44 using eglu::ConfigInfo;
45 using tcu::TestLog;
46 using namespace eglw;
47 
logConfigAttribute(TestLog & log,EGLenum attrib,EGLint value)48 static void logConfigAttribute(TestLog &log, EGLenum attrib, EGLint value)
49 {
50     log << TestLog::Message << "  " << eglu::getConfigAttribName(attrib) << ": "
51         << eglu::getConfigAttribValueStr(attrib, value) << TestLog::EndMessage;
52 }
53 
isAttributePresent(const eglu::Version & version,EGLenum attribute)54 static bool isAttributePresent(const eglu::Version &version, EGLenum attribute)
55 {
56     switch (attribute)
57     {
58     case EGL_CONFORMANT:
59         if (version < eglu::Version(1, 3))
60             return false;
61         break;
62     case EGL_LUMINANCE_SIZE:
63     case EGL_ALPHA_MASK_SIZE:
64     case EGL_COLOR_BUFFER_TYPE:
65     case EGL_MATCH_NATIVE_PIXMAP:
66         if (version < eglu::Version(1, 2))
67             return false;
68         break;
69     case EGL_BIND_TO_TEXTURE_RGB:
70     case EGL_BIND_TO_TEXTURE_RGBA:
71     case EGL_MAX_SWAP_INTERVAL:
72     case EGL_MIN_SWAP_INTERVAL:
73     case EGL_RENDERABLE_TYPE:
74         if (version < eglu::Version(1, 1))
75             return false;
76         break;
77     default:
78         break;
79     }
80 
81     return true;
82 }
83 
hasRequiredExtension(const eglw::Library & egl,EGLDisplay display,EGLenum attribute)84 static bool hasRequiredExtension(const eglw::Library &egl, EGLDisplay display, EGLenum attribute)
85 {
86     switch (attribute)
87     {
88     case EGL_RECORDABLE_ANDROID:
89         return eglu::hasExtension(egl, display, "EGL_ANDROID_recordable");
90     default:
91         break;
92     }
93 
94     return true;
95 }
96 
97 class GetConfigsBoundsCase : public TestCase, protected eglu::CallLogWrapper
98 {
99 public:
GetConfigsBoundsCase(EglTestContext & eglTestCtx,const char * name,const char * description)100     GetConfigsBoundsCase(EglTestContext &eglTestCtx, const char *name, const char *description)
101         : TestCase(eglTestCtx, name, description)
102         , CallLogWrapper(eglTestCtx.getLibrary(), eglTestCtx.getTestContext().getLog())
103         , m_display(EGL_NO_DISPLAY)
104     {
105     }
106 
init(void)107     void init(void)
108     {
109         DE_ASSERT(m_display == EGL_NO_DISPLAY);
110         m_display = eglu::getAndInitDisplay(m_eglTestCtx.getNativeDisplay());
111         m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
112     }
113 
deinit(void)114     void deinit(void)
115     {
116         m_eglTestCtx.getLibrary().terminate(m_display);
117         m_display = EGL_NO_DISPLAY;
118     }
119 
checkGetConfigsBounds(de::Random & rnd,const int numConfigAll,const int numConfigRequested)120     void checkGetConfigsBounds(de::Random &rnd, const int numConfigAll, const int numConfigRequested)
121     {
122         tcu::TestLog &log = m_testCtx.getLog();
123         std::vector<EGLConfig> buffer(numConfigAll + 10);
124 
125         std::vector<uint32_t> magicBuffer((buffer.size() * sizeof(EGLConfig)) / sizeof(uint32_t) + 1);
126         const EGLConfig *magicConfigs = reinterpret_cast<EGLConfig *>(&magicBuffer[0]);
127 
128         int numConfigReturned;
129 
130         // Fill buffers with magic
131         for (size_t ndx = 0; ndx < magicBuffer.size(); ndx++)
132             magicBuffer[ndx] = rnd.getUint32();
133         for (size_t ndx = 0; ndx < buffer.size(); ndx++)
134             buffer[ndx] = magicConfigs[ndx];
135 
136         eglGetConfigs(m_display, &buffer[0], numConfigRequested, &numConfigReturned);
137         eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
138 
139         log << TestLog::Message << numConfigReturned << " configs returned" << TestLog::EndMessage;
140 
141         // Compare results with stored magic
142         {
143             int numOverwritten = 0;
144 
145             for (size_t ndx = 0; ndx < buffer.size(); ndx++)
146             {
147                 if (buffer[ndx] == magicConfigs[ndx])
148                 {
149                     numOverwritten = (int)ndx;
150                     break;
151                 }
152             }
153 
154             log << TestLog::Message << numOverwritten << " values actually written" << TestLog::EndMessage;
155 
156             if (numConfigReturned > deMax32(numConfigRequested, 0))
157             {
158                 log << TestLog::Message << "Fail, more configs returned than requested." << TestLog::EndMessage;
159                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Too many configs returned");
160             }
161 
162             if (numOverwritten > deMax32(numConfigReturned, 0))
163             {
164                 log << TestLog::Message << "Fail, buffer overflow detected." << TestLog::EndMessage;
165                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Buffer overflow");
166             }
167             else if (numOverwritten != numConfigReturned)
168             {
169                 log << TestLog::Message
170                     << "Fail, reported number of returned configs differs from number of values written."
171                     << TestLog::EndMessage;
172                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Incorrect size");
173             }
174         }
175     }
176 
iterate(void)177     IterateResult iterate(void)
178     {
179         tcu::TestLog &log = m_testCtx.getLog();
180         EGLint numConfigAll;
181 
182         enableLogging(true);
183 
184         eglGetConfigs(m_display, 0, 0, &numConfigAll);
185 
186         log << TestLog::Message << numConfigAll << " configs available" << TestLog::EndMessage;
187         log << TestLog::Message << TestLog::EndMessage;
188 
189         if (numConfigAll > 0)
190         {
191             de::Random rnd(123);
192 
193             for (int i = 0; i < 5; i++)
194             {
195                 checkGetConfigsBounds(rnd, numConfigAll, rnd.getInt(0, numConfigAll));
196                 log << TestLog::Message << TestLog::EndMessage;
197             }
198 
199             checkGetConfigsBounds(rnd, numConfigAll, -1);
200         }
201         else
202         {
203             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "No configs");
204         }
205 
206         enableLogging(false);
207 
208         return STOP;
209     }
210 
211 protected:
212     EGLDisplay m_display;
213 };
214 
215 class GetConfigAttribCase : public TestCase, protected eglu::CallLogWrapper
216 {
217 public:
218     GetConfigAttribCase(EglTestContext &eglTestCtx, const char *name, const char *description);
219 
220     void init(void);
221     void deinit(void);
222     IterateResult iterate(void);
223 
224     EGLint getValue(EGLConfig config, EGLenum attrib, bool logValue = true);
225 
226     virtual void executeTest(EGLConfig config) = 0;
227 
228 protected:
229     EGLDisplay m_display;
230 
231 private:
232     std::vector<EGLConfig> m_configs;
233     std::vector<EGLConfig>::const_iterator m_configsIter;
234 };
235 
GetConfigAttribCase(EglTestContext & eglTestCtx,const char * name,const char * description)236 GetConfigAttribCase::GetConfigAttribCase(EglTestContext &eglTestCtx, const char *name, const char *description)
237     : TestCase(eglTestCtx, name, description)
238     , CallLogWrapper(eglTestCtx.getLibrary(), eglTestCtx.getTestContext().getLog())
239     , m_display(EGL_NO_DISPLAY)
240 {
241 }
242 
init(void)243 void GetConfigAttribCase::init(void)
244 {
245     DE_ASSERT(m_display == EGL_NO_DISPLAY);
246     m_display     = eglu::getAndInitDisplay(m_eglTestCtx.getNativeDisplay());
247     m_configs     = eglu::getConfigs(m_eglTestCtx.getLibrary(), m_display);
248     m_configsIter = m_configs.begin();
249 
250     m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
251 }
252 
deinit(void)253 void GetConfigAttribCase::deinit(void)
254 {
255     m_eglTestCtx.getLibrary().terminate(m_display);
256     m_display = EGL_NO_DISPLAY;
257 }
258 
iterate(void)259 tcu::TestNode::IterateResult GetConfigAttribCase::iterate(void)
260 {
261     tcu::TestLog &log = m_testCtx.getLog();
262 
263     if (m_configsIter == m_configs.end())
264     {
265         log << TestLog::Message << "No configs available." << TestLog::EndMessage;
266         return STOP;
267     }
268 
269     {
270         const EGLConfig config = *m_configsIter;
271         EGLint id;
272 
273         eglGetConfigAttrib(m_display, config, EGL_CONFIG_ID, &id);
274         eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
275         log << TestLog::Message << "Config ID " << id << TestLog::EndMessage;
276 
277         executeTest(config);
278     }
279 
280     log << TestLog::Message << TestLog::EndMessage;
281 
282     m_configsIter++;
283 
284     if (m_configsIter == m_configs.end())
285         return STOP;
286     else
287         return CONTINUE;
288 }
289 
getValue(EGLConfig config,EGLenum attrib,bool logValue)290 EGLint GetConfigAttribCase::getValue(EGLConfig config, EGLenum attrib, bool logValue)
291 {
292     TestLog &log = m_testCtx.getLog();
293     EGLint value;
294 
295     eglGetConfigAttrib(m_display, config, attrib, &value);
296     eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
297 
298     if (logValue)
299         logConfigAttribute(log, attrib, value);
300 
301     return value;
302 }
303 
304 class GetConfigAttribSimpleCase : public GetConfigAttribCase
305 {
306 public:
GetConfigAttribSimpleCase(EglTestContext & eglTestCtx,const char * name,const char * description,EGLenum attribute)307     GetConfigAttribSimpleCase(EglTestContext &eglTestCtx, const char *name, const char *description, EGLenum attribute)
308         : GetConfigAttribCase(eglTestCtx, name, description)
309         , m_attrib(attribute)
310     {
311     }
312 
checkColorBufferType(EGLint value)313     void checkColorBufferType(EGLint value)
314     {
315         const bool isRGBBuffer       = value == EGL_RGB_BUFFER;
316         const bool isLuminanceBuffer = value == EGL_LUMINANCE_BUFFER;
317         const bool isYuvBuffer       = value == EGL_YUV_BUFFER_EXT;
318         const bool hasYuvSupport     = eglu::hasExtension(m_eglTestCtx.getLibrary(), m_display, "EGL_EXT_yuv_surface");
319 
320         if (!(isRGBBuffer || isLuminanceBuffer || (isYuvBuffer && hasYuvSupport)))
321         {
322             TestLog &log = m_testCtx.getLog();
323 
324             log << TestLog::Message << "Fail, invalid EGL_COLOR_BUFFER_TYPE value" << TestLog::EndMessage;
325             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
326         }
327     }
328 
checkCaveat(EGLint value)329     void checkCaveat(EGLint value)
330     {
331         if (!(value == EGL_NONE || value == EGL_SLOW_CONFIG || value == EGL_NON_CONFORMANT_CONFIG))
332         {
333             TestLog &log = m_testCtx.getLog();
334 
335             log << TestLog::Message << "Fail, invalid EGL_CONFIG_CAVEAT value" << TestLog::EndMessage;
336             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
337         }
338     }
339 
checkTransparentType(EGLint value)340     void checkTransparentType(EGLint value)
341     {
342         if (!(value == EGL_NONE || value == EGL_TRANSPARENT_RGB))
343         {
344             TestLog &log = m_testCtx.getLog();
345 
346             log << TestLog::Message << "Fail, invalid EGL_TRANSPARENT_TYPE value" << TestLog::EndMessage;
347             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
348         }
349     }
350 
checkBoolean(EGLenum attrib,EGLint value)351     void checkBoolean(EGLenum attrib, EGLint value)
352     {
353         if (!(value == EGL_FALSE || value == EGL_TRUE))
354         {
355             TestLog &log = m_testCtx.getLog();
356 
357             log << TestLog::Message << "Fail, " << eglu::getConfigAttribStr(attrib) << " should be a boolean value."
358                 << TestLog::EndMessage;
359             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
360         }
361     }
362 
checkInteger(EGLenum attrib,EGLint value)363     void checkInteger(EGLenum attrib, EGLint value)
364     {
365         if (attrib == EGL_NATIVE_VISUAL_ID || attrib == EGL_NATIVE_VISUAL_TYPE) // Implementation-defined
366             return;
367 
368         if (attrib == EGL_CONFIG_ID && value < 1)
369         {
370             TestLog &log = m_testCtx.getLog();
371 
372             log << TestLog::Message << "Fail, config IDs should be positive integer values beginning from 1."
373                 << TestLog::EndMessage;
374             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
375         }
376     }
377 
checkSurfaceTypeMask(EGLint value)378     void checkSurfaceTypeMask(EGLint value)
379     {
380         const EGLint wantedBits = EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT;
381 
382         if ((value & wantedBits) == 0)
383         {
384             TestLog &log = m_testCtx.getLog();
385 
386             log << TestLog::Message << "Fail, config does not actually support creation of any surface type?"
387                 << TestLog::EndMessage;
388             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid value");
389         }
390     }
391 
checkAttribute(EGLenum attrib,EGLint value)392     void checkAttribute(EGLenum attrib, EGLint value)
393     {
394         switch (attrib)
395         {
396         case EGL_COLOR_BUFFER_TYPE:
397             checkColorBufferType(value);
398             break;
399         case EGL_CONFIG_CAVEAT:
400             checkCaveat(value);
401             break;
402         case EGL_TRANSPARENT_TYPE:
403             checkTransparentType(value);
404             break;
405         case EGL_CONFORMANT:
406         case EGL_RENDERABLE_TYPE:
407             // Just print what we know
408             break;
409         case EGL_SURFACE_TYPE:
410             checkSurfaceTypeMask(value);
411             break;
412         case EGL_BIND_TO_TEXTURE_RGB:
413         case EGL_BIND_TO_TEXTURE_RGBA:
414         case EGL_NATIVE_RENDERABLE:
415         case EGL_RECORDABLE_ANDROID:
416             checkBoolean(attrib, value);
417             break;
418         default:
419             checkInteger(attrib, value);
420         }
421     }
422 
executeTest(EGLConfig config)423     void executeTest(EGLConfig config)
424     {
425         TestLog &log          = m_testCtx.getLog();
426         eglu::Version version = eglu::getVersion(m_eglTestCtx.getLibrary(), m_display);
427 
428         if (!isAttributePresent(version, m_attrib))
429         {
430             log << TestLog::Message << eglu::getConfigAttribStr(m_attrib) << " not supported by this EGL version";
431         }
432         else if (!hasRequiredExtension(m_eglTestCtx.getLibrary(), m_display, m_attrib))
433         {
434             std::string message =
435                 std::string(eglu::getConfigAttribName(m_attrib)) + " not supported due to missing extension";
436             TCU_THROW(NotSupportedError, message);
437         }
438         else
439         {
440             EGLint value;
441 
442             enableLogging(true);
443 
444             eglGetConfigAttrib(m_display, config, m_attrib, &value);
445             eglu::checkError(eglGetError(), DE_NULL, __FILE__, __LINE__);
446 
447             logConfigAttribute(log, m_attrib, value);
448             checkAttribute(m_attrib, value);
449 
450             enableLogging(false);
451         }
452     }
453 
454 private:
455     EGLenum m_attrib;
456 };
457 
458 class GetConfigAttribBufferSizeCase : public GetConfigAttribCase
459 {
460 public:
GetConfigAttribBufferSizeCase(EglTestContext & eglTestCtx,const char * name,const char * description)461     GetConfigAttribBufferSizeCase(EglTestContext &eglTestCtx, const char *name, const char *description)
462         : GetConfigAttribCase(eglTestCtx, name, description)
463     {
464     }
465 
executeTest(EGLConfig config)466     void executeTest(EGLConfig config)
467     {
468         TestLog &log = m_testCtx.getLog();
469 
470         const EGLint colorBufferType = getValue(config, EGL_COLOR_BUFFER_TYPE);
471 
472         const EGLint bufferSize    = getValue(config, EGL_BUFFER_SIZE);
473         const EGLint redSize       = getValue(config, EGL_RED_SIZE);
474         const EGLint greenSize     = getValue(config, EGL_GREEN_SIZE);
475         const EGLint blueSize      = getValue(config, EGL_BLUE_SIZE);
476         const EGLint luminanceSize = getValue(config, EGL_LUMINANCE_SIZE);
477         const EGLint alphaSize     = getValue(config, EGL_ALPHA_SIZE);
478 
479         if (alphaSize < 0)
480         {
481             log << TestLog::Message << "Fail, alpha size must be zero or positive." << TestLog::EndMessage;
482             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid alpha size");
483         }
484 
485         if (colorBufferType == EGL_RGB_BUFFER)
486         {
487             if (luminanceSize != 0)
488             {
489                 log << TestLog::Message << "Fail, luminance size must be zero for an RGB buffer."
490                     << TestLog::EndMessage;
491                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid luminance size");
492             }
493 
494             if (redSize <= 0 || greenSize <= 0 || blueSize <= 0)
495             {
496                 log << TestLog::Message << "Fail, RGB component sizes must be positive for an RGB buffer."
497                     << TestLog::EndMessage;
498                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid color component size");
499             }
500 
501             if (bufferSize != (redSize + greenSize + blueSize + alphaSize))
502             {
503                 log << TestLog::Message
504                     << "Fail, buffer size must be equal to the sum of RGB component sizes and alpha size."
505                     << TestLog::EndMessage;
506                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid buffer size");
507             }
508         }
509         else if (colorBufferType == EGL_LUMINANCE_BUFFER)
510         {
511             if (luminanceSize <= 0)
512             {
513                 log << TestLog::Message << "Fail, luminance size must be positive for a luminance buffer."
514                     << TestLog::EndMessage;
515                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid luminance size");
516             }
517 
518             if (redSize != 0 || greenSize != 0 || blueSize != 0)
519             {
520                 log << TestLog::Message << "Fail, RGB component sizes must be zero for a luminance buffer."
521                     << TestLog::EndMessage;
522                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid color component size");
523             }
524 
525             if (bufferSize != (luminanceSize + alphaSize))
526             {
527                 log << TestLog::Message
528                     << "Fail, buffer size must be equal to the sum of luminance size and alpha size."
529                     << TestLog::EndMessage;
530                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid buffer size");
531             }
532         }
533     }
534 };
535 
536 class GetConfigAttribTransparentValueCase : public GetConfigAttribCase
537 {
538 public:
GetConfigAttribTransparentValueCase(EglTestContext & eglTestCtx,const char * name,const char * description)539     GetConfigAttribTransparentValueCase(EglTestContext &eglTestCtx, const char *name, const char *description)
540         : GetConfigAttribCase(eglTestCtx, name, description)
541     {
542     }
543 
executeTest(EGLConfig config)544     void executeTest(EGLConfig config)
545     {
546         TestLog &log = m_testCtx.getLog();
547 
548         const EGLint transparentType = getValue(config, EGL_TRANSPARENT_TYPE);
549         const EGLint redValue        = getValue(config, EGL_TRANSPARENT_RED_VALUE);
550         const EGLint greenValue      = getValue(config, EGL_TRANSPARENT_GREEN_VALUE);
551         const EGLint blueValue       = getValue(config, EGL_TRANSPARENT_BLUE_VALUE);
552 
553         const EGLint redSize   = getValue(config, EGL_RED_SIZE);
554         const EGLint greenSize = getValue(config, EGL_GREEN_SIZE);
555         const EGLint blueSize  = getValue(config, EGL_BLUE_SIZE);
556 
557         if (transparentType == EGL_TRANSPARENT_RGB)
558         {
559             if ((redValue < 0 || redValue >= (1 << redSize)) || (greenValue < 0 || greenValue >= (1 << greenSize)) ||
560                 (blueValue < 0 || blueValue >= (1 << blueSize)))
561             {
562                 log << TestLog::Message
563                     << "Fail, transparent color values must lie between 0 and the maximum component value."
564                     << TestLog::EndMessage;
565                 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid transparent color value");
566             }
567         }
568     }
569 };
570 
QueryConfigTests(EglTestContext & eglTestCtx)571 QueryConfigTests::QueryConfigTests(EglTestContext &eglTestCtx)
572     : TestCaseGroup(eglTestCtx, "query_config", "Surface config query tests")
573 {
574 }
575 
~QueryConfigTests(void)576 QueryConfigTests::~QueryConfigTests(void)
577 {
578 }
579 
init(void)580 void QueryConfigTests::init(void)
581 {
582     // eglGetGonfigs
583     {
584         tcu::TestCaseGroup *getConfigsGroup = new tcu::TestCaseGroup(m_testCtx, "get_configs", "eglGetConfigs tests");
585         addChild(getConfigsGroup);
586 
587         getConfigsGroup->addChild(
588             new GetConfigsBoundsCase(m_eglTestCtx, "get_configs_bounds", "eglGetConfigs bounds checking test"));
589     }
590 
591     // eglGetConfigAttrib
592     {
593         static const struct
594         {
595             EGLenum attribute;
596             const char *testName;
597         } attributes[] = {
598             {EGL_BUFFER_SIZE, "buffer_size"},
599             {EGL_RED_SIZE, "red_size"},
600             {EGL_GREEN_SIZE, "green_size"},
601             {EGL_BLUE_SIZE, "blue_size"},
602             {EGL_LUMINANCE_SIZE, "luminance_size"},
603             {EGL_ALPHA_SIZE, "alpha_size"},
604             {EGL_ALPHA_MASK_SIZE, "alpha_mask_size"},
605             {EGL_BIND_TO_TEXTURE_RGB, "bind_to_texture_rgb"},
606             {EGL_BIND_TO_TEXTURE_RGBA, "bind_to_texture_rgba"},
607             {EGL_COLOR_BUFFER_TYPE, "color_buffer_type"},
608             {EGL_CONFIG_CAVEAT, "config_caveat"},
609             {EGL_CONFIG_ID, "config_id"},
610             {EGL_CONFORMANT, "conformant"},
611             {EGL_DEPTH_SIZE, "depth_size"},
612             {EGL_LEVEL, "level"},
613             {EGL_MAX_SWAP_INTERVAL, "max_swap_interval"},
614             {EGL_MIN_SWAP_INTERVAL, "min_swap_interval"},
615             {EGL_NATIVE_RENDERABLE, "native_renderable"},
616             {EGL_NATIVE_VISUAL_TYPE, "native_visual_type"},
617             {EGL_RENDERABLE_TYPE, "renderable_type"},
618             {EGL_SAMPLE_BUFFERS, "sample_buffers"},
619             {EGL_SAMPLES, "samples"},
620             {EGL_STENCIL_SIZE, "stencil_size"},
621             {EGL_SURFACE_TYPE, "surface_type"},
622             {EGL_TRANSPARENT_TYPE, "transparent_type"},
623             {EGL_TRANSPARENT_RED_VALUE, "transparent_red_value"},
624             {EGL_TRANSPARENT_GREEN_VALUE, "transparent_green_value"},
625             {EGL_TRANSPARENT_BLUE_VALUE, "transparent_blue_value"},
626             {EGL_RECORDABLE_ANDROID, "recordable_android"},
627         };
628 
629         tcu::TestCaseGroup *simpleGroup =
630             new tcu::TestCaseGroup(m_testCtx, "get_config_attrib", "eglGetConfigAttrib() tests");
631         addChild(simpleGroup);
632 
633         for (int ndx = 0; ndx < (int)DE_LENGTH_OF_ARRAY(attributes); ndx++)
634         {
635             simpleGroup->addChild(new GetConfigAttribSimpleCase(
636                 m_eglTestCtx, attributes[ndx].testName, "Simple attribute query case", attributes[ndx].attribute));
637         }
638     }
639 
640     // Attribute constraints
641     {
642         tcu::TestCaseGroup *constraintsGroup =
643             new tcu::TestCaseGroup(m_testCtx, "constraints", "Attribute constraint tests");
644         addChild(constraintsGroup);
645 
646         constraintsGroup->addChild(
647             new GetConfigAttribBufferSizeCase(m_eglTestCtx, "color_buffer_size", "Color buffer component sizes"));
648         constraintsGroup->addChild(
649             new GetConfigAttribTransparentValueCase(m_eglTestCtx, "transparent_value", "Transparent color value"));
650     }
651 }
652 
653 } // namespace egl
654 } // namespace deqp
655