summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-10-23 09:27:12 -0600
committerBrian Paul <[email protected]>2010-10-23 10:19:29 -0600
commitf5ed39e7e6dd31ea60477475d97d8a5ce6946ccc (patch)
tree7743e86f3ba715723d8428db10cafd2550872eec /src
parenta0bc8eeb3224eec1e713fb9885f5d02c21b30c14 (diff)
mesa: _mesa_is_format_integer() function
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/formats.c12
-rw-r--r--src/mesa/main/formats.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 654ea038a55..3e786934771 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -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
@@ -1007,6 +1008,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
*/
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 7674d8eaa4e..73d85f2245f 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -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);