Mesa (master): mesa: fix bug in _mesa_is_format_integer()

Brian Paul brianp at kemper.freedesktop.org
Wed Oct 27 02:26:28 UTC 2010


Module: Mesa
Branch: master
Commit: ab50148fdafeb6496b4ab684e5b9a2355ccf542c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab50148fdafeb6496b4ab684e5b9a2355ccf542c

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Oct 26 20:23:57 2010 -0600

mesa: fix bug in _mesa_is_format_integer()

We only want to return true if it's an integer _color_ format, not a
depth and/or stencil format.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31143

---

 src/mesa/main/formats.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 3e78693..f604e23 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1008,13 +1008,16 @@ _mesa_is_format_packed_depth_stencil(gl_format format)
 
 
 /**
- * Is the given format a signed/unsigned integer format?
+ * Is the given format a signed/unsigned integer color 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 (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT) &&
+      info->BaseFormat != GL_DEPTH_COMPONENT &&
+      info->BaseFormat != GL_DEPTH_STENCIL &&
+      info->BaseFormat != GL_STENCIL_INDEX;
 }
 
 




More information about the mesa-commit mailing list