From af37a1029ff86d082b55cebef6f59d227ab22da8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 8 May 2010 16:58:14 -0400 Subject: [PATCH] cogl-framebuffer: Flush journal when creating fbo Since framebuffer state is not flushed prior to replaying the journal, the trick of marking the framebuffer dirty prior to calling glBindFramebuffer() doesn't work... the outstanding journal entries will get replayed to the newly created framebuffer. Fix this by flushing the journal as well. http://bugzilla.openedhand.com/show_bug.cgi?id=2110 Signed-off-by: Robert Bragg --- clutter/cogl/cogl/cogl-framebuffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl/cogl-framebuffer.c b/clutter/cogl/cogl/cogl-framebuffer.c index 082abf5f6..3f01ca58e 100644 --- a/clutter/cogl/cogl/cogl-framebuffer.c +++ b/clutter/cogl/cogl/cogl-framebuffer.c @@ -273,8 +273,11 @@ try_creating_fbo (CoglOffscreen *offscreen, ) return FALSE; - /* We are about to generate and bind a new fbo, so when next flushing the - * journal, we will need to rebind the current framebuffer... */ + /* We are about to generate and bind a new fbo, so we pretend to change framebuffer + * state so that the old framebuffer will be rebound again before drawing. + * The framebuffer state can't be changed while their are active entries, so flush + * first. */ + _cogl_journal_flush (); ctx->dirty_bound_framebuffer = 1; /* Generate framebuffer */