aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2012-06-25 10:52:39 -0700
committerJordan Justen <[email protected]>2012-07-21 16:49:42 -0700
commit9ad8f431b2a47060bf05517246ab0fa8d249c800 (patch)
tree579bb10a4bd1f1827ff4b38242f1b25d4e01fca0 /src/mesa/main/formats.c
parente2e7b467d8a6567437823767af74004a396f1c82 (diff)
mesa: add glformats integer type/format detection routines
_mesa_is_integer_format is moved to formats.c and renamed as _mesa_is_enum_format_integer. _mesa_is_format_unsigned, _mesa_is_type_integer, _mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer are added. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index c65c9c2e14f..5dd9f085a85 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -28,6 +28,7 @@
#include "formats.h"
#include "mfeatures.h"
#include "macros.h"
+#include "glformats.h"
/**
@@ -1712,6 +1713,17 @@ _mesa_is_format_integer_color(gl_format format)
/**
+ * Is the given format an unsigned integer format?
+ */
+GLboolean
+_mesa_is_format_unsigned(gl_format format)
+{
+ const struct gl_format_info *info = _mesa_get_format_info(format);
+ return _mesa_is_type_unsigned(info->DataType);
+}
+
+
+/**
* Return color encoding for given format.
* \return GL_LINEAR or GL_SRGB
*/
@@ -2933,3 +2945,4 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
return GL_FALSE;
}
+