mesa: Skip clearing color buffers when color writes are disabled.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Mar 2014 22:58:02 +0000 (15:58 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Mar 2014 21:45:03 +0000 (14:45 -0700)
commit630bf288de09e0fcf9734b297042cb751ec38376
tree522c5bcbf5b7264a67b42aa0af92911294eab13c
parent92234b1b2aaf6ba68e786498806cefd4bd99dabc
mesa: Skip clearing color buffers when color writes are disabled.

WebGL Aquarium in Chrome 24 actually hits this.

v2: Move to core Mesa (wisely suggested by Ian); only consider
    components which actually exist.

v3: Use _mesa_format_has_color_component to determine whether components
    actually exist, fixing alpha format handling.

v4: Add a comment, as requested by Brian.  No actual code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
src/mesa/main/clear.c