diff options
| author | rice1964 <rice1964@gmail.com> | 2009-09-11 05:05:00 +0000 |
|---|---|---|
| committer | rice1964 <rice1964@gmail.com> | 2009-09-11 05:05:00 +0000 |
| commit | f46aab0d3fff762f08fc3eeea6acbf33dc91734b (patch) | |
| tree | 82c094c31727c54bb6a3d6e6093d3a2efbd5b5c0 /Source | |
| parent | f0d1278effde72027898c3decc1d96dc9661f773 (diff) | |
D3d: safeTextureCache fix.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4250 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp index 7d613a009f..1d983cdcc1 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp @@ -108,7 +108,6 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width, if (address == 0) return NULL; - TexCache::iterator iter = textures.find(address); u8 *ptr = g_VideoInitialize.pGetMemoryPointer(address); @@ -137,17 +136,21 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width, int expandedWidth = (width+bs) & (~bs); u32 hash_value = TexDecoder_GetSafeTextureHash(ptr, expandedWidth, height, format, 0); u32 tex_hash = 0; + u32 texID = address; - if (g_Config.bDumpTextures) + if (g_Config.bDumpTextures || g_Config.bSafeTextureCache) { tex_hash = hash_value; if ((format == GX_TF_C4) || (format == GX_TF_C8) || (format == GX_TF_C14X2)) { u32 tlutHash = TexDecoder_GetTlutHash(&texMem[tlutaddr], (format == GX_TF_C4) ? 32 : 128); tex_hash ^= tlutHash; + if (g_Config.bSafeTextureCache) + texID ^= tlutHash; } } + TexCache::iterator iter = textures.find(texID); if (iter != textures.end()) { TCacheEntry &entry = iter->second; @@ -210,7 +213,7 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width, } //Make an entry in the table - TCacheEntry& entry = textures[address]; + TCacheEntry& entry = textures[texID]; entry.hashoffset = 0; entry.hash = hash_value; |
