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

Roland Scheidegger sroland at vmware.com
Mon Aug 16 06:55:24 PDT 2010


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.

Roland


More information about the mesa-dev mailing list