<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES3.1CTS] es31-cts.draw_buffers_indexed.color_masks fails"
href="https://bugs.freedesktop.org/show_bug.cgi?id=94847#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ES3.1CTS] es31-cts.draw_buffers_indexed.color_masks fails"
href="https://bugs.freedesktop.org/show_bug.cgi?id=94847">bug 94847</a>
from <span class="vcard"><a class="email" href="mailto:kenneth@whitecape.org" title="Kenneth Graunke <kenneth@whitecape.org>"> <span class="fn">Kenneth Graunke</span></a>
</span></b>
<pre>I believe I've tracked down the problem.
The application is binding multiple draw buffers. Each draw buffer has
associated color mask and blending state. (In Mesa, ctx->Color.ColorMask[i]
corresponds to the color mask for GL_DRAW_BUFFERi.)
It then calls glClearBufferfv to clear an individual draw buffer. This is
handled by _mesa_meta_glsl_Clear (fast clears are skipped due to color
masking). In order to clear a single draw buffer,
_mesa_meta_drawbuffers_from_bitfield() calls glDrawBuffers() to try and disable
any attachments that we don't want to clear. It also leaves the color masking
in place, because it should take effect.
However, this has a problem: it binds all the same color attachments, but in a
different order. So, what was GL_DRAW_BUFFER5 will now be bound as
GL_DRAW_BUFFER0. This means that Meta uses ctx->Color.ColorMask[0] instead of
ctx->Color.ColorMask[5]...which is the wrong state.</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>