Sfoglia il codice sorgente

Fixed mip calculation.

Branimir Karadžić 11 anni fa
parent
commit
82216b2176
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/image.cpp

+ 2 - 2
src/image.cpp

@@ -1636,8 +1636,8 @@ namespace bgfx
 				// skip imageSize in KTX format.
 				offset += _imageContainer.m_ktx ? sizeof(uint32_t) : 0;
 
-				width  = bx::uint32_max(blockWidth,  width);
-				height = bx::uint32_max(blockHeight, height);
+				width  = bx::uint32_max(blockWidth,  ( (width +blockWidth -1)/blockWidth )*blockWidth);
+				height = bx::uint32_max(blockHeight, ( (height+blockHeight-1)/blockHeight)*blockHeight);
 				depth  = bx::uint32_max(1, depth);
 
 				uint32_t size = width*height*depth*bpp/8;