mesa: Also set the remaining draw buffers to GL_NONE when updating just the first...
authorHenri Verbeet <hverbeet@gmail.com>
Thu, 22 Sep 2011 21:46:34 +0000 (23:46 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Sun, 25 Sep 2011 13:00:21 +0000 (15:00 +0200)
commita4d72189b271664501338cc93107845f3d40ae54
tree7a30472fd849093a41b41f8dd9cb0a3786388543
parent4703f50e96fe3a9db039f59e154e15c06c3f8367
mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().

Without this we'd miss the last update in a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called
updated_drawbuffers() when the buffer count changed, but later realized that
was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for
output colors beyond <n> is set to NONE.", and this is queryable state.
This fixes piglit arb_draw_buffers-state_change.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/buffers.c