mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 1 Nov 2011 22:11:12 +0000 (15:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 7 Nov 2011 21:32:22 +0000 (13:32 -0800)
commit295e07ef51eded34ed6374823f15c0b5d13ad2d4
tree758dc86b38c1dd8651bda51b93cf23d9ff7f4ee7
parentf4fb0be605790c55abd7d66564486e5860721c21
mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL

The spec says "Only ClearBufferiv should be used to clear
stencil buffers." and "Only ClearBufferfv should be used to clear
depth buffers."  However, on the following page it also says:

    "The result of ClearBuffer is undefined if no conversion between
    the type of the specified value and the type of the buffer being
    cleared is defined (for example, if ClearBufferiv is called for a
    fixed- or floating-point buffer, or if ClearBufferfv is called
    for a signed or unsigned integer buffer). *This is not an error.*"

Emphasis mine.

Fixes problems with piglit's clearbuffer-invalid-drawbuffer test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/clear.c