浏览代码

extraneous mipmap generation prune
OR spits out quite a few pointless mips for non square textures, which can lead to it triggering that AssertFatal(mNumMipLevels <= c_maxMipLevels, "GBitmap::allocateBitmap: too many miplevels"); entry

Azaezel 10 年之前
父节点
当前提交
b8c750dd56
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Engine/source/gfx/bitmap/gBitmap.cpp
  2. 1 1
      Engine/source/gfx/gfxTextureManager.cpp

+ 1 - 1
Engine/source/gfx/bitmap/gBitmap.cpp

@@ -326,7 +326,7 @@ void GBitmap::allocateBitmap(const U32 in_width, const U32 in_height, const bool
 
          mNumMipLevels++;
          allocPixels += currWidth * currHeight * mBytesPerPixel;
-      } while (currWidth != 1 || currHeight != 1);
+      } while (currWidth != 1 && currHeight != 1);
    }
    AssertFatal(mNumMipLevels <= c_maxMipLevels, "GBitmap::allocateBitmap: too many miplevels");
 

+ 1 - 1
Engine/source/gfx/gfxTextureManager.cpp

@@ -1098,7 +1098,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
                currHeight = 1;
 
             inOutNumMips++;
-         } while ( currWidth != 1 || currHeight != 1 );
+         } while ( currWidth != 1 && currHeight != 1 );
       }
    }
 }