- /* round up to multiple of 4 */
- size = ((width + 7) / 8) * ((height + 3) / 4) * 16;
- /* Textures smaller than 4x4 will effectively be made into 4x4 and
- * take 8 bytes.
+ /* round up width to next multiple of 8, height to next multiple of 4 */
+ width = (width + 7) & ~7;
+ height = (height + 3) & ~3;
+ /* 16 bytes per 8x4 tile of RGB[A] texels */
+ size = width * height / 2;
+ /* Textures smaller than 8x4 will effectively be made into 8x4 and
+ * take 16 bytes.