mesa: Only end render-to-texture at bind time for drawbuffers.
authorEric Anholt <eric@anholt.net>
Fri, 10 Feb 2012 20:05:16 +0000 (12:05 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 17 Feb 2012 21:31:27 +0000 (13:31 -0800)
If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?

src/mesa/main/fbobject.c

index 7f9ba4a92b49c2c5b70d85f5fda36799fba1bcb8..6ee062d0b119c4cce77124a8913f7cf947d371f8 100644 (file)
@@ -1758,11 +1758,8 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
    if (bindDrawBuf) {
       FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
-      /* check if old read/draw buffers were render-to-texture */
-      if (!bindReadBuf)
-         check_end_texture_render(ctx, oldReadFb);
-
-      if (oldDrawFb != oldReadFb)
+      /* check if old framebuffer had any texture attachments */
+      if (oldDrawFb)
          check_end_texture_render(ctx, oldDrawFb);
 
       /* check if newly bound framebuffer has any texture attachments */