r300g: Fix recursive Draw flush.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 2 Jul 2009 06:25:47 +0000 (23:25 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 2 Jul 2009 06:25:47 +0000 (23:25 -0700)
Also just noticed that demos/copypix walks around the overlapping blit rules.

Bad, bad Mesa. :3

src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_flush.h

index 89a5f2b20cf188ee8a8f9b7251a98640a2f4bff3..0dff1c6f4fb59d085aa3b8bda377b9c8855192ac 100644 (file)
@@ -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;
index a1b224b39ceca7a679fe93b1c55ea518dc9ce06b..9a83d89daab7dbce5d651d2066c089d3c8967fc5 100644 (file)
@@ -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"