fix bug 13978: glDrawBuffersARB() didn't set all necessary state
authorBrian <brian.paul@tungstengraphics.com>
Wed, 9 Jan 2008 21:19:50 +0000 (14:19 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 9 Jan 2008 21:20:51 +0000 (14:20 -0700)
src/mesa/main/buffers.c

index 209997729191d0366580cf5e11f9a3faee89af0c..b08095465d86f9c1939f5e65cc4575527ae6cd26 100644 (file)
@@ -540,6 +540,7 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
       for (buf = 0; buf < n; buf++ ) {
          if (destMask[buf]) {
             fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1;
+            fb->ColorDrawBuffer[buf] = buffers[buf];
             count = buf + 1;
          }
          else {
@@ -549,6 +550,7 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
       /* set remaining outputs to -1 (GL_NONE) */
       while (buf < ctx->Const.MaxDrawBuffers) {
          fb->_ColorDrawBufferIndexes[buf] = -1;
+         fb->ColorDrawBuffer[buf] = GL_NONE;
          buf++;
       }
       fb->_NumColorDrawBuffers = count;