Handle EGL_EXT_yuv_surface in eglChooseConfig() tests
authorPyry Haulos <phaulos@google.com>
Mon, 22 Aug 2016 22:56:52 +0000 (15:56 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 29 Aug 2016 18:31:27 +0000 (11:31 -0700)
Includes various small code fixes to related utilities.

Bug: 30909517
Change-Id: Ib0142d89832be4226406238800ebeab84b59c599

framework/egl/egluConfigInfo.cpp
framework/egl/egluConfigInfo.hpp
framework/egl/egluStrUtil.inl
framework/egl/egluStrUtilPrototypes.inl
modules/egl/teglChooseConfigReference.cpp
modules/egl/teglQuerySurfaceTests.cpp
scripts/egl/str_util.py

index b1eefc0..aed08f3 100644 (file)
@@ -25,6 +25,8 @@
 #include "egluDefs.hpp"
 #include "eglwLibrary.hpp"
 #include "eglwEnums.hpp"
+#include "egluUtil.hpp"
+#include "deSTLUtil.hpp"
 
 namespace eglu
 {
@@ -66,11 +68,20 @@ deInt32 ConfigInfo::getAttribute (deUint32 attribute) const
                case EGL_TRANSPARENT_RED_VALUE:         return transparentRedValue;
                case EGL_TRANSPARENT_GREEN_VALUE:       return transparentGreenValue;
                case EGL_TRANSPARENT_BLUE_VALUE:        return transparentBlueValue;
-               default:                                                        TCU_FAIL("Unknown attribute");
+
+               // EGL_EXT_yuv_surface
+               case EGL_YUV_ORDER_EXT:                         return yuvOrder;
+               case EGL_YUV_NUMBER_OF_PLANES_EXT:      return yuvNumberOfPlanes;
+               case EGL_YUV_SUBSAMPLE_EXT:                     return yuvSubsample;
+               case EGL_YUV_DEPTH_RANGE_EXT:           return yuvDepthRange;
+               case EGL_YUV_CSC_STANDARD_EXT:          return yuvCscStandard;
+               case EGL_YUV_PLANE_BPP_EXT:                     return yuvPlaneBpp;
+
+               default:                                                        TCU_THROW(InternalError, "Unknown attribute");
        }
 }
 
-void queryConfigInfo (const Library& egl, EGLDisplay display, EGLConfig config, ConfigInfo* dst)
+void queryCoreConfigInfo (const Library& egl, EGLDisplay display, EGLConfig config, ConfigInfo* dst)
 {
        egl.getConfigAttrib(display, config, EGL_BUFFER_SIZE,                           &dst->bufferSize);
        egl.getConfigAttrib(display, config, EGL_RED_SIZE,                                      &dst->redSize);
@@ -106,4 +117,21 @@ void queryConfigInfo (const Library& egl, EGLDisplay display, EGLConfig config,
        EGLU_CHECK_MSG(egl, "Failed to query config info");
 }
 
+void queryExtConfigInfo (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst)
+{
+       const std::vector<std::string>  extensions      = getDisplayExtensions(egl, display);
+
+       if (de::contains(extensions.begin(), extensions.end(), "EGL_EXT_yuv_surface"))
+       {
+               egl.getConfigAttrib(display, config, EGL_YUV_ORDER_EXT,                         (EGLint*)&dst->yuvOrder);
+               egl.getConfigAttrib(display, config, EGL_YUV_NUMBER_OF_PLANES_EXT,      (EGLint*)&dst->yuvNumberOfPlanes);
+               egl.getConfigAttrib(display, config, EGL_YUV_SUBSAMPLE_EXT,                     (EGLint*)&dst->yuvSubsample);
+               egl.getConfigAttrib(display, config, EGL_YUV_DEPTH_RANGE_EXT,           (EGLint*)&dst->yuvDepthRange);
+               egl.getConfigAttrib(display, config, EGL_YUV_CSC_STANDARD_EXT,          (EGLint*)&dst->yuvCscStandard);
+               egl.getConfigAttrib(display, config, EGL_YUV_PLANE_BPP_EXT,                     (EGLint*)&dst->yuvPlaneBpp);
+
+               EGLU_CHECK_MSG(egl, "Failed to query EGL_EXT_yuv_surface config attribs");
+       }
+}
+
 } // eglu
