Increase threshold in ES2 frag op and buffer tests am: ce69f90677
authorPyry Haulos <phaulos@google.com>
Thu, 10 Mar 2016 20:08:32 +0000 (20:08 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 10 Mar 2016 20:08:32 +0000 (20:08 +0000)
am: eecffcfa8a

* commit 'eecffcfa8a55cd52895727f16f7487e749e9a3a8':
  Increase threshold in ES2 frag op and buffer tests

1  2 
modules/gles2/functional/es2fBufferTestUtil.cpp
modules/gles2/functional/es2fRandomFragmentOpTests.cpp

@@@ -319,10 -319,10 +319,10 @@@ static void computePositions (vector<tc
        for (int y = 0; y < gridSizeY; y++)
        for (int x = 0; x < gridSizeX; x++)
        {
 -              float   sx0                     = (x+0) / (float)gridSizeX;
 -              float   sy0                     = (y+0) / (float)gridSizeY;
 -              float   sx1                     = (x+1) / (float)gridSizeX;
 -              float   sy1                     = (y+1) / (float)gridSizeY;
 +              float   sx0                     = (float)(x+0) / (float)gridSizeX;
 +              float   sy0                     = (float)(y+0) / (float)gridSizeY;
 +              float   sx1                     = (float)(x+1) / (float)gridSizeX;
 +              float   sy1                     = (float)(y+1) / (float)gridSizeY;
                float   fx0                     = 2.0f * sx0 - 1.0f;
                float   fy0                     = 2.0f * sy0 - 1.0f;
                float   fx1                     = 2.0f * sx1 - 1.0f;
@@@ -388,8 -388,8 +388,8 @@@ static void renderQuadGridReference (tc
                for (int y = 0; y < VERIFY_QUAD_SIZE; y++)
                for (int x = 0; x < VERIFY_QUAD_SIZE; x++)
                {
 -                      float           fx              = (float)(x+0.5f) / (float)VERIFY_QUAD_SIZE;
 -                      float           fy              = (float)(y+0.5f) / (float)VERIFY_QUAD_SIZE;
 +                      float           fx              = ((float)x+0.5f) / (float)VERIFY_QUAD_SIZE;
 +                      float           fy              = ((float)y+0.5f) / (float)VERIFY_QUAD_SIZE;
  
                        bool            tri             = fx + fy <= 1.0f;
                        float           tx              = tri ? fx : (1.0f-fx);
@@@ -414,7 -414,7 +414,7 @@@ bool VertexArrayVerifier::verify (deUin
        int                                                     maxQuadsPerBatch        = maxQuadsX*maxQuadsY;
        int                                                     numVerified                     = 0;
        deUint32                                        program                         = m_program->getProgram();
-       tcu::RGBA                                       threshold                       = renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(3,3,3,3);
+       tcu::RGBA                                       threshold                       = renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(4,4,4,4);
        bool                                            isOk                            = true;
  
        vector<tcu::Vec2>                       positions;
@@@ -303,7 -303,6 +303,7 @@@ RandomFragmentOpCase::IterateResult Ran
        const int                               viewportY               = rnd.getInt(0, m_context.getRenderTarget().getHeight()-height);
  
        tcu::Surface                    renderedImg             (width, height);
 +      tcu::Surface                    referenceImg    (width, height);
  
        const Vec4                              clearColor              = CLEAR_COLOR;
        const float                             clearDepth              = CLEAR_DEPTH;
                                                          cmd->quad, refState);
        }
  
 +      // Expand reference color buffer to RGBA8
 +      copy(referenceImg.getAccess(), m_refColorBuffer->getAccess());
 +
        // Read rendered image.
        glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, renderedImg.getAccess());
  
                compareOk = tcu::bilinearCompare(m_testCtx.getLog(),
                                                                                 "CompareResult",
                                                                                 "Image Comparison Result",
 -                                                                               m_refColorBuffer->getAccess(),
 +                                                                               referenceImg.getAccess(),
                                                                                 renderedImg.getAccess(),
                                                                                 tcu::RGBA(threshold.x(), threshold.y(), threshold.z(), threshold.w()),
                                                                                 tcu::COMPARE_LOG_RESULT);
                compareOk = tcu::intThresholdCompare(m_testCtx.getLog(),
                                                                                         "CompareResult",
                                                                                         "Image Comparison Result",
 -                                                                                       m_refColorBuffer->getAccess(),
 +                                                                                       referenceImg.getAccess(),
                                                                                         renderedImg.getAccess(),
                                                                                         threshold,
                                                                                         tcu::COMPARE_LOG_RESULT);
@@@ -417,7 -413,7 +417,7 @@@ tcu::UVec4 RandomFragmentOpCase::getCom
        tcu::PixelFormat format = m_context.getRenderTarget().getPixelFormat();
  
        if (format == tcu::PixelFormat(8, 8, 8, 8) || format == tcu::PixelFormat(8, 8, 8, 0))
-               return format.getColorThreshold().toIVec().asUint() + tcu::UVec4(2); // Default threshold.
+               return format.getColorThreshold().toIVec().asUint() + tcu::UVec4(6); // Default threshold.
        else
                return format.getColorThreshold().toIVec().asUint()
                           * tcu::UVec4(5) + tcu::UVec4(2); // \note Non-scientific ad hoc formula. Need big threshold when few color bits; especially multiple blendings bring extra inaccuracy.