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.
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev