From 82216b21764e66afcec3ff5eb30f20182e04d937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 5 Jun 2014 21:07:08 -0700 Subject: [PATCH] Fixed mip calculation. --- src/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index 50a4c4f0..13439a18 100644 --- a/src/image.cpp +++ b/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;