mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-02-17 12:42:35 +01:00
Fixed calcNumMips for non-power-of-2 texture dimensions.
This commit is contained in:
@@ -85,7 +85,7 @@ namespace bimg
|
||||
if (_hasMips)
|
||||
{
|
||||
const uint32_t max = bx::max(_width, _height, _depth);
|
||||
const uint32_t num = 1 + bx::ceilLog2(max);
|
||||
const uint32_t num = 1 + bx::floorLog2(max);
|
||||
|
||||
return uint8_t(num);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user