[Mesa-dev] [PATCH 1/7] mesa: handle GL_NONE draw buffers correctly in glClear

Marek Olšák maraeo at gmail.com
Wed Jan 8 09:23:14 PST 2014


From: Marek Olšák <marek.olsak at amd.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;
+            }
          }
       }
 
-- 
1.8.3.2



More information about the mesa-dev mailing list