[Mesa-dev] [PATCH] i965: Call intel_prepare_render() from intel_update_state()

Jason Ekstrand jason at jlekstrand.net
Mon Jun 12 04:13:23 UTC 2017


Ugh... Yeah, this is probably needed.  I've got another patch in my tree
(I'll probably send that series tomorrow) which moves all of the resolve
stuff back to brw_draw.c and not intel_update_state.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Fri, Jun 9, 2017 at 2:11 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> The resolve code looks at the current color draw buffers.  These are not
> valid until intel_prepare_render() is called.  You can end up with one
> color buffer bound, but where the renderbuffer has zero width/height and
> no miptree allocated.
>
> You can get a call chain like: _mesa_Clear -> _mesa_update_state ->
> intel_update_state, where no brw driver hooks were called, so there is
> no other point at which we could have called this.
>
> Fixes crashes in KWin where Clear was causing intel_disable_rb_aux_buffer
> to crash on irb != NULL but irb->mt == NULL.
>
> Tested-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c
> b/src/mesa/drivers/dri/i965/brw_context.c
> index 6d27866fcea..5433f9080ee 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -201,6 +201,8 @@ intel_update_state(struct gl_context * ctx)
>
>     _mesa_unlock_context_textures(ctx);
>
> +   intel_prepare_render(brw);
> +
>     /* Resolve the depth buffer's HiZ buffer. */
>     depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH);
>     if (depth_irb && depth_irb->mt) {
> --
> 2.13.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170611/f5630391/attachment.html>


More information about the mesa-dev mailing list