r300g: better describe another flush and move it closer to the real problem
[mesa.git] / src / mesa / main / buffers.c
index e76cf87cb02d55771772e06ce6a0f6e932922f8e..fb30b5996093542fd9903db8d95c15f381ad923a 100644 (file)
@@ -35,8 +35,6 @@
 #include "colormac.h"
 #include "context.h"
 #include "enums.h"
-#include "fbobject.h"
-#include "state.h"
 
 
 #define BAD_MASK ~0u
@@ -382,8 +380,6 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
     */
    if (n == 1) {
       GLuint count = 0, destMask0 = destMask[0];
-      /* init to -1 to help catch errors */
-      //fb->_ColorDrawBufferIndexes[0] = -1;
       while (destMask0) {
          GLint bufIndex = _mesa_ffs(destMask0) - 1;
          if (fb->_ColorDrawBufferIndexes[count] != bufIndex) {
@@ -424,9 +420,10 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
       while (buf < ctx->Const.MaxDrawBuffers) {
          if (fb->_ColorDrawBufferIndexes[buf] != -1) {
             fb->_ColorDrawBufferIndexes[buf] = -1;
-            buf++;
+            newState = GL_TRUE;
          }
          fb->ColorDrawBuffer[buf] = GL_NONE;
+         buf++;
       }
       fb->_NumColorDrawBuffers = count;
    }