mesa: Fix bad-enum/no-buffer error handling for buffer object functions.
authorEric Anholt <eric@anholt.net>
Thu, 26 Jan 2012 00:30:26 +0000 (16:30 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 3 Feb 2012 08:24:02 +0000 (09:24 +0100)
commitf20fb80a916d9f88dbc7efc43d4c31e038cb70c6
tree56c9163fe0693dd6347fddafb92460bfc5aadc2f
parent84a1273e7fe1216a4724ab13cd061a12b48893c2
mesa: Fix bad-enum/no-buffer error handling for buffer object functions.

For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/bufferobj.c