Commit f1f022db authored by Haihao Xiang's avatar Haihao Xiang

mesa: Fix the size per pixel for packed pixel format data type.

parent 241c0bfc
......@@ -61,7 +61,7 @@
/**
* \return GL_TRUE if type is packed pixel type, GL_FALSE otherwise.
*/
static GLboolean
GLboolean
_mesa_type_is_packed(GLenum type)
{
switch (type) {
......
......@@ -36,6 +36,9 @@ _mesa_swap2( GLushort *p, GLuint n );
extern void
_mesa_swap4( GLuint *p, GLuint n );
extern GLboolean
_mesa_type_is_packed(GLenum type);
extern GLint
_mesa_sizeof_type( GLenum type );
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment