Disable coherent blending in non-coherent blend tests.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 5 Feb 2015 20:39:16 +0000 (12:39 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Tue, 10 Feb 2015 21:31:05 +0000 (13:31 -0800)
Bug: 19283100
Change-Id: Idd464d9e107d4390bb009cab5325f998816b4927

modules/gles31/functional/es31fAdvancedBlendTests.cpp

index aed9395..f005f61 100644 (file)
@@ -104,6 +104,8 @@ private:
        const RenderTargetType  m_rtType;
        const int                               m_numIters;
 
+       bool                                    m_coherentExtensionSupported;
+
        deUint32                                m_colorRbo;
        deUint32                                m_fbo;
 
@@ -224,6 +226,8 @@ void AdvancedBlendCase::init (void)
        DE_ASSERT(!m_referenceRenderer);
        DE_ASSERT(!m_refColorBuffer);
 
+       m_coherentExtensionSupported = m_context.getContextInfo().isExtensionSupported("GL_KHR_blend_equation_advanced_coherent");
+
        m_program = new glu::ShaderProgram(m_context.getRenderContext(), getBlendProgramSrc(sglr::rr_util::mapGLBlendEquationAdvanced(m_blendMode)));
        m_testCtx.getLog() << *m_program;
 
@@ -414,8 +418,12 @@ AdvancedBlendCase::IterateResult AdvancedBlendCase::iterate (void)
                gl.useProgram(program);
                gl.viewport(viewportX, viewportY, m_viewportWidth, m_viewportHeight);
                gl.blendEquation(m_blendMode);
+
+               // \note coherent extension enables GL_BLEND_ADVANCED_COHERENT_KHR by default
                if (m_coherentBlending)
                        gl.enable(GL_BLEND_ADVANCED_COHERENT_KHR);
+               else if (m_coherentExtensionSupported)
+                       gl.disable(GL_BLEND_ADVANCED_COHERENT_KHR);
 
                GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to set render state");