[Mesa-dev] [PATCH 5/6] draw: Flush on vertex elements change

Stéphane Marchesin marcheu at chromium.org
Tue Jan 24 00:55:50 PST 2012


From: Jakob Bornecrantz <wallbraker at gmail.com>

We could improve this by only flushing the frontend and the fetch part
of the middle. This would avoid recalculating the emit keys.

Reviewed-by: Stéphane Marchesin <marcheu at chromium.org>
Tested-by: Stéphane Marchesin <marcheu at chromium.org>
---
 src/gallium/auxiliary/draw/draw_context.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 7b33017..2d497ca 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -355,6 +355,9 @@ draw_set_vertex_elements(struct draw_context *draw,
 {
    assert(count <= PIPE_MAX_ATTRIBS);
 
+   /* XXX: flush only the fetch part */
+   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+
    memcpy(draw->pt.vertex_element, elements, count * sizeof(elements[0]));
    draw->pt.nr_vertex_elements = count;
 }
-- 
1.7.6.5



More information about the mesa-dev mailing list