aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-08 01:23:43 +0100
committerMarek Olšák <[email protected]>2014-01-13 15:48:07 +0100
commit9bf9578c1b79e5622a2325f1a2bb80fcf0e22a6d (patch)
tree4f96b954ee5853d91ab41075a08a6761468525a9 /src/mesa/main/clear.c
parent4e549ddb500cf677b6fa16d9ebdfa67cc23da097 (diff)
mesa: handle GL_NONE draw buffers correctly in glClear
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r--src/mesa/main/clear.c6
1 files changed, 5 insertions, 1 deletions
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;
+ }
}
}