Fix texturecubelod test
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Thu, 1 Feb 2018 12:08:10 +0000 (13:08 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 14 Feb 2018 08:29:15 +0000 (03:29 -0500)
This patch fixes issue with validation of texturecubelod
test result. Issue happened when test was executed on ES3
capable hardware.

Components: OpenGL

VK-GL-CTS issue: 280

Affects:
dEQP-GLES2.functional.shaders.texture_functions.vertex.*

Change-Id: I92d81ca93cb84785ea806155d0436f167c4fbf31

modules/gles2/functional/es2fShaderTextureFunctionTests.cpp

index 0a8c634..6f283cc 100644 (file)
@@ -568,12 +568,20 @@ static void createCaseGroup (TestCaseGroup* parent, const char* groupName, const
 
 void ShaderTextureFunctionTests::init (void)
 {
+       const glw::Functions& gl = m_context.getRenderContext().getFunctions();
+
        // Samplers
        static const tcu::Sampler       samplerLinearNoMipmap   (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
                                                                                                                 tcu::Sampler::LINEAR, tcu::Sampler::LINEAR);
-       static const tcu::Sampler       samplerLinearMipmap             (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
+       static tcu::Sampler                     samplerLinearMipmap             (tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL,
                                                                                                                 tcu::Sampler::LINEAR_MIPMAP_NEAREST, tcu::Sampler::LINEAR);
 
+       // GL_MAJOR_VERSION query does not exist on GLES2
+       // so succeeding query implies GLES3+ hardware.
+       glw::GLint majorVersion = 0;
+       gl.getIntegerv(GL_MAJOR_VERSION, &majorVersion);
+       samplerLinearMipmap.seamlessCubeMap = (gl.getError() == GL_NO_ERROR);
+
        // Default textures.
        //                                                                                              Type                    Format          DataType                        W               H               L       Sampler
        static const TextureSpec tex2D                  (TEXTURETYPE_2D,                GL_RGBA,        GL_UNSIGNED_BYTE,       256,    256,    1,      samplerLinearNoMipmap);