Fixed calcNumMips for non-power-of-2 texture dimensions (#3219)

This commit is contained in:
Jamil Halabi 2023-12-11 18:39:02 +03:00 committed by GitHub
parent ad625918eb
commit f91c6faaf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -635,7 +635,7 @@ namespace bgfx
if (_hasMips) if (_hasMips)
{ {
const uint32_t max = bx::max(_width, _height, _depth); 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); return uint8_t(num);
} }