[Mesa-dev] [PATCH 1/5] st/mesa: use pipe_context::clear for D24S8 textures when appropriate

Marek Olšák maraeo at gmail.com
Fri Aug 20 09:40:50 PDT 2010


On Mon, Aug 16, 2010 at 3:55 PM, Roland Scheidegger <sroland at vmware.com>wrote:

> On 14.08.2010 17:47, Marek Olšák wrote:
> > If PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE is not advertised and there is
> > a D24S8 texture bound and the mask is
> BUFFER_BIT_DEPTH|BUFFER_BIT_STENCIL,
> > the state tracker always cleared the texture with a quad instead of using
> > pipe_context::clear.
>
> > @@ -543,7 +549,7 @@ st_Clear(GLcontext *ctx, GLbitfield mask)
> >         */
> >        if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
> >            ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) !=
> PIPE_CLEAR_DEPTHSTENCIL) &&
> > -          (depthRb == stencilRb) &&
> > +          depth_stencil_combined &&
> >            (ctx->DrawBuffer->Visual.depthBits == 0 ||
> >             ctx->DrawBuffer->Visual.stencilBits == 0))
> >           clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
>
> I think there's an issue with this code when used for texture
> attachments, we use the Visual information but I don't think that's
> meaningful in that case (Visual information is also used elsewhere in
> the clear code), potentially leading to bogus results. If the code
> didn't handle texture attachments correctly before that bug might have
> been hidden.
>

OK, I've attached a new patch which also resolves the issue with the Visual
bits. There is an explanation in the commit message.

May I push?

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100820/56f7f351/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-st-mesa-use-pipe_context-clear-for-D24S8-textures-wh.patch
Type: application/pgp-keys
Size: 6900 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100820/56f7f351/attachment-0001.key>


More information about the mesa-dev mailing list