Add blend barrier after first opaque quad
authorPyry Haulos <phaulos@google.com>
Thu, 23 Oct 2014 20:58:13 +0000 (13:58 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 23 Oct 2014 20:58:13 +0000 (13:58 -0700)
Advanced blending tests were missing barrier between first opaque quad
and subsequent blended quads. This change adds BlendBarrier() call if
coherent blending is not enabled.

This change also adds fullscreen clear before rendering as framework
doesn't perform that in GLES31 module.

Bug: 18100652
Change-Id: Idd16f2fde543af885e97adf5b5c2123d7e803152

modules/gles31/functional/es31fAdvancedBlendTests.cpp

index dcde00f..aed9395 100644 (file)
@@ -419,10 +419,15 @@ AdvancedBlendCase::IterateResult AdvancedBlendCase::iterate (void)
 
                GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to set render state");
 
+               gl.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
+
                gl.disable(GL_BLEND);
                gl.drawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, DE_NULL);
                gl.enable(GL_BLEND);
 
+               if (!m_coherentBlending)
+                       gl.blendBarrierKHR();
+
                if (m_coherentBlending)
                {
                        gl.drawElements(GL_TRIANGLES, 6*(numQuads-1), GL_UNSIGNED_SHORT, (const void*)(deUintptr)(6*sizeof(deUint16)));