i965: implement get_size for 2_10_10_10 formats
authorChris Forbes <chrisf@ijw.co.nz>
Thu, 22 Nov 2012 03:23:19 +0000 (16:23 +1300)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 00:34:20 +0000 (16:34 -0800)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_draw_upload.c

index 51531ce90e46c5ec4e7e208266b03476325e3256..d68aa8c97cf2de5b7aba18f75bc5c9e9c84393b7 100644 (file)
@@ -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;
    }
 }