diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2011-12-26 19:17:04 +0100 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2012-01-31 18:09:35 +0100 |
| commit | dcf18fbaaf20cf1eade8c76eccd7fcd279b43957 (patch) | |
| tree | 4826a3935ed749a20f801049edb0d0daaa391aac /Source/Core/VideoCommon/Src/TextureCacheBase.cpp | |
| parent | 8bc9e443fd5ceb7b5f4b11ccf600d6ca5f332427 (diff) | |
TextureCacheBase: Force autogenerating mipmaps if custom textures are used
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureCacheBase.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index e2d74e18e5..afe4ce8abc 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -282,7 +282,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, } } } - + if (g_ActiveConfig.bHiresTextures) { // Load Custom textures @@ -298,16 +298,14 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, { expandedWidth = width = newWidth; expandedHeight = height = newHeight; - - // TODO: shouldn't generating mips be forced on now? - // native mips with a custom texture wouldn't make sense } } if (pcfmt == PC_TEX_FMT_NONE) pcfmt = TexDecoder_Decode(temp, ptr, expandedWidth, - expandedHeight, texformat, tlutaddr, tlutfmt, g_ActiveConfig.backend_info.bUseRGBATextures); + expandedHeight, texformat, tlutaddr, tlutfmt, g_ActiveConfig.backend_info.bUseRGBATextures); + UseNativeMips = UseNativeMips && (width == nativeW && height == nativeH); // Only load native mips if their dimensions fit to our virtual texture dimensions isPow2 = !((width & (width - 1)) || (height & (height - 1))); texLevels = (isPow2 && UseNativeMips && maxlevel) ? GetPow2(std::max(width, height)) : !isPow2; @@ -330,13 +328,11 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage, entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps); entry->SetDimensions(nativeW, nativeH, width, height); entry->SetEFBCopyParameters(false, texture_is_dynamic); - entry->oldpixel = *(u32*)ptr; if (g_ActiveConfig.bSafeTextureCache || entry->isDynamic) entry->hash = hash_value; else - // don't like rand() here entry->hash = *(u32*)ptr = (u32)(((double)rand() / RAND_MAX) * 0xFFFFFFFF); // load texture |
