[Mesa-dev] [PATCH 14/22] swrast: stop using depth/stencil wrappers in CopyPixels code

Eric Anholt eric at anholt.net
Thu Dec 22 09:38:17 PST 2011


On Thu, 22 Dec 2011 09:49:33 -0700, Brian Paul <brian.e.paul at gmail.com> wrote:
> On Wed, Dec 21, 2011 at 1:20 PM, Eric Anholt <eric at anholt.net> wrote:
> > On Sun, 18 Dec 2011 20:08:19 -0700, Brian Paul <brianp at vmware.com> wrote:
> >> The functions that read depth/stencil values understand all (packed)
> >> depth/stencil buffer formats now so there's no reason to use the
> >> wrappers.
> >>
> >> Also, improve the format checks in fast_copy_pixels() to catch mismatched
> >> depth/stencil cases.
> >
> >> +   if (type == GL_STENCIL || type == GL_DEPTH_COMPONENT) {
> >> +      /* can't handle packed depth+stencil here */
> >> +      if (_mesa_is_format_packed_depth_stencil(srcRb->Format) ||
> >> +          _mesa_is_format_packed_depth_stencil(dstRb->Format))
> >> +         return GL_FALSE;
> >> +   }
> >> +   else if (type == GL_DEPTH_STENCIL) {
> >> +      /* can't handle separate depth/stencil buffers */
> >> +      if (!_mesa_is_format_packed_depth_stencil(srcRb->Format) ||
> >> +          !_mesa_is_format_packed_depth_stencil(dstRb->Format))
> >> +         return GL_FALSE;
> >> +   }
> >
> > I think the GL_DEPTH_STENCIL test here wants
> > srcRb != srcFb->Attachment[BUFFER_STENCIL].Renderbuffer and same for
> > dst.  Other than that, looks good.
> 
> And remove the _mesa_is_format_packed_depth_stencil() calls, right?
> If Att[BUFFER_DEPTH] == Att[BUFFER_STENCIL] we clearly have a combined
> depth+stencil buffer.

Yeah.
-------------- 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/20111222/2baceb55/attachment.pgp>


More information about the mesa-dev mailing list