diff options
author | Brian Paul <brianp@vmware.com> | 2014-08-08 15:01:50 -0600 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2014-08-11 14:38:22 -0700 |
commit | 5532cf9d7e6844191b97730da5fa0b4849998c6b (patch) | |
tree | 06d579d9366ffc52c70f07910df7a497fffa6c09 /src/mesa | |
parent | bca8865aecaf9866e56ee415b100a442c1ef473c (diff) |
mesa: fix assertion in _mesa_drawbuffers()
Fixes failed assertion when _mesa_update_draw_buffers() was called
with GL_DRAW_BUFFER == GL_FRONT_AND_BACK. The piglit gl30basic hit
this.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 39b40ad144f5f587e505b45048e33a03641ba857)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/buffers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index b13a7af65a6..6b4fac9f58d 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -494,10 +494,11 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers, } /* - * If n==1, destMask[0] may have up to four bits set. + * destMask[0] may have up to four bits set + * (ex: glDrawBuffer(GL_FRONT_AND_BACK)). * Otherwise, destMask[x] can only have one bit set. */ - if (n == 1) { + if (_mesa_bitcount(destMask[0]) > 1) { GLuint count = 0, destMask0 = destMask[0]; while (destMask0) { GLint bufIndex = ffs(destMask0) - 1; |