summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-02-16 17:21:10 +0100
committerFrancisco Jerez <[email protected]>2010-02-17 23:15:48 +0100
commitf455ca6490fcb65781b21f81c7117bd923e250d1 (patch)
treede022d61e66ab09d61aa3b48efccec3e22689e41 /src/mesa/state_tracker
parent7ccbeb41acd2f5c416005bd48c11996a054a869a (diff)
st/mesa: Make the frontbuffer visible on st_flush(PIPE_FLUSH_FRAME).
So far the frontbuffer was only being flushed on st_glFlush and st_glFinish, however, a co-state tracker may need to make sure that any frontbuffer changes are already on its way to the actual front. The dri2 state tracker will need this for event-driven GL applications to resize properly (It could also be done calling "dri_flush_frontbuffer", but that way we would flush unnecessarily in the double-buffered case). Additionally this patch avoids flushing the mesa rendering cache if PIPE_FLUSH_RENDER_CACHE wasn't specified.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 1329f807bc9..0ddfce46823 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -91,7 +91,8 @@ display_front_buffer(struct st_context *st)
void st_flush( struct st_context *st, uint pipeFlushFlags,
struct pipe_fence_handle **fence )
{
- FLUSH_CURRENT(st->ctx, 0);
+ if (pipeFlushFlags & PIPE_FLUSH_RENDER_CACHE)
+ FLUSH_CURRENT(st->ctx, 0);
/* Release any vertex buffers that might potentially be accessed in
* successive frames:
@@ -102,6 +103,10 @@ void st_flush( struct st_context *st, uint pipeFlushFlags,
util_gen_mipmap_flush(st->gen_mipmap);
st->pipe->flush( st->pipe, pipeFlushFlags, fence );
+
+ if ((pipeFlushFlags & PIPE_FLUSH_FRAME) &&
+ is_front_buffer_dirty(st))
+ display_front_buffer(st);
}
@@ -135,10 +140,6 @@ static void st_glFlush(GLcontext *ctx)
* problems that need to be fixed elsewhere.
*/
st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
-
- if (is_front_buffer_dirty(st)) {
- display_front_buffer(st);
- }
}
@@ -150,10 +151,6 @@ static void st_glFinish(GLcontext *ctx)
struct st_context *st = ctx->st;
st_finish(st);
-
- if (is_front_buffer_dirty(st)) {
- display_front_buffer(st);
- }
}