summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorbaby.lueshi <baby.lueshi@gmail.com>2011-02-04 22:51:17 +0000
committerbaby.lueshi <baby.lueshi@gmail.com>2011-02-04 22:51:17 +0000
commitcd9e6a8d23a830d45f6f6b39c5ced27bb568dcfc (patch)
treef34709784d35ed939a41c5d4f5ec6160a876b385 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp
parentf7d757b46eaa271e7f58e1c61df4fb34b5ff47f9 (diff)
Change the recent speedup to the hashing function to fall back to the old version for custom textures.
Re-fixed custom textures higher than 1024x1024. (It must have accidentally got reverted somewhere during the video plugin merge) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7064 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index ad487acd18..3989cc57b6 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -17,7 +17,7 @@ extern int frameCount;
enum
{
- TEMP_SIZE = (1024 * 1024 * 4),
+ TEMP_SIZE = (2048 * 2048 * 4),
TEXTURE_KILL_THRESHOLD = 200,
};
@@ -180,6 +180,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
const u32 texture_size = TexDecoder_GetTextureSizeInBytes(expandedWidth, expandedHeight, texformat);
const u32 palette_size = TexDecoder_GetPaletteSize(texformat);
bool texture_is_dynamic = false;
+ bool forceLegacyHash = (g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
unsigned int texLevels;
PC_TexFormat pcfmt = PC_TEX_FMT_NONE;
@@ -190,9 +191,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
full_format = texformat | (tlutfmt << 16);
// hires texture loading and texture dumping require accurate hashes
- if (g_ActiveConfig.bSafeTextureCache || g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures)
+ if (g_ActiveConfig.bSafeTextureCache || forceLegacyHash)
{
- texHash = GetHash64(ptr, texture_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
+ texHash = GetHash64(ptr, texture_size, g_ActiveConfig.iSafeTextureCache_ColorSamples, forceLegacyHash);
if (isC4_C8_C14X2)
{
@@ -205,7 +206,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
// we must make sure that texture with different tluts get different IDs.
const u64 tlutHash = GetHash64(texMem + tlutaddr, palette_size,
- g_ActiveConfig.iSafeTextureCache_ColorSamples);
+ g_ActiveConfig.iSafeTextureCache_ColorSamples, forceLegacyHash);
texHash ^= tlutHash;
@@ -285,7 +286,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
unsigned int newWidth = width;
unsigned int newHeight = height;
- sprintf(texPathTemp, "%s_%08llx_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
+ sprintf(texPathTemp, "%s_%08lx_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32) (texHash & 0x00000000FFFFFFFFLL), texformat);
pcfmt = HiresTextures::GetHiresTex(texPathTemp, &newWidth, &newHeight, texformat, temp);
if (pcfmt != PC_TEX_FMT_NONE)
@@ -386,7 +387,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
if (false == File::Exists(szDir) || false == File::IsDirectory(szDir))
File::CreateDir(szDir);
- sprintf(szTemp, "%s/%s_%08llx_%i.png", szDir, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), texHash, texformat);
+ sprintf(szTemp, "%s/%s_%08lx_%i.png", szDir, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32) (texHash & 0x00000000FFFFFFFFLL), texformat);
if (false == File::Exists(szTemp))
entry->Save(szTemp);