radeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions
[mesa.git] / src / gallium / drivers / i915 / i915_flush.c
index a5407cfd18419b1d08a630fb7d9d094cd9ab6061..50d6642e5a3edce0cabfeea6c2cb98f755b72777 100644 (file)
@@ -43,9 +43,10 @@ static void i915_flush_pipe( struct pipe_context *pipe,
 {
    struct i915_context *i915 = i915_context(pipe);
 
-   draw_flush(i915->draw);
-
-   if (i915->batch->map == i915->batch->ptr) {
+   /* Only shortcut this if we have no fence, otherwise we must flush the
+    * empty batchbuffer to get our fence back.
+    */
+   if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
       return;
    }
 
@@ -74,6 +75,9 @@ void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence)
    i915->hardware_dirty = ~0;
    i915->immediate_dirty = ~0;
    i915->dynamic_dirty = ~0;
+   i915->static_dirty = ~0;
    /* kernel emits flushes in between batchbuffers */
    i915->flush_dirty = 0;
+   i915->fired_vertices += i915->queued_vertices;
+   i915->queued_vertices = 0;
 }