Merge branch 'mesa_7_5_branch'
[mesa.git] / src / gallium / drivers / r300 / r300_flush.c
index 3766f0a0a7b0bd07f192ce152ccaa87cbcc35576..0dff1c6f4fb59d085aa3b8bda377b9c8855192ac 100644 (file)
@@ -29,8 +29,15 @@ static void r300_flush(struct pipe_context* pipe,
     struct r300_context* r300 = r300_context(pipe);
     CS_LOCALS(r300);
 
+    /* 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;
+        r300_emit_invariant_state(r300);
         r300->dirty_state = R300_NEW_KITCHEN_SINK;
         r300->dirty_hw = 0;
     }