Support GL 4.5 in the GetTexLevelParameter tests
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 7 Jan 2021 10:50:49 +0000 (11:50 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 21 Jan 2021 08:37:39 +0000 (08:37 +0000)
Affects:
dEQP-GLES31.functional.state_query.texture_level.*
dEQP-GL45.functional.state_query.texture_level.*

Components: AOSP

Change-Id: I9b469695a35a3329bfb09fd06ac86d745e7f2e41

modules/gles31/functional/es31fTextureLevelStateQueryTests.cpp

index b7d9fcf4ceca493c1bc25fecd0091283c26d218b..8ab46a8b2b0fa3dd758a1a02a1fd468615f083b9 100644 (file)
@@ -111,7 +111,8 @@ static bool isCoreTextureTarget (glw::GLenum target, const glu::ContextType& con
                case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
                case GL_TEXTURE_BUFFER:
                case GL_TEXTURE_CUBE_MAP_ARRAY:
-                       return glu::contextSupports(contextType, glu::ApiType::es(3, 2));
+                       return glu::contextSupports(contextType, glu::ApiType::es(3, 2)) ||
+                                  glu::contextSupports(contextType, glu::ApiType::core(4, 5));
 
                default:
                        return false;
@@ -1491,6 +1492,14 @@ private:
        }
 };
 
+static bool checkSupport(Context& ctx)
+{
+       auto ctxType = ctx.getRenderContext().getType();
+       return contextSupports(ctxType, glu::ApiType::es(3, 2)) ||
+                  contextSupports(ctxType, glu::ApiType::core(4, 5)) ||
+                  ctx.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer");
+}
+
 class TextureLevelBufferDataStoreCase : public TextureLevelCase
 {
 public:
@@ -1502,8 +1511,7 @@ public:
 private:
        void init (void)
        {
-               if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer") &&
-                       !glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
+               if (!checkSupport(m_context))
                        throw tcu::NotSupportedError("Test requires GL_EXT_texture_buffer extension");
                TextureLevelCase::init();
        }
@@ -1541,8 +1549,7 @@ public:
 private:
        void init (void)
        {
-               if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer") &&
-                       !glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
+               if (!checkSupport(m_context))
                        throw tcu::NotSupportedError("Test requires GL_EXT_texture_buffer extension");
                TextureLevelCase::init();
        }
@@ -1582,8 +1589,7 @@ public:
 private:
        void init (void)
        {
-               if (!m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer") &&
-                       !glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
+               if (!checkSupport(m_context))
                        throw tcu::NotSupportedError("Test requires GL_EXT_texture_buffer extension");
                TextureLevelCase::init();
        }