diff options
author | Brian Paul <[email protected]> | 2011-12-05 20:40:48 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-12-08 08:56:31 -0700 |
commit | db247dd7b37e22bf9545d8cb8360e06d68e50912 (patch) | |
tree | e185b37d999a8c2a8b9fe59f962f3525d5b428e5 /src/mesa/main/formats.c | |
parent | eb3e1d8888ea37c7500ab964e8523a52a401bade (diff) |
mesa: add MAX_PIXEL_BYTES define
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r-- | src/mesa/main/formats.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 595da773ba5..1f83a5368d7 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1553,6 +1553,8 @@ _mesa_get_format_bytes(gl_format format) { 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; } |