<div class="gmail_quote">On Mon, Aug 16, 2010 at 3:55 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On 14.08.2010 17:47, Marek Olšák wrote:<br>
> If PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE is not advertised and there is<br>
> a D24S8 texture bound and the mask is BUFFER_BIT_DEPTH|BUFFER_BIT_STENCIL,<br>
> the state tracker always cleared the texture with a quad instead of using<br>
> pipe_context::clear.<br>
<br>
</div><div>> @@ -543,7 +549,7 @@ st_Clear(GLcontext *ctx, GLbitfield mask)<br>
> */<br>
> if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&<br>
> ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&<br>
> - (depthRb == stencilRb) &&<br>
> + depth_stencil_combined &&<br>
> (ctx->DrawBuffer->Visual.depthBits == 0 ||<br>
> ctx->DrawBuffer->Visual.stencilBits == 0))<br>
> clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;<br>
<br>
</div>I think there's an issue with this code when used for texture<br>
attachments, we use the Visual information but I don't think that's<br>
meaningful in that case (Visual information is also used elsewhere in<br>
the clear code), potentially leading to bogus results. If the code<br>
didn't handle texture attachments correctly before that bug might have<br>
been hidden.<br></blockquote></div><br>OK, I've attached a new patch which also resolves the issue with the Visual bits. There is an explanation in the commit message.<br><br>May I push?<br><br>Marek<br>