diff options
author | marha <marha@users.sourceforge.net> | 2011-09-26 17:08:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-09-26 17:08:48 +0200 |
commit | 95acf9816e008fa46a6c2fa2f35500deb358bb69 (patch) | |
tree | ad86feed38d780515cf9da608c5ea21eed04e17d /mesalib/src/mesa/main/buffers.c | |
parent | 4f67039e9191d5251c39069bd791a05c5cf22022 (diff) | |
parent | 873965b49f283ad028dd4e0e5b7e93a758c84993 (diff) | |
download | vcxsrv-95acf9816e008fa46a6c2fa2f35500deb358bb69.tar.gz vcxsrv-95acf9816e008fa46a6c2fa2f35500deb358bb69.tar.bz2 vcxsrv-95acf9816e008fa46a6c2fa2f35500deb358bb69.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
libXmu/src/CmapAlloc.c
Diffstat (limited to 'mesalib/src/mesa/main/buffers.c')
-rw-r--r-- | mesalib/src/mesa/main/buffers.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c index a75c9c2e7..adea0f5f7 100644 --- a/mesalib/src/mesa/main/buffers.c +++ b/mesalib/src/mesa/main/buffers.c @@ -381,6 +381,7 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, { struct gl_framebuffer *fb = ctx->DrawBuffer; GLbitfield mask[MAX_DRAW_BUFFERS]; + GLuint buf; if (!destMask) { /* compute destMask values now */ @@ -410,13 +411,10 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, destMask0 &= ~(1 << bufIndex); } fb->ColorDrawBuffer[0] = buffers[0]; - if (fb->_NumColorDrawBuffers != count) { - updated_drawbuffers(ctx); - fb->_NumColorDrawBuffers = count; - } + fb->_NumColorDrawBuffers = count; } else { - GLuint buf, count = 0; + GLuint count = 0; for (buf = 0; buf < n; buf++ ) { if (destMask[buf]) { GLint bufIndex = _mesa_ffs(destMask[buf]) - 1; @@ -436,21 +434,22 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, } fb->ColorDrawBuffer[buf] = buffers[buf]; } - /* set remaining outputs to -1 (GL_NONE) */ - while (buf < ctx->Const.MaxDrawBuffers) { - if (fb->_ColorDrawBufferIndexes[buf] != -1) { - updated_drawbuffers(ctx); - fb->_ColorDrawBufferIndexes[buf] = -1; - } - fb->ColorDrawBuffer[buf] = GL_NONE; - buf++; - } fb->_NumColorDrawBuffers = count; } + /* set remaining outputs to -1 (GL_NONE) */ + for (buf = fb->_NumColorDrawBuffers; buf < ctx->Const.MaxDrawBuffers; buf++) { + if (fb->_ColorDrawBufferIndexes[buf] != -1) { + updated_drawbuffers(ctx); + fb->_ColorDrawBufferIndexes[buf] = -1; + } + } + for (buf = n; buf < ctx->Const.MaxDrawBuffers; buf++) { + fb->ColorDrawBuffer[buf] = GL_NONE; + } + if (fb->Name == 0) { /* also set context drawbuffer state */ - GLuint buf; for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { if (ctx->Color.DrawBuffer[buf] != fb->ColorDrawBuffer[buf]) { updated_drawbuffers(ctx); |