<div dir="ltr">This looks good to me :)<div>Reviewed-by: Plamena Manolova <<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 20, 2017 at 9:38 AM, Boyan Ding <span dir="ltr"><<a href="mailto:boyan.j.ding@gmail.com" target="_blank">boyan.j.ding@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When draw buffers are changed on a bound framebuffer, DrawBuffer(s) hook<br>
should be called. However, it is missing in update_framebuffer with<br>
window-system framebuffer, in which FB's draw buffer state should match<br>
context state, potentially resulting in a change.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=99116" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=99116</a><br>
Signed-off-by: Boyan Ding <<a href="mailto:boyan.j.ding@gmail.com">boyan.j.ding@gmail.com</a>><br>
---<br>
src/mesa/main/framebuffer.c | 10 ++++++++++<br>
1 file changed, 10 insertions(+)<br>
<br>
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c<br>
index c06130dc8d..55a6d5c004 100644<br>
--- a/src/mesa/main/framebuffer.c<br>
+++ b/src/mesa/main/framebuffer.c<br>
@@ -670,6 +670,16 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)<br>
if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) {<br>
_mesa_drawbuffers(ctx, fb, ctx->Const.MaxDrawBuffers,<br>
ctx->Color.DrawBuffer, NULL);<br>
+<br>
+ /* Call device driver function if fb is the bound draw buffer. */<br>
+ if (fb == ctx->DrawBuffer) {<br>
+ if (ctx->Driver.DrawBuffers) {<br>
+ ctx->Driver.DrawBuffers(ctx, ctx->Const.MaxDrawBuffers,<br>
+ ctx->Color.DrawBuffer);<br>
+ } else if (ctx->Driver.DrawBuffer) {<br>
+ ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]);<br>
+ }<br>
+ }<br>
}<br>
}<br>
else {<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>