mesa: _mesa_is_format_integer() function

This commit is contained in:
Brian Paul
2010-10-23 09:27:12 -06:00
parent a0bc8eeb32
commit f5ed39e7e6
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -945,6 +945,7 @@ _mesa_get_format_bits(gl_format format, GLenum pname)
* GL_UNSIGNED_NORMALIZED = unsigned int representing [0,1]
* GL_SIGNED_NORMALIZED = signed int representing [-1, 1]
* GL_UNSIGNED_INT = an ordinary unsigned integer
* GL_INT = an ordinary signed integer
* GL_FLOAT = an ordinary float
*/
GLenum
@@ -1006,6 +1007,17 @@ _mesa_is_format_packed_depth_stencil(gl_format format)
}
/**
* Is the given format a signed/unsigned integer format?
*/
GLboolean
_mesa_is_format_integer(gl_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.
* \return GL_LINEAR or GL_SRGB
+3
View File
@@ -199,6 +199,9 @@ _mesa_is_format_compressed(gl_format format);
extern GLboolean
_mesa_is_format_packed_depth_stencil(gl_format format);
extern GLboolean
_mesa_is_format_integer(gl_format format);
extern GLenum
_mesa_get_format_color_encoding(gl_format format);