From: Marek Olšák Date: Wed, 8 Jan 2014 00:23:43 +0000 (+0100) Subject: mesa: handle GL_NONE draw buffers correctly in glClear X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9bf9578c1b79e5622a2325f1a2bb80fcf0e22a6d;p=mesa.git mesa: handle GL_NONE draw buffers correctly in glClear Reviewed-by: Brian Paul --- diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index f0b525fa017..fd5bb35b957 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -179,7 +179,11 @@ _mesa_Clear( GLbitfield mask ) if (mask & GL_COLOR_BUFFER_BIT) { GLuint i; for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); + GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; + + if (buf >= 0) { + bufferMask |= 1 << buf; + } } }