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

Brian Paul brian.e.paul at gmail.com
Sun Aug 22 18:44:17 PDT 2010


On Fri, Aug 20, 2010 at 10:40 AM, Marek Olšák <maraeo at gmail.com> wrote:
> 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?

I need a bit more time to review this but I committed the part that
added the st_is_depth_stencil_combined() function, plus the other
patches which help to fix the piglit fbo-blit-d24s8 test.

-Brian


More information about the mesa-dev mailing list