[Mesa-dev] [RFC PATCH] mesa/st/cb_clear: in st_Clear also validate the render state (needed by virgl)
Gert Wollny
gert.wollny at collabora.com
Tue May 8 06:09:53 UTC 2018
Am Montag, den 07.05.2018, 22:55 -0400 schrieb Marek Olšák:
>
> tl;dr. Is the problem that Clear in virgl obeys rasterizer_discard?
> Well then you have a bigger problem, because rasterizer_discard
> should have no effect on Clear like in this example where glClear
> should be executed normally:
>
> glEnable(GL_RASTERIZER_DISCARD);
> glClear(GL_COLOR_BUFFER_BIT);
No, glClear should obey GL_RASTERIZER_DISCARD (see standard 14.1, and
this is actually handled in _mesa_Clear).
> glDisable(GL_RASTERIZER_DISCARD);
The problem is that rasterizer state changes are not send to the host
before gallium clear is sent, so when the guest calls
glEnable(GL_RASTERIZER_DISCARD);
..draw something ..
glDisable(GL_RASTERIZER_DISCARD);
glClear(GL_COLOR_BUFFER_BIT);
then the host still thinks that GL_RASTERIZER_DISCARD is enabled, and
since it emulates gallium_clear by galling glClear it fails.
Initially, I proposed to also validate the rasterizer state in st_Clear
to properly update the host state, but Ilia talked me out of it.
Best,
Gert
More information about the mesa-dev
mailing list