Support GL 4.5 in the textureGather tests
authorAlexander Galazin <alexander.galazin@arm.com>
Fri, 5 Feb 2021 09:32:51 +0000 (10:32 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 19 Feb 2021 08:09:55 +0000 (08:09 +0000)
Componets: AOSP

Affecsts:
dEQP-GLES31.functional.texture.gather.*
dEQP-GL45.functional.texture.gather.*

Change-Id: Iea0cc9400bf3f6d10a0725ec28e68f742ad50ea6

modules/gles31/functional/es31fTextureGatherTests.cpp

index d096d4d..a202ce0 100644 (file)
@@ -85,7 +85,8 @@ static std::string specializeShader(Context& context, const char* code)
 
        specializationMap["GLSL_VERSION_DECL"] = glu::getGLSLVersionDeclaration(glslVersion);
 
-       if (glu::contextSupports(context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
+       if (glu::contextSupports(context.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
+               glu::contextSupports(context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
                specializationMap["GPU_SHADER5_REQUIRE"] = "";
        else
                specializationMap["GPU_SHADER5_REQUIRE"] = "#extension GL_EXT_gpu_shader5 : require";
@@ -1249,14 +1250,15 @@ glu::ProgramSources TextureGatherCase::genProgramSources (GatherType                                    gatherT
 
 void TextureGatherCase::init (void)
 {
-       TestLog&                                        log                             = m_testCtx.getLog();
-       const glu::RenderContext&       renderCtx               = m_context.getRenderContext();
-       const glw::Functions&           gl                              = renderCtx.getFunctions();
-       const deUint32                          texTypeGL               = getGLTextureType(m_textureType);
-       const bool                                      supportsES32    = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2));
+       TestLog&                                        log                                     = m_testCtx.getLog();
+       const glu::RenderContext&       renderCtx                       = m_context.getRenderContext();
+       const glw::Functions&           gl                                      = renderCtx.getFunctions();
+       const deUint32                          texTypeGL                       = getGLTextureType(m_textureType);
+       const bool                                      supportsES32orGL45      = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
+                                                                                                         glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5));
 
        // Check prerequisites.
-       if (requireGpuShader5(m_gatherType) && !supportsES32 && !m_context.getContextInfo().isExtensionSupported("GL_EXT_gpu_shader5"))
+       if (requireGpuShader5(m_gatherType) && !supportsES32orGL45 && !m_context.getContextInfo().isExtensionSupported("GL_EXT_gpu_shader5"))
                throw tcu::NotSupportedError("GL_EXT_gpu_shader5 required");
 
        // Log and check implementation offset limits, if appropriate.
@@ -1269,6 +1271,9 @@ void TextureGatherCase::init (void)
                TCU_CHECK_MSG(offsetRange[1] >= SPEC_MIN_MAX_OFFSET, ("GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET must be at least " + de::toString((int)SPEC_MIN_MAX_OFFSET)).c_str());
        }
 
+       if (!isContextTypeES(m_context.getRenderContext().getType()))
+               gl.enable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
+
        // Create rbo and fbo.
 
        m_colorBuffer = MovePtr<glu::Renderbuffer>(new glu::Renderbuffer(renderCtx));
@@ -1345,6 +1350,9 @@ void TextureGatherCase::init (void)
 
 void TextureGatherCase::deinit (void)
 {
+       if (!isContextTypeES(m_context.getRenderContext().getType()))
+               m_context.getRenderContext().getFunctions().disable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
+
        m_program               = MovePtr<ShaderProgram>(DE_NULL);
        m_fbo                   = MovePtr<glu::Framebuffer>(DE_NULL);
        m_colorBuffer   = MovePtr<glu::Renderbuffer>(DE_NULL);