Mesa (master): mesa: handle GL_NONE draw buffers correctly in glClear
Marek Olšák
mareko at kemper.freedesktop.org
Mon Jan 13 14:50:08 UTC 2014
Module: Mesa
Branch: master
Commit: 9bf9578c1b79e5622a2325f1a2bb80fcf0e22a6d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9bf9578c1b79e5622a2325f1a2bb80fcf0e22a6d
Author: Marek Olšák <marek.olsak at amd.com>
Date: Wed Jan 8 01:23:43 2014 +0100
mesa: handle GL_NONE draw buffers correctly in glClear
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/main/clear.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index f0b525f..fd5bb35 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;
+ }
}
}
More information about the mesa-commit
mailing list