From: Jakob Bornecrantz <wallbra...@gmail.com> This could be improved so only the frontend is flushed since it convertes all indecies to ushots and the fetch part of the middle always perpares both linear and indexed.
Reviewed-by: Stéphane Marchesin <marc...@chromium.org> Tested-by: Stéphane Marchesin <marc...@chromium.org> --- src/gallium/auxiliary/draw/draw_private.h | 1 + src/gallium/auxiliary/draw/draw_pt.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index f53c16d..c3eca97 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -142,6 +142,7 @@ struct draw_context struct draw_pt_front_end *frontend; unsigned prim; unsigned opt; + unsigned eltSize; /* saved eltSize for flushing */ struct { struct draw_pt_middle_end *fetch_emit; diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 3554ca1..d2e2126 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -52,7 +52,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE) * - backend -- the vbuf_render provided by the driver. */ static boolean -draw_pt_arrays(struct draw_context *draw, +draw_pt_arrays(struct draw_context *draw, unsigned prim, unsigned start, unsigned count) @@ -108,7 +108,10 @@ draw_pt_arrays(struct draw_context *draw, frontend = draw->pt.frontend; - if (frontend && (draw->pt.prim != prim || opt != draw->pt.opt)) { + if (frontend && (draw->pt.prim != prim || + draw->pt.opt != opt || + draw->pt.eltSize != draw->pt.user.eltSize)) { + /* XXX: flush only the frontend if eltSize changed */ frontend->flush( frontend, DRAW_FLUSH_STATE_CHANGE ); frontend = NULL; } @@ -118,9 +121,10 @@ draw_pt_arrays(struct draw_context *draw, frontend->prepare( frontend, prim, middle, opt ); + draw->pt.frontend = frontend; + draw->pt.eltSize = draw->pt.user.eltSize; draw->pt.prim = prim; draw->pt.opt = opt; - draw->pt.frontend = frontend; } frontend->run( frontend, start, count ); -- 1.7.6.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev