In a few places we need to allocate space for some number of generic
pixels. Use this new define instead of a magic number like 16 or
4 * sizeof(GLuint).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
{
const struct gl_format_info *info = _mesa_get_format_info(format);
ASSERT(info->BytesPerBlock);
+ ASSERT(info->BytesPerBlock <= MAX_PIXEL_BYTES ||
+ _mesa_is_format_compressed(format));
return info->BytesPerBlock;
}
#define MESA_UNSIGNED_BYTE_4_4 (GL_UNSIGNED_BYTE<<1)
+/**
+ * Max number of bytes for any non-compressed pixel format below, or for
+ * intermediate pixel storage in Mesa. This should never be less than
+ * 16. Maybe 32 someday?
+ */
+#define MAX_PIXEL_BYTES 16
+
+
/**
* Mesa texture/renderbuffer image formats.
*/