[Mesa-dev] [PATCH] st/mesa: rewrite the primitive restart fallback code
Jose Fonseca
jfonseca at vmware.com
Fri Nov 18 02:39:47 PST 2011
----- Original Message -----
> Previously we were mapping/unmapping the index buffer each time we
> found the restart index in the buffer. This is bad when the restart
> index is frequently used. Now just map the index buffer once, scan
> it to produce a list of sub-primitives, unmap the buffer, then draw
> the sub-primitives.
>
> Also, clean up the logic of testing for indexed primitives and
> calling
> handle_fallback_primitive_restart(). Don't call it for non-indexed
> primitives.
>
> v2: per Jose, only map the relevant part of the index buffer with
> pipe_buffer_map_range()
Looks good Brian.
Before committing, could please just add a comment with the possible improvements (i.e., cache the restart indices when index buffer is not modified between calls, and use triangle strips w/ dummy zero-area triangles as suggested in http://msdn.microsoft.com/en-us/library/windows/desktop/bb206274(v=vs.85).aspx ) for future reference.
These are actually nice projects for newbies BTW.
Jose
More information about the mesa-dev
mailing list