Displaying 1 result from an estimated 1 matches for "mip_level".
Did you mean:
min_level
2018 Oct 25
1
Questions on Blocklinear Mipmaps and auto-sizing
...depth of them. According to
https://envytools.readthedocs.io/en/latest/hw/memory/g80-surface.html#textures-mipmapping-and-arrays
the texture unit auto resizes mipmaps' blocks but how do I know how many
blocks each one uses?
I'm currently using this algorithm:
u32 height = MipHeight(mip_level);
u32 gobs_in_y = (height + 7) / 8;
u32 bh = block_height;
// Magical block resizing algorithm, needs more testing.
while (bh > 1 && (gobs_in_y + bh - 1) / bh <= 2) {
bh >>= 1;
}
return bh;
it works 95% of the time but...