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

Brian Paul brian.e.paul at gmail.com
Thu Dec 22 08:49:33 PST 2011


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.

>
> 9, 10, 12, 13 are:
>
> Reviewed-by: Eric Anholt <eric at anholt.net>

-Brian


More information about the mesa-dev mailing list