<div dir="ltr"><div>For the series:<br></div><div><br>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 24, 2018 at 12:54 AM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Boyan Ding <<a href="mailto:boyan.j.ding@gmail.com">boyan.j.ding@gmail.com</a>><br>
<br>
When draw buffers are changed on a bound framebuffer, DrawBufferAllocate()<br>
hook 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>
Note: This is needed because gallium delays creating the front buffer,<br>
i965 works fine without this change.<br>
<br>
V2 (Timothy Arceri):<br>
- Rebased on merged/simplified DrawBuffer driver function<br>
- Move DrawBuffer call outside fb->ColorDrawBuffer[0] !=<br>
ctx->Color.DrawBuffer[0] check to make piglit pass.<br>
<br>
v3 (Timothy Arceri):<br>
- Call new DrawBuffaerAllocate() driver function.<br>
<br>
Tested-by: Dieter Nützel <<a href="mailto:Dieter@nuetzel-hh.de">Dieter@nuetzel-hh.de</a>> (v2)<br>
Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>> (v2)<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>
---<br>
src/mesa/main/framebuffer.c | 6 ++++++<br>
1 file changed, 6 insertions(+)<br>
<br>
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c<br>
index 211e97c33bd..4ea18f6858e 100644<br>
--- a/src/mesa/main/framebuffer.c<br>
+++ b/src/mesa/main/framebuffer.c<br>
@@ -617,6 +617,12 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)<br>
_mesa_drawbuffers(ctx, fb, ctx->Const.MaxDrawBuffers,<br>
ctx->Color.DrawBuffer, NULL);<br>
}<br>
+<br>
+ /* Call device driver function if fb is the bound draw buffer. */<br>
+ if (fb == ctx->DrawBuffer) {<br>
+ if (ctx->Driver.<wbr>DrawBufferAllocate)<br>
+ ctx->Driver.<wbr>DrawBufferAllocate(ctx);<br>
+ }<br>
}<br>
else {<br>
/* This is a user-created framebuffer.<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.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>