mesa: Introduce a _mesa_format_has_color_component() helper.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Mar 2014 08:16:57 +0000 (01:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Mar 2014 21:38:51 +0000 (14:38 -0700)
commit92234b1b2aaf6ba68e786498806cefd4bd99dabc
treea9d5beedbb0f1bde9c00b5614ff9d3bfaa65e3e9
parent0d99aef6c8a940e52afcbffa7091ff9c854ba120
mesa: Introduce a _mesa_format_has_color_component() helper.

When considering color write masks, we often want to know whether an
RGBA component actually contains any meaningful data.  This function
provides an easy way to answer that question, and handles luminance,
intensity, and alpha formats correctly.

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/formats.c
src/mesa/main/formats.h