mesa: Don't call fence_finish with a null fence.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 24 Nov 2008 04:44:30 +0000 (13:44 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 24 Nov 2008 04:44:30 +0000 (13:44 +0900)
src/mesa/state_tracker/st_cb_flush.c

index d8f9537d2de63e5ed7ac66420d39b88d879f4b38..cc40467941635b7602d34d861141cf3c8a12c9fa 100644 (file)
@@ -93,8 +93,10 @@ void st_finish( struct st_context *st )
 
    st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
 
-   st->pipe->winsys->fence_finish(st->pipe->winsys, fence, 0);
-   st->pipe->winsys->fence_reference(st->pipe->winsys, &fence, NULL);
+   if(fence) {
+      st->pipe->winsys->fence_finish(st->pipe->winsys, fence, 0);
+      st->pipe->winsys->fence_reference(st->pipe->winsys, &fence, NULL);
+   }
 }