<div class="gmail_quote">On Mon, Aug 16, 2010 at 3:55 PM, Roland Scheidegger <span dir="ltr">&lt;<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>&gt;</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>
&gt; If PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE is not advertised and there is<br>
&gt; a D24S8 texture bound and the mask is BUFFER_BIT_DEPTH|BUFFER_BIT_STENCIL,<br>
&gt; the state tracker always cleared the texture with a quad instead of using<br>
&gt; pipe_context::clear.<br>
<br>
</div><div>&gt; @@ -543,7 +549,7 @@ st_Clear(GLcontext *ctx, GLbitfield mask)<br>
&gt;         */<br>
&gt;        if ((clear_buffers &amp; PIPE_CLEAR_DEPTHSTENCIL) &amp;&amp;<br>
&gt;            ((clear_buffers &amp; PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &amp;&amp;<br>
&gt; -          (depthRb == stencilRb) &amp;&amp;<br>
&gt; +          depth_stencil_combined &amp;&amp;<br>
&gt;            (ctx-&gt;DrawBuffer-&gt;Visual.depthBits == 0 ||<br>
&gt;             ctx-&gt;DrawBuffer-&gt;Visual.stencilBits == 0))<br>
&gt;           clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;<br>
<br>
</div>I think there&#39;s an issue with this code when used for texture<br>
attachments, we use the Visual information but I don&#39;t think that&#39;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&#39;t handle texture attachments correctly before that bug might have<br>
been hidden.<br></blockquote></div><br>OK, I&#39;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>