[Mesa-dev] [PATCH v2] panfrost: Remove panfrost_context.depth_stencil_buffer

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Wed Jul 10 13:04:50 UTC 2019

A step in the right direction, but not totally right I don't think.

> +                struct pipe_surface *surf = ctx->pipe_framebuffer.zsbuf;
> +                struct panfrost_resource *rsrc = pan_resource(surf->texture);
> +                sfbd->depth_buffer = rsrc->bo->gpu;

Critically, ctx->pipe_framebuffer is an arbitrary pipe_surface bound as
an FBO (whether that's scanout or not is irrelevant right now). It may
or may not havea  zsbuf defined; it's perfectly valid for no Z/S buffer
to be defined in which case zsbuf is NULL and this code crashes due to a
NULL poinnter dereference in the next line.

The right way to do it is hoist all of this logic into a dedicated SFBD
Z/S setup function. See the corresponding MFBD code for inspiration on
how the setup for colour buffers and Z/S buffers are cleanly separated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190710/23defe39/attachment.sig>

More information about the mesa-dev mailing list