Merge vk-gl-cts/opengl-es-cts-3.2.6 into vk-gl-cts/opengl-es-cts-3.2.7
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 28 Jan 2021 17:23:22 +0000 (18:23 +0100)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 28 Jan 2021 17:23:22 +0000 (18:23 +0100)
Change-Id: I788189cd68e7eb8d41b1e9f110102e5b611b0a62

1  2 
external/openglcts/modules/common/glcNearestEdgeTests.cpp

@@@ -42,7 -42,6 +42,7 @@@
  #include <map>
  #include <algorithm>
  #include <memory>
 +#include <cmath>
  
  namespace glcts
  {
@@@ -146,21 -145,19 +146,19 @@@ tcu::TextureFormat NearestEdgeTestCase:
                if (pixelFormatMap[ndx].pixelFmt == pixelFmt)
                {
                        // Some implementations treat GL_RGB8 as GL_RGBA8888,so the test should pass implementation format to ReadPixels.
-                       if (pixelFmt == tcu::PixelFormat(8,8,8,0))
+                       if (pixelFmt == tcu::PixelFormat(8, 8, 8, 0))
                        {
                                const auto& gl = context.getRenderContext().getFunctions();
  
                                glw::GLint implFormat = GL_NONE;
-                               glw::GLint implType   = GL_NONE;
-                               gl.getIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT,&implFormat);
-                               gl.getIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE,&implType);
-                               if(implFormat == GL_RGBA && implType == GL_UNSIGNED_BYTE)
-                                       return tcu::TextureFormat(tcu::TextureFormat::RGBA,     tcu::TextureFormat::UNORM_INT8);
-                       }
-                       else
-                       {
-                               return pixelFormatMap[ndx].texFmt;
+                               glw::GLint implType       = GL_NONE;
+                               gl.getIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &implFormat);
+                               gl.getIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &implType);
+                               if (implFormat == GL_RGBA && implType == GL_UNSIGNED_BYTE)
+                                       return tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8);
                        }
+                       return pixelFormatMap[ndx].texFmt;
                }
        }
  
@@@ -317,9 -314,8 +315,9 @@@ void NearestEdgeTestCase::renderQuad (
  
        // Apply offset of almost half a texel to the texture coordinates.
        DE_ASSERT(m_offsetSign == 1.0f || m_offsetSign == -1.0f);
 -      const float offsetWidth         = 0.499f / static_cast<float>(m_width);
 -      const float offsetHeight        = 0.499f / static_cast<float>(m_height);
 +      const float offset                      = 0.5f - pow(2.0f, -8.0f);
 +      const float offsetWidth         = offset / static_cast<float>(m_width);
 +      const float offsetHeight        = offset / static_cast<float>(m_height);
  
        minU += m_offsetSign * offsetWidth;
        maxU += m_offsetSign * offsetWidth;
        gl.uniform1i(gl.getUniformLocation(program.getProgram(), "texSampler"), 0);
        GLU_EXPECT_NO_ERROR(gl.getError(), "glUniform1i failed");
  
-       gl.uniform1i(gl.getUniformLocation(program.getProgram(), "texOffset"),m_offsetSign);
+       gl.uniform1i(gl.getUniformLocation(program.getProgram(), "texOffset"), m_offsetSign);
        gl.uniform1f(gl.getUniformLocation(program.getProgram(), "texWidth"), float(m_width));
        gl.uniform1f(gl.getUniformLocation(program.getProgram(), "texHeight"), float(m_height));
        GLU_EXPECT_NO_ERROR(gl.getError(), "glUniform1i failed");
  
+       gl.disable(GL_DITHER);
        gl.clear(GL_COLOR_BUFFER_BIT);
  
        glu::draw(renderContext, program.getProgram(),