Mesa (master): mesa: added assertion, another comment

Brian Paul brianp at kemper.freedesktop.org
Tue Nov 3 16:53:23 UTC 2009


Module: Mesa
Branch: master
Commit: 2d11c48223adb78353ca32f0cc07941957310389
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d11c48223adb78353ca32f0cc07941957310389

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Nov  2 12:58:51 2009 -0700

mesa: added assertion, another comment

---

 src/mesa/main/buffers.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index d8b5f3b..b5acda8 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -344,7 +344,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
 
 /**
  * Helper function to set the GL_DRAW_BUFFER state in the context and
- * current FBO.
+ * current FBO.  Called via glDrawBuffer(), glDrawBuffersARB()
  *
  * All error checking will have been done prior to calling this function
  * so nothing should go wrong at this point.
@@ -392,6 +392,8 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
       GLuint buf, count = 0;
       for (buf = 0; buf < n; buf++ ) {
          if (destMask[buf]) {
+            /* only one bit should be set in the destMask[buf] field */
+            ASSERT(_mesa_bitcount(destMask[buf]) == 1);
             fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1;
             fb->ColorDrawBuffer[buf] = buffers[buf];
             count = buf + 1;




More information about the mesa-commit mailing list