summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/include/state_tracker/st_api.h2
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c2
-rw-r--r--src/mesa/state_tracker/st_manager.c22
-rw-r--r--src/mesa/state_tracker/st_manager.h3
4 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index bc62a69da37..2eaf891ab7a 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -366,6 +366,8 @@ struct st_framebuffer_iface
const enum st_attachment_type *statts,
unsigned count,
struct pipe_resource **out);
+ boolean (*flush_swapbuffers) (struct st_context_iface *stctx,
+ struct st_framebuffer_iface *stfbi);
};
/**
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 8375308c3e2..5a260184ede 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -73,6 +73,8 @@ void st_finish( struct st_context *st )
PIPE_TIMEOUT_INFINITE);
st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL);
}
+
+ st_manager_flush_swapbuffers();
}
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 28cf0234cd6..617a691a67c 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -1064,6 +1064,28 @@ st_manager_validate_framebuffers(struct st_context *st)
st_context_validate(st, stdraw, stread);
}
+
+/**
+ * Flush any outstanding swapbuffers on the current draw framebuffer.
+ */
+void
+st_manager_flush_swapbuffers(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct st_context *st = (ctx) ? ctx->st : NULL;
+ struct st_framebuffer *stfb;
+
+ if (!st)
+ return;
+
+ stfb = st_ws_framebuffer(ctx->DrawBuffer);
+ if (!stfb || !stfb->iface->flush_swapbuffers)
+ return;
+
+ stfb->iface->flush_swapbuffers(&st->iface, stfb->iface);
+}
+
+
/**
* Add a color renderbuffer on demand. The FBO must correspond to a window,
* not a user-created FBO.
diff --git a/src/mesa/state_tracker/st_manager.h b/src/mesa/state_tracker/st_manager.h
index c54f29e2941..1a1ea79af8e 100644
--- a/src/mesa/state_tracker/st_manager.h
+++ b/src/mesa/state_tracker/st_manager.h
@@ -53,4 +53,7 @@ st_framebuffer_reference(struct st_framebuffer **ptr,
void
st_framebuffer_interface_destroy(struct st_framebuffer_interface *stfbi);
+void
+st_manager_flush_swapbuffers(void);
+
#endif /* ST_MANAGER_H */