[Cogl] [PATCH 2/2] Bind the framebuffer before calling glDiscardFramebuffer

Neil Roberts neil at linux.intel.com
Mon Feb 11 09:36:49 PST 2013


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.
---
 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 abd3b4a..1e7d1b7 100644
--- a/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -1033,6 +1033,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));
     }
 }
-- 
1.7.11.3.g3c3efa5



More information about the Cogl mailing list