[Mesa-dev] [PATCH 0/4] virgl: work around instance divisor bug

Erik Faye-Lund erik.faye-lund at collabora.com
Tue Dec 11 14:26:49 UTC 2018


Virglrenderer does the wrong thing when given an instance divisor;
it tries to use the element-index rather than the binding-index as
the argument to glVertexBindingDivisor(). This worked fine as long
as there was a 1:1 relationship between elements and bindings,
which was the case util 19a91841c34 "st/mesa: Use Array._DrawVAO in
st_atom_array.c.".
    
So let's detect instance divisors, and restore a 1:1 relationship in
that case. This will make old versions of virglrenderer behave
correctly. For newer versions, we can consider making a better
nterface, where the instance divisor isn't specified per element,
but rather per binding. But let's save that for another day.

This is the result of discussions in this thread:
https://lists.freedesktop.org/archives/mesa-dev/2018-November/210411.html
https://lists.freedesktop.org/archives/mesa-dev/2018-December/210804.html

Erik Faye-Lund (4):
  virgl: simplify virgl_hw_set_vertex_buffers
  virgl: simplify virgl_hw_set_index_buffer
  virgl: wrap vertex element state in a struct
  virgl: work around bad assumptions in virglrenderer

 src/gallium/drivers/virgl/virgl_context.c | 68 +++++++++++++++++------
 src/gallium/drivers/virgl/virgl_context.h |  2 +
 2 files changed, 53 insertions(+), 17 deletions(-)

-- 
2.19.2



More information about the mesa-dev mailing list