[Mesa-dev] [PATCH 3/3] mesa: call DrawBufferAllocate driver hook in update_framebuffer for windows-system FB

Marek Olšák maraeo at gmail.com
Tue Apr 24 22:31:32 UTC 2018


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Apr 24, 2018 at 12:54 AM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:

> From: Boyan Ding <boyan.j.ding at gmail.com>
>
> When draw buffers are changed on a bound framebuffer, DrawBufferAllocate()
> hook should be called. However, it is missing in update_framebuffer with
> window-system framebuffer, in which FB's draw buffer state should match
> context state, potentially resulting in a change.
>
> Note: This is needed because gallium delays creating the front buffer,
>       i965 works fine without this change.
>
> V2 (Timothy Arceri):
>  - Rebased on merged/simplified DrawBuffer driver function
>  - Move DrawBuffer call outside fb->ColorDrawBuffer[0] !=
>    ctx->Color.DrawBuffer[0] check to make piglit pass.
>
> v3 (Timothy Arceri):
>  - Call new DrawBuffaerAllocate() driver function.
>
> Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de> (v2)
> Reviewed-by: Brian Paul <brianp at vmware.com> (v2)
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99116
> ---
>  src/mesa/main/framebuffer.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index 211e97c33bd..4ea18f6858e 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -617,6 +617,12 @@ update_framebuffer(struct gl_context *ctx, struct
> gl_framebuffer *fb)
>           _mesa_drawbuffers(ctx, fb, ctx->Const.MaxDrawBuffers,
>                             ctx->Color.DrawBuffer, NULL);
>        }
> +
> +      /* Call device driver function if fb is the bound draw buffer. */
> +      if (fb == ctx->DrawBuffer) {
> +         if (ctx->Driver.DrawBufferAllocate)
> +            ctx->Driver.DrawBufferAllocate(ctx);
> +      }
>     }
>     else {
>        /* This is a user-created framebuffer.
> --
> 2.17.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180424/b0d489fa/attachment.html>


More information about the mesa-dev mailing list