[Mesa-dev] [PATCH 1/1] mesa: Call updated_drawbuffers() if the buffer count changes in _mesa_drawbuffers().

Henri Verbeet hverbeet at gmail.com
Mon Jul 25 13:23:47 PDT 2011


Without this we'd miss an update when doing a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Henri Verbeet <hverbeet at gmail.com>
---
 src/mesa/main/buffers.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index a75c9c2..88fe0b1 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -445,7 +445,10 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
          fb->ColorDrawBuffer[buf] = GL_NONE;
          buf++;
       }
-      fb->_NumColorDrawBuffers = count;
+      if (fb->_NumColorDrawBuffers != count) {
+         updated_drawbuffers(ctx);
+         fb->_NumColorDrawBuffers = count;
+      }
    }
 
    if (fb->Name == 0) {
-- 
1.7.2.5



More information about the mesa-dev mailing list