diff options
Diffstat (limited to 'mesalib/src/mesa/main/buffers.c')
-rw-r--r-- | mesalib/src/mesa/main/buffers.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c index b13a7af65..140cf6e82 100644 --- a/mesalib/src/mesa/main/buffers.c +++ b/mesalib/src/mesa/main/buffers.c @@ -494,10 +494,11 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, } /* - * If n==1, destMask[0] may have up to four bits set. + * destMask[0] may have up to four bits set + * (ex: glDrawBuffer(GL_FRONT_AND_BACK)). * Otherwise, destMask[x] can only have one bit set. */ - if (n == 1) { + if (_mesa_bitcount(destMask[0]) > 1) { GLuint count = 0, destMask0 = destMask[0]; while (destMask0) { GLint bufIndex = ffs(destMask0) - 1; @@ -566,16 +567,11 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, void _mesa_update_draw_buffers(struct gl_context *ctx) { - GLenum buffers[MAX_DRAW_BUFFERS]; - GLuint i; - /* should be a window system FBO */ assert(_mesa_is_winsys_fbo(ctx->DrawBuffer)); - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) - buffers[i] = ctx->Color.DrawBuffer[i]; - - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL); + _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, + ctx->Color.DrawBuffer, NULL); } |