<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - dEQP rgba8888d32s8 FBO mode doesn't work"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94455#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - dEQP rgba8888d32s8 FBO mode doesn't work"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94455">bug 94455</a>
              from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
        <pre>It seems that the cause of this is a bug in dEQP, that confuses the number of
bits in the stencil buffer with the number of bits in the depth buffer when it
renders the reference image.

Specifically, the test passes the depthBits where it should be passing
stencilBits (so 32 where it should be using 8). As result, when it uses the
number of stencil bits here:

int maskedVal = clear.stencil & ((1<<stencilBits)-1);

The result of ((1<<stencilBits)-1) overflows and causes incorrect result in
maskedVal (the value to clear the stencil buffer to). For values of stencilBits
that do not cause overflow (so 24, 16 or 8), the result of the AND operation
leads to the same result as if we passed the correct number of stencil bits.
That explains why the test only fails when we have 32b depth and stencil > 0b.

This patch to dEQP fixes the specific test case mentioned in the bug report and
should fix others as well:

diff --git a/modules/gles2/functional/es2fDepthStencilTests.cpp
b/modules/gles2/functional/es2fDepthStencilTests.cpp
index 793c7a3..eacda9e 100644
--- a/modules/gles2/functional/es2fDepthStencilTests.cpp
+++ b/modules/gles2/functional/es2fDepthStencilTests.cpp
@@ -669,7 +669,7 @@ DepthStencilCase::IterateResult DepthStencilCase::iterate
(void)
                translateCommand(testCmd, refTestCmd, m_renderTarget);

                // Base clears.
-               renderReference(m_baseClears, m_refColorBuffer->getAccess(),
m_refStencilBuffer->getAccess(), m_renderTarget.depthBits);
+               renderReference(m_baseClears, m_refColorBuffer->getAccess(),
m_refStencilBuffer->getAccess(), m_renderTarget.stencilBits);

                // Base depths.
                for (vector<RefRenderCommand>::const_iterator cmd =
m_refBaseDepthRenders.begin(); cmd != m_refBaseDepthRenders.end(); ++cmd)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>