mesa: Add helper function _mesa_is_format_integer()

This function will be used in the following patch.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3135668254)
This commit is contained in:
Anuj Phogat 2014-03-25 13:00:12 -07:00 committed by Carl Worth
parent 657a185dc0
commit 66765bb6a6
2 changed files with 12 additions and 0 deletions

View file

@ -2012,6 +2012,15 @@ _mesa_is_format_signed(mesa_format format)
}
}
/**
* Is the given format an integer format?
*/
GLboolean
_mesa_is_format_integer(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT);
}
/**
* Return color encoding for given format.

View file

@ -682,6 +682,9 @@ _mesa_is_format_unsigned(mesa_format format);
extern GLboolean
_mesa_is_format_signed(mesa_format format);
extern GLboolean
_mesa_is_format_integer(mesa_format format);
extern GLenum
_mesa_get_format_color_encoding(mesa_format format);