From: Chris Forbes Date: Thu, 22 Nov 2012 03:23:19 +0000 (+1300) Subject: i965: implement get_size for 2_10_10_10 formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9a08f7f0f9f65546db4c7388e445fa39f0842c6;p=mesa.git i965: implement get_size for 2_10_10_10 formats Signed-off-by: Chris Forbes Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 51531ce90e4..d68aa8c97cf 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -290,6 +290,11 @@ static GLuint get_size( GLenum type ) case GL_UNSIGNED_SHORT: return sizeof(GLushort); case GL_UNSIGNED_BYTE: return sizeof(GLubyte); case GL_FIXED: return sizeof(GLuint); + /* packed formats: always have 4 components, and element size is + * 4 bytes, so pretend each component is 1 byte. + */ + case GL_INT_2_10_10_10_REV: return sizeof(GLbyte); + case GL_UNSIGNED_INT_2_10_10_10_REV: return sizeof(GLubyte); default: assert(0); return 0; } }