summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_flush.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-03-26 09:36:40 +0000
committerMichel Dänzer <michel@tungstengraphics.com>2008-03-26 09:36:40 +0000
commit4abe1eb980ed76d2b2d3383eaab520d0aa2ae6f4 (patch)
tree82ef00b79a812d6380b023e1da1a24c34437d66e /src/mesa/state_tracker/st_cb_flush.c
parente55dccd0bfc41dbcf306f864c01758f8e28fc660 (diff)
gallium: Change pipe->flush() interface to optionally return a fence.
The cell driver still uses an internal CELL_FLUSH_WAIT flag, in the long run proper fencing should be implemented for it.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_flush.c')
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index dbec993f1b..a536a059bd 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -43,19 +43,21 @@
#include "pipe/p_winsys.h"
-void st_flush( struct st_context *st, uint pipeFlushFlags )
+void st_flush( struct st_context *st, uint pipeFlushFlags,
+ struct pipe_fence_handle **fence )
{
FLUSH_VERTICES(st->ctx, 0);
- st->pipe->flush( st->pipe, pipeFlushFlags );
+ st->pipe->flush( st->pipe, pipeFlushFlags, fence );
}
-static void st_gl_flush( struct st_context *st, uint pipeFlushFlags )
+static void st_gl_flush( struct st_context *st, uint pipeFlushFlags,
+ struct pipe_fence_handle **fence )
{
GLframebuffer *fb = st->ctx->DrawBuffer;
- FLUSH_VERTICES(st->ctx, 0);
+ st_flush( st, pipeFlushFlags, fence );
if (!fb)
return;
@@ -80,15 +82,6 @@ static void st_gl_flush( struct st_context *st, uint pipeFlushFlags )
= st_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
struct pipe_surface *front_surf = strb->surface;
- /* If we aren't rendering to the frontbuffer, this is a noop.
- * This should be uncontroversial for glFlush, though people may
- * feel more strongly about glFinish.
- *
- * Additionally, need to make sure that the frontbuffer_dirty
- * flag really gets set on frontbuffer rendering.
- */
- st->pipe->flush( st->pipe, pipeFlushFlags );
-
/* Hook for copying "fake" frontbuffer if necessary:
*/
st->pipe->winsys->flush_frontbuffer( st->pipe->winsys, front_surf,
@@ -103,7 +96,18 @@ static void st_gl_flush( struct st_context *st, uint pipeFlushFlags )
*/
static void st_glFlush(GLcontext *ctx)
{
- st_gl_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE);
+ st_gl_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+}
+
+
+void st_finish( struct st_context *st )
+{
+ struct pipe_fence_handle *fence;
+
+ st_gl_flush(st, PIPE_FLUSH_RENDER_CACHE, &fence);
+
+ st->pipe->winsys->fence_finish(st->pipe->winsys, fence, 0);
+ st->pipe->winsys->fence_reference(st->pipe->winsys, &fence, NULL);
}
@@ -112,7 +116,7 @@ static void st_glFlush(GLcontext *ctx)
*/
static void st_glFinish(GLcontext *ctx)
{
- st_gl_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_WAIT);
+ st_finish( ctx->st );
}