index 42fcaa3..356c50a 100644 (file)
@@ -10,7 +10,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ *       http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,6 +25,7 @@
 
 #include "tcuDefs.hpp"
 #include "eglwDefs.hpp"
+#include "eglwEnums.hpp"
 
 namespace eglw
 {
@@ -37,6 +38,7 @@ namespace eglu
 class ConfigInfo
 {
 public:
+       // Core attributes
        deInt32                 bufferSize;
        deInt32                 redSize;
        deInt32                 greenSize;
@@ -69,45 +71,62 @@ public:
        deInt32                 transparentGreenValue;
        deInt32                 transparentBlueValue;
 
+       // Extension attributes - set by queryExtConfigInfo()
+
+       // EGL_EXT_yuv_surface
+       deUint32                yuvOrder;
+       deInt32                 yuvNumberOfPlanes;
+       deUint32                yuvSubsample;
+       deUint32                yuvDepthRange;
+       deUint32                yuvCscStandard;
+       deInt32                 yuvPlaneBpp;
+
        ConfigInfo (void)
-               : bufferSize            (0)
-               , redSize               (0)
-               , greenSize             (0)
-               , blueSize              (0)
-               , luminanceSize         (0)
-               , alphaSize             (0)
-               , alphaMaskSize         (0)
-               , bindToTextureRGB      (0)
-               , bindToTextureRGBA     (0)
-               , colorBufferType       (0)
-               , configCaveat          (0)
-               , configId              (0)
-               , conformant            (0)
-               , depthSize             (0)
-               , level                 (0)
-               , maxPbufferWidth       (0)
-               , maxPbufferHeight      (0)
-               , maxSwapInterval       (0)
-               , minSwapInterval       (0)
-               , nativeRenderable      (0)
-               , nativeVisualId        (0)
-               , nativeVisualType      (0)
-               , renderableType        (0)
-               , sampleBuffers         (0)
-               , samples               (0)
-               , stencilSize           (0)
-               , surfaceType           (0)
-               , transparentType       (0)
-               , transparentRedValue   (0)
-               , transparentGreenValue (0)
-               , transparentBlueValue  (0)
+               : bufferSize                    (0)
+               , redSize                               (0)
+               , greenSize                             (0)
+               , blueSize                              (0)
+               , luminanceSize                 (0)
+               , alphaSize                             (0)
+               , alphaMaskSize                 (0)
+               , bindToTextureRGB              (0)
+               , bindToTextureRGBA             (0)
+               , colorBufferType               (0)
+               , configCaveat                  (0)
+               , configId                              (0)
+               , conformant                    (0)
+               , depthSize                             (0)
+               , level                                 (0)
+               , maxPbufferWidth               (0)
+               , maxPbufferHeight              (0)
+               , maxSwapInterval               (0)
+               , minSwapInterval               (0)
+               , nativeRenderable              (0)
+               , nativeVisualId                (0)
+               , nativeVisualType              (0)
+               , renderableType                (0)
+               , sampleBuffers                 (0)
+               , samples                               (0)
+               , stencilSize                   (0)
+               , surfaceType                   (0)
+               , transparentType               (0)
+               , transparentRedValue   (0)
+               , transparentGreenValue (0)
+               , transparentBlueValue  (0)
+               , yuvOrder                              (EGL_NONE)
+               , yuvNumberOfPlanes             (0)
+               , yuvSubsample                  (EGL_NONE)
+               , yuvDepthRange                 (EGL_NONE)
+               , yuvCscStandard                (EGL_NONE)
+               , yuvPlaneBpp                   (EGL_YUV_PLANE_BPP_0_EXT)
        {
        }
 
        deInt32 getAttribute (deUint32 attribute) const;
 };
 
-void   queryConfigInfo         (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst);
+void   queryCoreConfigInfo     (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst);
+void   queryExtConfigInfo      (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst);
 
 } // eglu
 
