mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-21 21:41:09 +00:00
Fix a major speed regression from r6288:
Upon texture reloading, the cache entry hash wasn't updated and thus we effectively disabled any texture caching in that case. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6308 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
56e79aa87d
commit
52cd3aee95
@ -208,7 +208,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
|
||||
texHash ^= tlutHash;
|
||||
|
||||
if (g_ActiveConfig.bSafeTextureCache)
|
||||
texID ^= ((u32)tlutHash) ^ (tlutHash >> 32);
|
||||
texID ^= ((u32)tlutHash) ^ (u32)(tlutHash >> 32);
|
||||
}
|
||||
|
||||
if (g_ActiveConfig.bSafeTextureCache)
|
||||
@ -218,11 +218,11 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
|
||||
TCacheEntryBase *entry = textures[texID];
|
||||
if (entry)
|
||||
{
|
||||
if (false == g_ActiveConfig.bSafeTextureCache)
|
||||
if (!g_ActiveConfig.bSafeTextureCache)
|
||||
{
|
||||
if (entry->isRenderTarget || entry->isDynamic)
|
||||
{
|
||||
if (false == g_ActiveConfig.bCopyEFBToTexture)
|
||||
if (!g_ActiveConfig.bCopyEFBToTexture)
|
||||
{
|
||||
hash_value = GetHash64(ptr, texture_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
|
||||
|
||||
@ -310,13 +310,17 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
|
||||
texLevels = maxlevel + 1;
|
||||
|
||||
// create the entry/texture
|
||||
if (NULL == entry)
|
||||
{
|
||||
if (NULL == entry) {
|
||||
textures[texID] = entry = g_texture_cache->CreateTexture(width, height, expandedWidth, texLevels, pcfmt);
|
||||
|
||||
// Sometimes, we can get around recreating a texture if only the number of mip levels gets changes
|
||||
// e.g. if our texture cache entry got too many mipmap levels we can limit the number of used levels by setting the appropriate render states
|
||||
// Thus, we don't update this member for every Load, but just whenever the texture gets recreated
|
||||
entry->mipLevels = maxlevel;
|
||||
}
|
||||
|
||||
entry->addr = address;
|
||||
entry->format = full_format;
|
||||
entry->mipLevels = maxlevel;
|
||||
entry->size_in_bytes = texture_size;
|
||||
|
||||
entry->virtualW = width;
|
||||
@ -336,7 +340,6 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
|
||||
else
|
||||
// don't like rand() here
|
||||
entry->hash = *(u32*)ptr = (u32)(((double)rand() / RAND_MAX) * 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
// load texture
|
||||
entry->Load(width, height, expandedWidth, 0);
|
||||
|
@ -34,8 +34,8 @@ public:
|
||||
|
||||
unsigned int mipLevels;
|
||||
|
||||
bool isRenderTarget;
|
||||
bool isDynamic; // mofified from cpu
|
||||
bool isRenderTarget; // copied from EFB
|
||||
bool isDynamic; // Used for hybrid EFB copies to enable checks for CPU modifications
|
||||
bool isNonPow2; // doesn't seem to be used anywhere
|
||||
|
||||
//TCacheEntryBase()
|
||||
|
Loading…
x
Reference in New Issue
Block a user