[Mesa-dev] [PATCH 5/6] intel: Fix swrast_render_start() for depthstencil buffers with separate stencil

Eric Anholt eric at anholt.net
Mon Nov 14 14:05:33 PST 2011

On Sun, 13 Nov 2011 22:32:14 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> This patch fixes three interrelated bugs.
> Fixes many depthstencil Piglit tests on gen7, too many to list.
> 1. Don't map the depthstencil buffer twice
> ------------------------------------------
> Place a guard in intel_renderbuffer_map() to prevent a renderbuffer from
> being mapped twice. This happened if a single buffer was attached to the
> framebuffer's depth and stencil attachment points.  (Interestingly,
> because intel_map_renderbuffer_gtt() is idempotent, the double mapping did
> not cause bugs for depthstencil buffers *without* separate stencil).
> 2. Stop using the special stencil span accessors
> ------------------------------------------------
> The special stencil span accessors, as set by intel_span_init_funcs.
> perform software W detiling. Since intel_renderbuffer_map() now uses
> MapRenderbuffer, rb->Data points to an *untiled* stencil buffer.
> 3. Stop overriding gl_framebuffer::_DepthBuffer,_StencilBuffer
> --------------------------------------------------------------
> Normally, if a depthstencil buffer is attached to the framebuffer's depth
> attachment point, then _mesa_update_framebuffer() installs a wrapper depth
> renderbuffer at gl_framebuffer::_DepthBuffer. Ditto for the stencil
> attachment point and gl_framebuffer::_StencilBuffer
> A depthstencil intel_renderbuffer with separate stencil contains hidden
> depth and stencil renderbuffers, which are the *real* renderbuffers. In
> order to force swrast to work, we were installing, in
> brw_update_draw_buffer(), the hidden renderbuffers at
> gl_framebuffer::_DepthBuffer and _StencilBuffer, thus overriding the
> behavior of _mesa_update_framebuffer().  However, now that
> intel_renderbuffer_map() is implemented with MapRenderbuffer(), overriding
> _mesa_update_framebuffer's introduces bugs (You really don't want the
> horrid, detailed explanation, so I'll spare you...). This patch removes
> the override code.

I was following you up to this point.  So, Reviewed-by: for me for the
entire series up to 2/3 of this (except for that one add-a-comment
comment).  I believe you that there's something going wrong when we
override _DepthBuffer and _StencilBuffer, I just don't know exactly

I'm guessing that all of these 3 patches in this commit were squashed
together because nothing worked without all of them?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111114/2ae60438/attachment.pgp>

More information about the mesa-dev mailing list