softpipe: Include missing header in sp_flush.c.
[mesa.git] / src / gallium / drivers / r300 / r300_flush.c
index ba840bfff81b8b68da3f4aa3d22a7dfb9d70bb6e..2b5d2e42ba5bb6ff9079998583655371b7898005 100644 (file)
@@ -25,6 +25,7 @@
 #include "draw/draw_private.h"
 
 #include "util/u_simple_list.h"
+#include "util/u_upload_mgr.h"
 
 #include "r300_context.h"
 #include "r300_cs.h"
@@ -39,21 +40,20 @@ static void r300_flush(struct pipe_context* pipe,
     struct r300_atom *atom;
     struct r300_fence **rfence = (struct r300_fence**)fence;
 
-    /* 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.
-     *
-     * Of course, the best thing is to kill Draw with fire. :3 */
-    if (r300->draw && !r300->draw->flushing) {
-        draw_flush(r300->draw);
-    }
+    u_upload_flush(r300->upload_vb);
+    u_upload_flush(r300->upload_ib);
+
+    if (r300->draw)
+       r300_draw_flush_vbuf(r300);
 
     if (r300->dirty_hw) {
+        r300_emit_hyperz_end(r300);
         r300_emit_query_end(r300);
+        if (r500_index_bias_supported(r300))
+            r500_emit_index_bias(r300, 0);
 
-        if (SCREEN_DBG_ON(r300->screen, DBG_STATS)) {
-            r300->flush_counter++;
-        }
-        r300->rws->flush_cs(r300->rws);
+        r300->flush_counter++;
+        r300->rws->cs_flush(r300->cs);
         r300->dirty_hw = 0;
 
         /* New kitchen sink, baby. */