[Mesa-dev] [PATCH 6/6] draw: Do a full state change flush on opt and prim changes

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


From: Jakob Bornecrantz <wallbraker at gmail.com>

In certain conditions when going from different primitive requires
us to flush and validate the different stages. Like smoth lines being
active but first drawing with triangles and then drawing lines.

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

diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index d2e2126..403c0f4 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -108,12 +108,15 @@ draw_pt_arrays(struct draw_context *draw,
 
    frontend = draw->pt.frontend;
 
-   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;
+   if (frontend ) {
+      if (draw->pt.prim != prim || draw->pt.opt != opt) {
+         draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
+         frontend = NULL;
+      } else if (draw->pt.eltSize != draw->pt.user.eltSize) {
+         /* XXX: flush only the frontend if eltSize changed */
+         frontend->flush( frontend, DRAW_FLUSH_STATE_CHANGE );
+         frontend = NULL;
+      }
    }
 
    if (!frontend) {
-- 
1.7.6.5



More information about the mesa-dev mailing list