mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().
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 <fa9c81d52bf7e42f4eca779fafc7ac8cc1c787d8@gmail.com>
Reviewed-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>

zeux/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,mapbox/glsl-optimizer,metora/MesaGLSLCompiler,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,metora/MesaGLSLCompiler,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer