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
/**
- * 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;
}