[Mesa-dev] Mesa (master): st/mesa & v_bug_mgr: two small instanced drawing fixes

Christian König deathsimple at vodafone.de
Tue Mar 1 11:59:49 PST 2011


Am Montag, den 28.02.2011, 19:32 +0100 schrieb Marek Olšák:



> max_index should be for per-vertex data only. We probably need to
> compute max_index for per-instance data separately (it can be derived
> from prims[i].num_instances and
> pipe_vertex_element::instance_divisor). The per-instance data are more
> like constants than vertices.
> 
> max_index is used in parameters of functions pipe_user_buffer_create
> and redefine_user_buffer in the same file.
> 
> FWIW I'd rather see the "size" variable in u_vbuf_mgr be derived from
> pipe_draw_info::instance_count.
I just pushed a new patch which should fix this issue in the right way.
Instead of increasing max_index it should correctly calculate the size
of instanced vertex buffers. Piglit doesn't shows any regressions for so
I think it's the right way how to do it (at least on this occasion).



> It wouldn't surprise me a bit if there's issues like this in a few 
> places.  Wherever we try to compute a max index or figure out the the 
> size of a destination buffer from the vertex info we need to consider 
> how/if the instance count and divisor factors into it.

I also think so, maybe removing max_index from the pipe_vertex_element
structure wasn't the best idea after all, but let's just see how well
this will work / how many other places contains incorrect assumptions
about the size of a vertex buffer, and then decide what to do next.

Christian.



More information about the mesa-dev mailing list