From 7d9e075917cb93e182c96c325e04856a788f7dda Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 11 Feb 2013 17:12:31 +0000 Subject: [PATCH] Bind the framebuffer before calling glDiscardFramebuffer This patch just adds a call to _cogl_framebuffer_flush_state to ensure the correct framebuffer is bound before discarding its buffers. Previously it would presumably just discard the buffers of whatever framebuffer happened to be used last. Reviewed-by: Robert Bragg (cherry picked from commit 37c390a5b33d4f65ff6c834e9be2f8de716635ee) --- cogl/driver/gl/cogl-framebuffer-gl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/driver/gl/cogl-framebuffer-gl.c index b6f58ba95..64cfdf561 100644 --- a/cogl/driver/gl/cogl-framebuffer-gl.c +++ b/cogl/driver/gl/cogl-framebuffer-gl.c @@ -1023,6 +1023,9 @@ _cogl_framebuffer_gl_discard_buffers (CoglFramebuffer *framebuffer, attachments[i++] = GL_STENCIL_ATTACHMENT; } + _cogl_framebuffer_flush_state (framebuffer, + framebuffer, + COGL_FRAMEBUFFER_STATE_BIND); GE (ctx, glDiscardFramebuffer (GL_FRAMEBUFFER, i, attachments)); } #endif /* GL_EXT_discard_framebuffer */