[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
Sun May 6 06:52:07 UTC 2018
Dear Ilia,
it took me a while but I think I understand now, thanks for all your
explanations.
Am Freitag, den 04.05.2018, 18:11 -0400 schrieb Ilia Mirkin:
>
> Rasterizer state doesn't affect the gallium clear callback. clear
> just clears -- it's a memset. However rasterizer state affects
> glClear() so you have to make sure to keep that in mind when you try
> to implement clear() with glClear() (i.e. turn off whatever GL state
> the rasterizer may have set which would cause you issues).
I think my error was that I looked at st_Clear, which does indeed
handle all the relevant rasterization states, but because they are
handled directly there they don't need extra validation, something that
is only required for virgl, in other words what I really would want is
a replacement for st_Clear that would forward the state changes to
virgl and then call some other function glclear that sends the clear
mask to virglrenderer where everything is passed to and processed in
the host st_Clear anyway. Obviously gallium was not designed for this.
> If you want, you could construct a temporary rasterizer state, bind
> that, do the glClear() and then bind the old one back.
This is what I now implemented in virgl, and it fixes all the tests I
was looking at. Performance wise it is not exactly nice, because it
adds two state changes, but so is the whole clear operation, and to
improve this situation one has to look beyond the current gallium
implementation.
Thanks again,
Gert
More information about the mesa-dev
mailing list