Mesa (master): r300g: Fix recursive Draw flush.

Corbin Simpson csimpson at kemper.freedesktop.org
Thu Jul 2 06:32:09 UTC 2009


Module: Mesa
Branch: master
Commit: 96ef7aae1d58db2cbc2e46347aa87c34126983ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=96ef7aae1d58db2cbc2e46347aa87c34126983ef

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Wed Jul  1 23:25:47 2009 -0700

r300g: Fix recursive Draw flush.

Also just noticed that demos/copypix walks around the overlapping blit rules.

Bad, bad Mesa. :3

---

 src/gallium/drivers/r300/r300_flush.c |    6 +++++-
 src/gallium/drivers/r300/r300_flush.h |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 89a5f2b..0dff1c6 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -29,7 +29,11 @@ static void r300_flush(struct pipe_context* pipe,
     struct r300_context* r300 = r300_context(pipe);
     CS_LOCALS(r300);
 
-    draw_flush(r300->draw);
+    /* We probably need to flush Draw, but we may have been called from
+     * within Draw. This feels kludgy, but it might be the best thing. */
+    if (!r300->draw->flushing) {
+        draw_flush(r300->draw);
+    }
 
     if (r300->dirty_hw) {
         FLUSH_CS;
diff --git a/src/gallium/drivers/r300/r300_flush.h b/src/gallium/drivers/r300/r300_flush.h
index a1b224b..9a83d89 100644
--- a/src/gallium/drivers/r300/r300_flush.h
+++ b/src/gallium/drivers/r300/r300_flush.h
@@ -23,6 +23,8 @@
 #ifndef R300_FLUSH_H
 #define R300_FLUSH_H
 
+#include "draw/draw_private.h"
+
 #include "pipe/p_context.h"
 
 #include "r300_context.h"




More information about the mesa-commit mailing list