glDrawBuffers(n==0) is valid
authorRobert Ellison <papillo@i965-laptop.(none)>
Thu, 12 Feb 2009 20:47:36 +0000 (13:47 -0700)
committerRobert Ellison <papillo@i965-laptop.(none)>
Thu, 12 Feb 2009 20:47:36 +0000 (13:47 -0700)
commit5de5ab428cf5516d91daa3f193a76b0d87853f55
tree4212b37503d12c3b8d3adc52ba3ab0e94f090faa
parentf1a59a6dd7b7b0523db191d82b3af1a841c6475d
glDrawBuffers(n==0) is valid

According to the GL spec, calling glDrawBuffers() with n == 0 is a
valid operation (and essentially prevents drawing to any buffers).
But _msa_DrawBuffersARB() was producing a GL_INVALID_VALUE error in
this case.

This fix adjusts the error check, and makes a small change to the
ctx->Driver.DrawBuffer() call below to ensure that, if n == 0,
Driver.DrawBuffer() is called with GL_NONE and that buffers[0] is
*not* referenced in this case (since we don't know whether it is valid).

Internal identifier: 365833
src/mesa/main/buffers.c