[Mesa-dev] [PATCH] virgl: clear render state before submitting clear command

Gert Wollny gert.wollny at collabora.com
Tue May 8 07:10:27 UTC 2018


Am Dienstag, den 08.05.2018, 16:38 +1000 schrieb Dave Airlie:
> 
> Care to elaborate here? Nothing in gallium or virgl is really set in
> stone we should be able to engineer new interfaces if needed, they
> just might take some time.

Taking Mareks comment [1] into account, I wouldn't want to try doing
this in gallium directly. Instead. I thought about some forwarding
state tracker that build on top of gallium (like a derived class in C++
terms), that is used by virgl, and that overrides what in gallium is
the st_Clear function, e.g. with a function "stfw_Clear" which would
then look more or less like this:

void stfw_Clear(struct gl_context *ctx, GLbitfield mask)
{
    st_validate_state(st, ST_PIPELINE_CLEAR);
    st_validate_state(st, ST_PIPELINE_RENDER);
    st->pipe->glclear(st->pipe, mask); 
}

glclear would replace clear in virgl (rename to not mix with gallium
names) and send a (new) VIRGL_GLCLEAR command with "mask" to the host
which then directly exectues glClear(mask).

Since the states are properly updated, no further handling would be
needed and all this decoding the mask and putting it back togther on
the host would also go away.

[1] https://lists.freedesktop.org/archives/mesa-dev/2018-May/194343.htm
l

> > Anyway, If you confirm that we should do it on the host side, then
> > I will retract this patch and prepare something for virglrenderer.
> 
> I think since we've fixed similiar on the host side we should
> continue to do so.
I was afraid someone would say this ;) Okay, I'm on it.

best, 
Gert 



More information about the mesa-dev mailing list