fullMipCount static method

int fullMipCount(
  1. int width,
  2. int height
)

Mip levels for a full chain of a width × height texture.

Implementation

static int fullMipCount(int width, int height) {
  var size = width > height ? width : height;
  var levels = 1;
  while (size > 1) {
    size >>= 1;
    levels++;
  }
  return levels;
}