<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 8, 2018 at 2:09 AM, Gert Wollny <span dir="ltr"><<a href="mailto:gert.wollny@collabora.com" target="_blank">gert.wollny@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Am Montag, den 07.05.2018, 22:55 -0400 schrieb Marek Olšák:<br>
> <br>
> tl;dr. Is the problem that Clear in virgl obeys rasterizer_discard?<br>
> Well then you have a bigger problem, because rasterizer_discard<br>
> should have no effect on Clear like in this example where glClear<br>
> should be executed normally:<br>
> <br>
> glEnable(GL_RASTERIZER_<wbr>DISCARD);<br>
> glClear(GL_COLOR_BUFFER_BIT);<br>
<br>
</span>No, glClear should obey GL_RASTERIZER_DISCARD (see standard 14.1, and <br>
this is actually handled in _mesa_Clear). <br>
<br>
> glDisable(GL_RASTERIZER_<wbr>DISCARD);<br>
<br>
The problem is that rasterizer state changes are not send to the host<br>
before gallium clear is sent, so when the guest calls<br>
<br>
glEnable(GL_RASTERIZER_<wbr>DISCARD);<br>
..draw something ..<br>
glDisable(GL_RASTERIZER_<wbr>DISCARD);<br>
glClear(GL_COLOR_BUFFER_BIT);<br>
<br>
then the host still thinks that GL_RASTERIZER_DISCARD is enabled, and<br>
since it emulates gallium_clear by galling glClear it fails.<br>
<br>
Initially, I proposed to also validate the rasterizer state in st_Clear<br>
to properly update the host state, but Ilia talked me out of it. <br></blockquote><div><br></div><div>I see now. pipe->clear is not affected by pipe_rasterizer_state, thus st/mesa doesn't have to do anything. st/mesa only considers the official behavior of pipe->clear, not the behavior of drivers. If you wanna change this, you have to officially re-define the behavior of pipe->clear, though there may be some resistance from VMWare, because they prefer the behavior of pipe->clear to match DX11, and everybody else also prefers the current behavior. If you somehow managed to get everybody to agree with your new behavior of pipe->clear, st/mesa could be modified to take it into account.<br><br></div><div>Marek<br></div></div></div></div>