From: Brian Paul Date: Fri, 29 Oct 2010 03:17:42 +0000 (-0600) Subject: mesa: additional integer formats in _mesa_bytes_per_pixel() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a3566cec02f4fc3fef5a29b31ca990d2c08e293;p=mesa.git mesa: additional integer formats in _mesa_bytes_per_pixel() --- diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index a945ba2e146..6b12f6a48c6 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -315,13 +315,15 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type ) return comps * sizeof(GLhalfARB); case GL_UNSIGNED_BYTE_3_3_2: case GL_UNSIGNED_BYTE_2_3_3_REV: - if (format == GL_RGB || format == GL_BGR) + if (format == GL_RGB || format == GL_BGR || + format == GL_RGB_INTEGER_EXT || format == GL_BGR_INTEGER_EXT) return sizeof(GLubyte); else return -1; /* error */ case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: - if (format == GL_RGB || format == GL_BGR) + if (format == GL_RGB || format == GL_BGR || + format == GL_RGB_INTEGER_EXT || format == GL_BGR_INTEGER_EXT) return sizeof(GLushort); else return -1; /* error */ @@ -329,7 +331,8 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type ) case GL_UNSIGNED_SHORT_4_4_4_4_REV: case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: - if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT) + if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT || + format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) return sizeof(GLushort); else return -1; @@ -337,7 +340,8 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type ) case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT) + if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT || + format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) return sizeof(GLuint); else return -1;