galahad: do map/unmap counting for resources
[mesa.git] / src / gallium / drivers / i965 / brw_pipe_flush.c
index 9b52b56eae7de9d425a529c3b42c1b61581e1460..0ae1a6be9e5e778d91dc3f5202ba6f028ca93c8f 100644 (file)
@@ -1,9 +1,10 @@
 
-#include "util/u_upload_mgr.h"
-
 #include "brw_context.h"
 #include "brw_batchbuffer.h"
 
+#include "util/u_upload_mgr.h"
+
+
 
 
 /* All batchbuffer flushes must go through this function.
@@ -41,10 +42,10 @@ brw_flush( struct pipe_context *pipe,
            struct pipe_fence_handle **fence )
 {
    brw_context_flush( brw_context( pipe ) );
-   *fence = NULL;
+   if (fence)
+      *fence = NULL;
 }
 
-
 void brw_pipe_flush_init( struct brw_context *brw )
 {
    brw->base.flush = brw_flush;