summaryrefslogtreecommitdiff
path: root/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2009-01-06 15:37:45 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2009-01-06 15:37:45 +0800
commitf1f022dbb103947b0edf5ae984fcff00f6a8e539 (patch)
treead3fce7397baf8c23a38c2a9b9c90733862750be /src/mesa/main/mipmap.c
parent241c0bfc985363bb15e6cc0eca859c6ec36d1b35 (diff)
mesa: Fix the size per pixel for packed pixel format data type.
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r--src/mesa/main/mipmap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 9e051ace25..3dd4b3391b 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -41,7 +41,11 @@ bytes_per_pixel(GLenum datatype, GLuint comps)
{
GLint b = _mesa_sizeof_packed_type(datatype);
assert(b >= 0);
- return b * comps;
+
+ if (_mesa_type_is_packed(datatype))
+ return b;
+ else
+ return b * comps;
}