summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <wallbraker@gmail.com>2011-02-18 23:59:40 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-02-26 14:58:40 +0100
commit272dc1eb5b2ee535e31bb7469965eb8d38509781 (patch)
treec1d9cd9d560e9874955a9fde95c6d8413a82848f
parent7a5060358c5827f2b0519b8602350caeb6ce067a (diff)
draw: Flush when eltSize changes
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.
-rw-r--r--src/gallium/auxiliary/draw/draw_private.h1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c10
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 d9f2d7368c..e3337eeae5 100644
--- a/src/gallium/auxiliary/draw/draw_private.h
+++ b/src/gallium/auxiliary/draw/draw_private.h
@@ -137,6 +137,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 500c24da1b..6d3ccc28ef 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 );