From: Rob Clark <robcl...@freedesktop.org> This patchset (compared to RFC I sent previously) changes u_primconvert to just be a front-end to the u_indices stuff. It handles binding/ restoring new index buffer state, etc. So driver using it just has to put this at the top of their pipe->draw_vbo():
if (prim_needs_emulating) { util_primconvert_save_index_buffer(ctx->primconvert, &ctx->indexbuf); util_primconvert_save_rasterizer_state(ctx->primconvert, ctx->rasterizer); util_primconvert_draw_vbo(ctx->primconvert, info); return; } It does not yet handle changing provoking vertex (since I didn't need this), but that looks like it should be easy to add. I considered first just using u_indices directly from freedreno, like svga does. But it is at least more complex than it needs to be and it seemed like eventually more code could be shared with this approach. I suspect some of the index buffer caching done in svga could be moved into u_primconvert and shared between svga and freedreno (and any other future drivers for GLES hw which might need the same thing). The last patch converts freedreno over to use this. It depends on another patch with regenerated envytools headers (updated to take into account differences between a20x/a22x/a3xx) for the draw initiator. Rob Clark (3): gallium/auxiliary/indices: add start param gallium/auxiliary/indices: add u_primconvert freedreno: emulated unsupported primitive types src/gallium/auxiliary/Makefile.sources | 1 + src/gallium/auxiliary/indices/u_indices.c | 6 +- src/gallium/auxiliary/indices/u_indices.h | 4 +- src/gallium/auxiliary/indices/u_indices_gen.py | 21 +-- src/gallium/auxiliary/indices/u_primconvert.c | 171 +++++++++++++++++++++ src/gallium/auxiliary/indices/u_primconvert.h | 46 ++++++ src/gallium/auxiliary/indices/u_unfilled_gen.py | 13 +- src/gallium/auxiliary/indices/u_unfilled_indices.c | 19 ++- src/gallium/drivers/freedreno/a2xx/fd2_context.c | 24 ++- src/gallium/drivers/freedreno/a3xx/fd3_context.c | 12 +- src/gallium/drivers/freedreno/freedreno_context.c | 16 +- src/gallium/drivers/freedreno/freedreno_context.h | 18 ++- src/gallium/drivers/freedreno/freedreno_draw.c | 29 ++-- src/gallium/drivers/svga/svga_draw_arrays.c | 3 +- src/gallium/drivers/svga/svga_draw_elements.c | 1 + 15 files changed, 332 insertions(+), 52 deletions(-) create mode 100644 src/gallium/auxiliary/indices/u_primconvert.c create mode 100644 src/gallium/auxiliary/indices/u_primconvert.h -- 1.8.3.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev