Skip to content

Commit

Permalink
Fixed calcNumMips for non-power-of-2 texture dimensions (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay3d authored Dec 11, 2023
1 parent ad62591 commit f91c6fa
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 f91c6fa

Please sign in to comment.