How many mip levels a width × height texture's full chain has — WebGPU's
mipLevelCount.
The count is 1 + floor(log2(max(width, height))), which is exactly the
number of halvings Texture.byteLength's loop performs plus the base level.
Computed by halving rather than with Math.log2 so it cannot disagree with
that loop by a floating-point ulp at a power of two — the two numbers have to
match or the accounting is wrong (§84).
How many mip levels a
width×heighttexture's full chain has — WebGPU'smipLevelCount.The count is
1 + floor(log2(max(width, height))), which is exactly the number of halvingsTexture.byteLength's loop performs plus the base level. Computed by halving rather than withMath.log2so it cannot disagree with that loop by a floating-point ulp at a power of two — the two numbers have to match or the accounting is wrong (§84).