Merge branch 'mesa_7_7_branch'
authorBrian Paul <brianp@vmware.com>
Tue, 26 Jan 2010 20:23:25 +0000 (13:23 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 26 Jan 2010 20:25:53 +0000 (13:25 -0700)
Merging was easier than cherry picking in this instance.

1  2 
src/mesa/main/fbobject.c

diff --combined src/mesa/main/fbobject.c
index 0556f168501f66a827836032f7346178ab4f8a61,0e83a4e87fafda08eb62e9c0142fb11aac7ade40..de1b524c0b5db57fbfcd4d023a2fa1bbb905083f
@@@ -858,9 -858,6 +858,9 @@@ _mesa_GenRenderbuffersEXT(GLsizei n, GL
   *
   * \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT
   *  GL_DEPTH_STENCIL_EXT or zero if error.
 + *
 + * XXX in the future when we support red-only and red-green formats
 + * we'll also return GL_RED and GL_RG.
   */
  GLenum
  _mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat)
@@@ -1353,15 -1350,26 +1353,26 @@@ _mesa_DeleteFramebuffersEXT(GLsizei n, 
              ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]);
  
              /* check if deleting currently bound framebuffer object */
-             if (fb == ctx->DrawBuffer) {
-                /* bind default */
-                ASSERT(fb->RefCount >= 2);
-                _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+             if (ctx->Extensions.EXT_framebuffer_blit) {
+                /* separate draw/read binding points */
+                if (fb == ctx->DrawBuffer) {
+                   /* bind default */
+                   ASSERT(fb->RefCount >= 2);
+                   _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+                }
+                if (fb == ctx->ReadBuffer) {
+                   /* bind default */
+                   ASSERT(fb->RefCount >= 2);
+                   _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+                }
              }
-             if (fb == ctx->ReadBuffer) {
-                /* bind default */
-                ASSERT(fb->RefCount >= 2);
-                _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+             else {
+                /* only one binding point for read/draw buffers */
+                if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) {
+                   /* bind default */
+                   ASSERT(fb->RefCount >= 2);
+                   _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+                }    
              }
  
            /* remove from hash table immediately, to free the ID */