[Mesa-dev] [RFC PATCH] mesa/st/cb_clear: in st_Clear also validate the render state (needed by virgl)
Ilia Mirkin
imirkin at alum.mit.edu
Fri May 4 20:11:20 UTC 2018
On Fri, May 4, 2018 at 2:50 PM, Gert Wollny <gert.wollny at collabora.com> wrote:
> For that reason I think that a render state validation within st_Clear
> makes sense, because it makes sure that the states like SCISSOR_TEST
> or DISCARD_RASTERIZER are properly send to the driver, before clear()
> is executed that makes use of these states. And while the workaround
> for DISCARD_RASTERIZER is possible because if it is set then the host
> should actually never see the clear command, SCISSOR_TEST is different,
> its state can not be guessed on the host.
>
> Anyway, I happily take every hint on how this can be fixed directly in
> virgl_clear or virgl in general, and thank you for taking the time to
> answer me,
I thought someone else took care of the scissor thing for clears. At
least they were asking about it.
I have to assume that virglrenderer keeps track of the last-set
rasterizer state. Based on that, you have to turn off scissors,
rasterizer discard, window rectangles, stencil tests, sample masks(?),
and anything else which affects clears (have a look at st_Clear --
anything that causes it to hit the fallback path which draws should be
something you turn off because calling glClear() in virglrenderer).
If you don't keep track of the last-set rasterizer state, then now may
be a good time to start :)
-ilia
More information about the mesa-dev
mailing list