Fixed calcNumMips for non-power-of-2 texture dimensions.

This commit is contained in:
Бранимир Караџић
2023-12-11 07:42:29 -08:00
parent 6c4d1888eb
commit 678b750128

View File

@@ -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);
}