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

Eric Anholt eric at anholt.net
Wed Dec 21 12:20:00 PST 2011


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.

9, 10, 12, 13 are:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- 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/20111221/33bb6e15/attachment.pgp>


More information about the mesa-dev mailing list