From cace3463a358721247a057ebb97d06be6fb2d996 Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Thu, 18 Jan 2018 13:59:57 +0100 Subject: [PATCH] Fix ES2 cube map GL_LINEAR_* filtering tests When ES2 context is created on ES3 compatible hardware seamless sampler should be used during cube map filtering test result verification. Components: OpenGL VK-GL-CTS issue: 284 Affects: dEQP-GLES2.functional.texture.mipmap.cube.* Change-Id: I442429ca2e1c368bd2dba0948923034b8a3e54be --- modules/gles2/functional/es2fTextureMipmapTests.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/gles2/functional/es2fTextureMipmapTests.cpp b/modules/gles2/functional/es2fTextureMipmapTests.cpp index cc65e5d..56ca396 100644 --- a/modules/gles2/functional/es2fTextureMipmapTests.cpp +++ b/modules/gles2/functional/es2fTextureMipmapTests.cpp @@ -600,6 +600,14 @@ TextureCubeMipmapCase::IterateResult TextureCubeMipmapCase::iterate (void) if (viewport.width < defViewportWidth/2 || viewport.height < defViewportHeight/2) throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__); + // Detect compatible GLES context by querying GL_MAJOR_VERSION. + // This query does not exist on GLES2 so succeeding query implies GLES3+ context. + bool isES3Compatible = false; + glw::GLint majorVersion = 0; + gl.getIntegerv(GL_MAJOR_VERSION, &majorVersion); + if (gl.getError() == GL_NO_ERROR) + isES3Compatible = true; + // Upload texture data. m_texture->upload(); @@ -674,7 +682,7 @@ TextureCubeMipmapCase::IterateResult TextureCubeMipmapCase::iterate (void) // Params for rendering reference params.sampler = glu::mapGLSampler(m_wrapS, m_wrapT, m_minFilter, magFilter); - params.sampler.seamlessCubeMap = false; + params.sampler.seamlessCubeMap = isES3Compatible; params.lodMode = LODMODE_EXACT; // Comparison parameters @@ -683,7 +691,8 @@ TextureCubeMipmapCase::IterateResult TextureCubeMipmapCase::iterate (void) lookupPrec.coordBits = isProjected ? tcu::IVec3(8) : tcu::IVec3(10); lookupPrec.uvwBits = tcu::IVec3(5,5,0); lodPrec.derivateBits = 10; - lodPrec.lodBits = isProjected ? 4 : 6; + lodPrec.lodBits = isES3Compatible ? 3 : 4; + lodPrec.lodBits = isProjected ? lodPrec.lodBits : 6; for (int cellNdx = 0; cellNdx < (int)gridLayout.size(); cellNdx++) { -- 2.7.4