summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-01-11 15:15:14 +0100
committerdegasus <wickmarkus@web.de>2015-01-11 22:23:35 +0100
commit744b1c162441b296e0af121d5ca6e95761587b6e (patch)
treee0c315bb61317e0d353a07bf2f73574cea0d814b /Source/Core/VideoCommon/TextureCacheBase.cpp
parentd95e5e2b6fdbdcc7af201a4fc1fa1389bbdf0ad5 (diff)
TexCache: rewrite level calculation
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index fd64f9b701..885c78e9a9 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -358,10 +358,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
tex_hash ^= tlut_hash;
}
- // D3D doesn't like when the specified mipmap count would require more than one 1x1-sized LOD in the mipmap chain
- // e.g. 64x64 with 7 LODs would have the mipmap chain 64x64,32x32,16x16,8x8,4x4,2x2,1x1,1x1, so we limit the mipmap count to 6 there
- while (g_ActiveConfig.backend_info.bUseMinimalMipCount && std::max(width, height) >> (tex_levels - 1) == 0)
- --tex_levels;
+ // GPUs don't like when the specified mipmap count would require more than one 1x1-sized LOD in the mipmap chain
+ // e.g. 64x64 with 7 LODs would have the mipmap chain 64x64,32x32,16x16,8x8,4x4,2x2,1x1,0x0, so we limit the mipmap count to 6 there
+ tex_levels = std::min<u32>(IntLog2(std::max(width, height)) + 1, tex_levels);
TCacheEntryBase *entry = textures[texID];
if (entry)