Browse Source

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

Jamil Halabi 2 years ago
parent
commit
f91c6faaf2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bgfx_p.h

+ 1 - 1
src/bgfx_p.h

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