diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2014-03-24 01:16:57 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2014-03-24 14:38:51 -0700 |
commit | 92234b1b2aaf6ba68e786498806cefd4bd99dabc (patch) | |
tree | a9d5beedbb0f1bde9c00b5614ff9d3bfaa65e3e9 /src/mesa/main/formats.h | |
parent | 0d99aef6c8a940e52afcbffa7091ff9c854ba120 (diff) | |
download | external_mesa3d-92234b1b2aaf6ba68e786498806cefd4bd99dabc.zip external_mesa3d-92234b1b2aaf6ba68e786498806cefd4bd99dabc.tar.gz external_mesa3d-92234b1b2aaf6ba68e786498806cefd4bd99dabc.tar.bz2 |
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>
Diffstat (limited to 'src/mesa/main/formats.h')
-rw-r--r-- | src/mesa/main/formats.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 3079f03..89bd021 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -34,6 +34,7 @@ #include <GL/gl.h> +#include <stdbool.h> #ifdef __cplusplus @@ -474,6 +475,9 @@ _mesa_get_uncompressed_format(mesa_format format); extern GLuint _mesa_format_num_components(mesa_format format); +extern bool +_mesa_format_has_color_component(mesa_format format, int component); + GLboolean _mesa_format_matches_format_and_type(mesa_format mesa_format, GLenum format, GLenum type, |