[Mesa-dev] [PATCH 4/4] virgl: work around bad assumptions in virglrenderer

Mathias Fröhlich Mathias.Froehlich at gmx.net
Thu Dec 13 05:25:59 UTC 2018


Good Morning,

> > One thing, may be. Do you want to add some documentation beside the
> > git log message why we do something surprising like replicating out
> > the
> > buffers and assigning new buffer indices? Just something that allows
> > a reader to get an idea why non straight forward things happen here.
> > The git annotate references to the commit messages tend to vanish
> > over time behind further changes in the code.
> > 
> 
> Yeah, that's a good point. This deserves a comment to clear things up a
> bit.
> 
> How about something like this squashed in?
> 
> ---8<---
> diff --git a/src/gallium/drivers/virgl/virgl_context.c
> b/src/gallium/drivers/virgl/virgl_context.c
> index ce72f73a0f6..2e3202b04e9 100644
> --- a/src/gallium/drivers/virgl/virgl_context.c
> +++ b/src/gallium/drivers/virgl/virgl_context.c
> @@ -399,6 +399,10 @@ static void
> *virgl_create_vertex_elements_state(struct pipe_context *ctx,
>  
>     for (int i = 0; i < num_elements; ++i) {
>        if (elements[i].instance_divisor) {
> +	 /* Virglrenderer doesn't deal with instance_divisor correctly
> if
> +	  * there isn't a 1:1 relationship between elements and
> bindings.
> +	  * So let's make sure there is, by duplicating bindings.
> +	  */
>  	 for (int j = 0; j < num_elements; ++j) {
>              new_elements[j] = elements[j];
>              new_elements[j].vertex_buffer_index = j;
> ---8<---

That's good for me.
Also the squashed get my RB.

best and Thanks

Mathias




More information about the mesa-dev mailing list