index 51d8a54..297a00c 100644 (file)
@@ -132,6 +132,33 @@ const char* getSurfaceAttribName (int value)
        }
 }
 
+const char* getYuvOrderName (int value)
+{
+       switch (value)
+       {
+               case EGL_NONE:                                  return "EGL_NONE";
+               case EGL_YUV_ORDER_YUV_EXT:             return "EGL_YUV_ORDER_YUV_EXT";
+               case EGL_YUV_ORDER_YVU_EXT:             return "EGL_YUV_ORDER_YVU_EXT";
+               case EGL_YUV_ORDER_YUYV_EXT:    return "EGL_YUV_ORDER_YUYV_EXT";
+               case EGL_YUV_ORDER_UYVY_EXT:    return "EGL_YUV_ORDER_UYVY_EXT";
+               case EGL_YUV_ORDER_YVYU_EXT:    return "EGL_YUV_ORDER_YVYU_EXT";
+               case EGL_YUV_ORDER_VYUY_EXT:    return "EGL_YUV_ORDER_VYUY_EXT";
+               case EGL_YUV_ORDER_AYUV_EXT:    return "EGL_YUV_ORDER_AYUV_EXT";
+               default:                                                return DE_NULL;
+       }
+}
+
+const char* getYuvPlaneBppName (int value)
+{
+       switch (value)
+       {
+               case EGL_YUV_PLANE_BPP_0_EXT:   return "EGL_YUV_PLANE_BPP_0_EXT";
+               case EGL_YUV_PLANE_BPP_8_EXT:   return "EGL_YUV_PLANE_BPP_8_EXT";
+               case EGL_YUV_PLANE_BPP_10_EXT:  return "EGL_YUV_PLANE_BPP_10_EXT";
+               default:                                                return DE_NULL;
+       }
+}
+
 const char* getSurfaceTargetName (int value)
 {
        switch (value)
index f8620ec..fc2093f 100644 (file)
@@ -10,6 +10,8 @@ const char*                                                   getErrorName                            (int value);
 const char*                                                    getContextAttribName            (int value);
 const char*                                                    getConfigAttribName                     (int value);
 const char*                                                    getSurfaceAttribName            (int value);
+const char*                                                    getYuvOrderName                         (int value);
+const char*                                                    getYuvPlaneBppName                      (int value);
 const char*                                                    getSurfaceTargetName            (int value);
 const char*                                                    getColorBufferTypeName          (int value);
 const char*                                                    getConfigCaveatName                     (int value);
@@ -30,6 +32,8 @@ inline tcu::Format::Enum<int, 2>      getErrorStr                                     (int value)             { return tcu::Form
 inline tcu::Format::Enum<int, 2>       getContextAttribStr                     (int value)             { return tcu::Format::Enum<int, 2>(getContextAttribName, value); }
 inline tcu::Format::Enum<int, 2>       getConfigAttribStr                      (int value)             { return tcu::Format::Enum<int, 2>(getConfigAttribName, value); }
 inline tcu::Format::Enum<int, 2>       getSurfaceAttribStr                     (int value)             { return tcu::Format::Enum<int, 2>(getSurfaceAttribName, value); }
+inline tcu::Format::Enum<int, 2>       getYuvOrderStr                          (int value)             { return tcu::Format::Enum<int, 2>(getYuvOrderName, value); }
+inline tcu::Format::Enum<int, 2>       getYuvPlaneBppStr                       (int value)             { return tcu::Format::Enum<int, 2>(getYuvPlaneBppName, value); }
 inline tcu::Format::Enum<int, 2>       getSurfaceTargetStr                     (int value)             { return tcu::Format::Enum<int, 2>(getSurfaceTargetName, value); }
 inline tcu::Format::Enum<int, 2>       getColorBufferTypeStr           (int value)             { return tcu::Format::Enum<int, 2>(getColorBufferTypeName, value); }
 inline tcu::Format::Enum<int, 2>       getConfigCaveatStr                      (int value)             { return tcu::Format::Enum<int, 2>(getConfigCaveatName, value); }
index 8dfbef5..50a2769 100644 (file)
@@ -29,6 +29,8 @@
 #include "eglwLibrary.hpp"
 #include "eglwEnums.hpp"
 
+#include "deSTLUtil.hpp"
+
 #include <algorithm>
 #include <vector>
 #include <map>
@@ -111,6 +113,35 @@ private:
                }
        }
 
