i965: glClearBuffer() should only clear a single buffer.
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 31 Mar 2014 12:17:08 +0000 (14:17 +0200)
committerChris Forbes <chrisf@ijw.co.nz>
Sun, 13 Apr 2014 00:28:25 +0000 (12:28 +1200)
commita5957f7bc5e3618243f03cf9459394f9a83e5971
tree0caeedd6f62d536dee9e5000a3a9fae43d0b9e49
parent26224d3e00cb00e45145d4fd22cd7495eecad9e1
i965: glClearBuffer() should only clear a single buffer.

glClearBuffer() is currently clearing all active draw color buffers (all
buffers that have not been set to GL_NONE when calling glDrawBuffers) instead
of only clearing the one it receives as parameter. Altough brw_clear()
receives a bit mask indicating the color buffers that should be cleared,
this mask is ignored when calling brw_blorp_clear_color().

This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test.

The patch provides the bit mask to brw_blorp_clear_color() so it can limit
clearing to the color buffers present in the mask.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
src/mesa/drivers/dri/i965/brw_clear.c