[Mesa-dev] [PATCH v2] panfrost: Remove panfrost_context.depth_stencil_buffer
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...
Size: 833 bytes
Desc: not available
More information about the mesa-dev