Skip to content

Commit

Permalink
Fixed calcNumMips for non-power-of-2 texture dimensions (bkaradzic#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay3d authored and Michael Pekar committed Mar 2, 2024
1 parent dd3af2e commit f7b8696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bgfx_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ namespace bgfx
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);
}
Expand Down

0 comments on commit f7b8696

Please sign in to comment.