+       static int getYuvOrderRank (EGLenum order)
+       {
+               switch (order)
+               {
+                       case EGL_NONE:                                  return 0;
+                       case EGL_YUV_ORDER_YUV_EXT:             return 1;
+                       case EGL_YUV_ORDER_YVU_EXT:             return 2;
+                       case EGL_YUV_ORDER_YUYV_EXT:    return 3;
+                       case EGL_YUV_ORDER_YVYU_EXT:    return 4;
+                       case EGL_YUV_ORDER_UYVY_EXT:    return 5;
+                       case EGL_YUV_ORDER_VYUY_EXT:    return 6;
+                       case EGL_YUV_ORDER_AYUV_EXT:    return 7;
+                       default:
+                               TCU_THROW(TestError, (std::string("Unknown YUV order: ") + eglu::getYuvOrderStr(order).toString()).c_str());
+               }
+       }
+
+       static int getYuvPlaneBppValue (EGLenum bpp)
+       {
+               switch (bpp)
+               {
+                       case EGL_YUV_PLANE_BPP_0_EXT:   return 0;
+                       case EGL_YUV_PLANE_BPP_8_EXT:   return 8;
+                       case EGL_YUV_PLANE_BPP_10_EXT:  return 10;
+                       default:
+                               TCU_THROW(TestError, (std::string("Unknown YUV plane BPP: ") + eglu::getYuvPlaneBppStr(bpp).toString()).c_str());
+               }
+       }
+
        typedef bool (*CompareFunc) (const SurfaceConfig& a, const SurfaceConfig& b);
 
        static bool compareCaveat (const SurfaceConfig& a, const SurfaceConfig& b)
@@ -123,7 +154,12 @@ private:
                return getColorBufferTypeRank((EGLenum)a.m_info.colorBufferType) < getColorBufferTypeRank((EGLenum)b.m_info.colorBufferType);
        }
 
-       static bool compareColorBufferBits (const SurfaceConfig& a, const SurfaceConfig& b, const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors)
+       static bool compareYuvOrder (const SurfaceConfig& a, const SurfaceConfig& b)
+       {
+               return getYuvOrderRank((EGLenum)a.m_info.yuvOrder) < getYuvOrderRank((EGLenum)b.m_info.yuvOrder);
+       }
+
+       static bool compareColorBufferBits (const SurfaceConfig& a, const SurfaceConfig& b, const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors, bool yuvPlaneBppSpecified)
        {
                DE_ASSERT(a.m_info.colorBufferType == b.m_info.colorBufferType);
                switch (a.m_info.colorBufferType)
@@ -144,8 +180,7 @@ private:
                        }
 
                        case EGL_YUV_BUFFER_EXT:
-                               // \todo [mika 2015-05-05] Sort YUV configs correctly. Currently all YUV configs are non-conformant and ordering can be relaxed.
-                               return true;
+                               return yuvPlaneBppSpecified ? (a.m_info.yuvPlaneBpp > b.m_info.yuvPlaneBpp) : false;
 
                        default:
                                DE_ASSERT(DE_FALSE);
