[cogl/cogl-1.14] Bind the framebuffer before calling glDiscardFramebuffer



commit 7d9e075917cb93e182c96c325e04856a788f7dda
Author: Neil Roberts <neil linux intel com>
Date:   Mon Feb 11 17:12:31 2013 +0000

    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 <robert linux intel com>
    
    (cherry picked from commit 37c390a5b33d4f65ff6c834e9be2f8de716635ee)

 cogl/driver/gl/cogl-framebuffer-gl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/driver/gl/cogl-framebuffer-gl.c
index b6f58ba..64cfdf5 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]