@@ -177,7 +212,9 @@ public:
 
        friend bool operator== (const SurfaceConfig& a, const SurfaceConfig& b)
        {
-               for (std::map<EGLenum, AttribRule>::const_iterator iter = SurfaceConfig::defaultRules.begin(); iter != SurfaceConfig::defaultRules.end(); iter++)
+               const std::map<EGLenum, AttribRule> defaultRules = getDefaultRules();
+
+               for (std::map<EGLenum, AttribRule>::const_iterator iter = defaultRules.begin(); iter != defaultRules.end(); iter++)
                {
                        const EGLenum attribute = iter->first;
 
@@ -186,7 +223,7 @@ public:
                return true;
        }
 
-       bool compareTo (const SurfaceConfig& b, const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors) const
+       bool compareTo (const SurfaceConfig& b, const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors, bool yuvPlaneBppSpecified) const
        {
                static const SurfaceConfig::CompareFunc compareFuncs[] =
                {
@@ -199,6 +236,7 @@ public:
                        SurfaceConfig::compareAttributeSmaller<EGL_DEPTH_SIZE>,
                        SurfaceConfig::compareAttributeSmaller<EGL_STENCIL_SIZE>,
                        SurfaceConfig::compareAttributeSmaller<EGL_ALPHA_MASK_SIZE>,
+                       SurfaceConfig::compareYuvOrder,
                        SurfaceConfig::compareAttributeSmaller<EGL_CONFIG_ID>
                };
 
@@ -209,9 +247,9 @@ public:
                {
                        if (!compareFuncs[ndx])
                        {
-                               if (compareColorBufferBits(*this, b, specifiedRGBColors, specifiedLuminanceColors))
+                               if (compareColorBufferBits(*this, b, specifiedRGBColors, specifiedLuminanceColors, yuvPlaneBppSpecified))
                                        return true;
-                               else if (compareColorBufferBits(b, *this, specifiedRGBColors, specifiedLuminanceColors))
+                               else if (compareColorBufferBits(b, *this, specifiedRGBColors, specifiedLuminanceColors, yuvPlaneBppSpecified))
                                        return false;
 
                                continue;
@@ -226,9 +264,7 @@ public:
                TCU_FAIL("Unable to compare configs - duplicate ID?");
        }
 
-       static const std::map<EGLenum, AttribRule> defaultRules;
-
-       static std::map<EGLenum, AttribRule> initAttribRules (void)
+       static std::map<EGLenum, AttribRule> getDefaultRules (void)
        {
                // \todo [2011-03-24 pyry] From EGL 1.4 spec - check that this is valid for other versions as well
                std::map<EGLenum, AttribRule> rules;
@@ -263,6 +299,14 @@ public:
                rules[EGL_TRANSPARENT_GREEN_VALUE]      = AttribRule(EGL_TRANSPARENT_GREEN_VALUE,       EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
                rules[EGL_TRANSPARENT_BLUE_VALUE]       = AttribRule(EGL_TRANSPARENT_BLUE_VALUE,        EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
 
+               // EGL_EXT_yuv_surface
+               rules[EGL_YUV_ORDER_EXT]                        = AttribRule(EGL_YUV_ORDER_EXT,                         EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_SPECIAL);
+               rules[EGL_YUV_NUMBER_OF_PLANES_EXT]     = AttribRule(EGL_YUV_NUMBER_OF_PLANES_EXT,      EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
+               rules[EGL_YUV_SUBSAMPLE_EXT]            = AttribRule(EGL_YUV_SUBSAMPLE_EXT,                     EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
+               rules[EGL_YUV_DEPTH_RANGE_EXT]          = AttribRule(EGL_YUV_DEPTH_RANGE_EXT,           EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
+               rules[EGL_YUV_CSC_STANDARD_EXT]         = AttribRule(EGL_YUV_CSC_STANDARD_EXT,          EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
+               rules[EGL_YUV_PLANE_BPP_EXT]            = AttribRule(EGL_YUV_PLANE_BPP_EXT,                     EGL_DONT_CARE,          CRITERIA_AT_LEAST,      SORTORDER_SPECIAL);     //      3
+
                return rules;
        }
 private:
@@ -270,25 +314,25 @@ private:
        ConfigInfo m_info;
 };
 
-const std::map<EGLenum, AttribRule> SurfaceConfig::defaultRules = SurfaceConfig::initAttribRules();
-
 class CompareConfigs
 {
 public:
-       CompareConfigs (const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors)
+       CompareConfigs (const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors, bool yuvPlaneBppSpecified)
                : m_specifiedRGBColors                  (specifiedRGBColors)
                , m_specifiedLuminanceColors    (specifiedLuminanceColors)
+               , m_yuvPlaneBppSpecified                (yuvPlaneBppSpecified)
        {
        }
 
        bool operator() (const SurfaceConfig& a, const SurfaceConfig& b)
        {
-               return a.compareTo(b, m_specifiedRGBColors, m_specifiedLuminanceColors);
+               return a.compareTo(b, m_specifiedRGBColors, m_specifiedLuminanceColors, m_yuvPlaneBppSpecified);
        }
 
 private:
        const tcu::BVec4        m_specifiedRGBColors;
        const tcu::BVec2        m_specifiedLuminanceColors;
+       const bool                      m_yuvPlaneBppSpecified;
 };
 
 class ConfigFilter
@@ -297,13 +341,13 @@ private:
        std::map<EGLenum, AttribRule> m_rules;
 public:
        ConfigFilter ()
-               : m_rules(SurfaceConfig::defaultRules)
+               : m_rules(SurfaceConfig::getDefaultRules())
        {
        }
 
        void setValue (EGLenum name, EGLint value)
        {
-               DE_ASSERT(SurfaceConfig::defaultRules.find(name) != SurfaceConfig::defaultRules.end());
+               DE_ASSERT(de::contains(m_rules, name));
                m_rules[name].value = value;
        }
 
@@ -318,13 +362,13 @@ public:
                }
        }
 
-       AttribRule getAttribute (EGLenum name)
+       AttribRule getAttribute (EGLenum name) const
        {
-               DE_ASSERT(SurfaceConfig::defaultRules.find(name) != SurfaceConfig::defaultRules.end());
-               return m_rules[name];
+               DE_ASSERT(de::contains(m_rules, name));
+               return m_rules.find(name)->second;
        }
 
-       bool isMatch (const SurfaceConfig& config)
+       bool isMatch (const SurfaceConfig& config) const
        {
                for (std::map<EGLenum, AttribRule>::const_iterator iter = m_rules.begin(); iter != m_rules.end(); iter++)
                {
@@ -366,7 +410,7 @@ public:
                return true;
        }
 
-       tcu::BVec4 getSpecifiedRGBColors (void)
+       tcu::BVec4 getSpecifiedRGBColors (void) const
        {
                const EGLenum bitAttribs[] =
                {
@@ -392,7 +436,7 @@ public:
                return result;
        }
 
-       tcu::BVec2 getSpecifiedLuminanceColors (void)
+       tcu::BVec2 getSpecifiedLuminanceColors (void) const
        {
                const EGLenum bitAttribs[] =
                {
@@ -416,7 +460,15 @@ public:
                return result;
        }
 
-       std::vector<SurfaceConfig> filter (const std::vector<SurfaceConfig>& configs)
+       bool isYuvPlaneBppSpecified (void) const
+       {
+               const EGLenum   attrib  = EGL_YUV_PLANE_BPP_EXT;
+               const EGLint    value   = getAttribute(attrib).value;
+
+               return (value != 0) && (value != EGL_DONT_CARE);
+       }
+
+       std::vector<SurfaceConfig> filter (const std::vector<SurfaceConfig>& configs) const
        {
                std::vector<SurfaceConfig> out;
 
@@ -434,11 +486,15 @@ void chooseConfigReference (const Library& egl, EGLDisplay display, std::vector<
        // Get all configs
        std::vector<EGLConfig> eglConfigs = eglu::getConfigs(egl, display);
 
-       // Config infos
+       // Config infos - including extension attributes
        std::vector<ConfigInfo> configInfos;
        configInfos.resize(eglConfigs.size());
+
        for (size_t ndx = 0; ndx < eglConfigs.size(); ndx++)
-               eglu::queryConfigInfo(egl, display, eglConfigs[ndx], &configInfos[ndx]);
+       {
+               eglu::queryCoreConfigInfo(egl, display, eglConfigs[ndx], &configInfos[ndx]);
+               eglu::queryExtConfigInfo(egl, display, eglConfigs[ndx], &configInfos[ndx]);
+       }
 
        // Pair configs with info
        std::vector<SurfaceConfig> configs;
@@ -452,7 +508,7 @@ void chooseConfigReference (const Library& egl, EGLDisplay display, std::vector<
        std::vector<SurfaceConfig> filteredConfigs = configFilter.filter(configs);
 
        // Sort configs
-       std::sort(filteredConfigs.begin(), filteredConfigs.end(), CompareConfigs(configFilter.getSpecifiedRGBColors(), configFilter.getSpecifiedLuminanceColors()));
+       std::sort(filteredConfigs.begin(), filteredConfigs.end(), CompareConfigs(configFilter.getSpecifiedRGBColors(), configFilter.getSpecifiedLuminanceColors(), configFilter.isYuvPlaneBppSpecified()));
 
        // Write to dst list
        dst.resize(filteredConfigs.size());
index be44395..3815818 100644 (file)
@@ -309,7 +309,7 @@ public:
                const eglu::NativeWindowFactory&        windowFactory   = eglu::selectNativeWindowFactory(m_eglTestCtx.getNativeDisplayFactory(), m_testCtx.getCommandLine());
                ConfigInfo                                                      info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating window surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
@@ -340,7 +340,7 @@ public:
                const eglu::NativePixmapFactory&        pixmapFactory   = eglu::selectNativePixmapFactory(m_eglTestCtx.getNativeDisplayFactory(), m_testCtx.getCommandLine());
                ConfigInfo                                                      info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating pixmap surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
@@ -370,7 +370,7 @@ public:
                int                             height  = 64;
                ConfigInfo              info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating pbuffer surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
@@ -582,7 +582,7 @@ public:
                const eglu::NativeWindowFactory&        windowFactory   = eglu::selectNativeWindowFactory(m_eglTestCtx.getNativeDisplayFactory(), m_testCtx.getCommandLine());
                ConfigInfo                                                      info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating window surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
@@ -611,7 +611,7 @@ public:
                const eglu::NativePixmapFactory&        pixmapFactory   = eglu::selectNativePixmapFactory(m_eglTestCtx.getNativeDisplayFactory(), m_testCtx.getCommandLine());
                ConfigInfo                                                      info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating pixmap surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
@@ -639,7 +639,7 @@ public:
                int                             height  = 64;
                ConfigInfo              info;
 
-               eglu::queryConfigInfo(egl, display, config, &info);
+               eglu::queryCoreConfigInfo(egl, display, config, &info);
 
                log << TestLog::Message << "Creating pbuffer surface with config ID " << info.configId << TestLog::EndMessage;
                EGLU_CHECK_MSG(egl, "before queries");
index d00fe45..4372932 100644 (file)
@@ -126,6 +126,21 @@ ENUM_GROUPS = [
                "ALPHA_FORMAT",
                "COLORSPACE"
                ]),
+       ("YuvOrder", [
+               "NONE",
+               "YUV_ORDER_YUV_EXT",
+               "YUV_ORDER_YVU_EXT",
+               "YUV_ORDER_YUYV_EXT",
+               "YUV_ORDER_UYVY_EXT",
+               "YUV_ORDER_YVYU_EXT",
+               "YUV_ORDER_VYUY_EXT",
+               "YUV_ORDER_AYUV_EXT",
+               ]),
+       ("YuvPlaneBpp", [
+               "YUV_PLANE_BPP_0_EXT",
+               "YUV_PLANE_BPP_8_EXT",
+               "YUV_PLANE_BPP_10_EXT",
+               ]),
        ("SurfaceTarget",               ["READ", "DRAW"]),
 
        # ConfigAttrib values