A few tweaks to fix issues I've been having with Tales of Symphonia in

safe texture mode. One, don't hash the palette when it doesn't matter;
including it completely kills performance in the map mode, and I'm 
pretty sure it's because the palette points to essentially random 
memory.  Two, include the address in the hash seed; this helps with an 
issue related to the EFB and the main menu.  Hopefully, these changes 
together don't cause any regressions.



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1878 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
magumagu9 2009-01-15 17:23:05 +00:00
parent 5d230ee9ab
commit 9df221dd73

View File

@ -228,17 +228,14 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
TexMode0 &tm0 = bpmem.tex[texstage > 3].texMode0[texstage & 3]; TexMode0 &tm0 = bpmem.tex[texstage > 3].texMode0[texstage & 3];
u8 *ptr = g_VideoInitialize.pGetMemoryPointer(address); u8 *ptr = g_VideoInitialize.pGetMemoryPointer(address);
u32 hash_value; u32 hash_value;
// Needed for texture format using tlut. u32 hashseed = address;
u32 hashseed; if ( (format == GX_TF_C4) || (format == GX_TF_C8) || (format == GX_TF_C14X2) )
//if ( (format == GX_TF_C4) || (format == GX_TF_C8) || (format == GX_TF_C14X2) ) // tlut size mask can be up to 0x3FFF (GX_TF_C14X2) but Safer == Slower.
// tlut size mask can be up to 0x3FFF (GX_TF_C14X2) but Safer == Slower. //hashseed = TexDecoder_GetTlutHash(&texMem[tlutaddr], TexDecoder_GetPaletteSize(format)&0x7FFF);
//hashseed = TexDecoder_GetTlutHash(&texMem[tlutaddr], TexDecoder_GetPaletteSize(format)&0x7FFF); hashseed += TexDecoder_GetTlutHash(texMem + tlutaddr, 32);
hashseed = TexDecoder_GetTlutHash(texMem + tlutaddr, 32);
//else
// hashseed = address;
int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; int bs = TexDecoder_GetBlockWidthInTexels(format) - 1;
int expandedWidth = (width + bs) & (~bs); int expandedWidth = (width + bs) & (~bs);
if (g_Config.bSafeTextureCache) if (g_Config.bSafeTextureCache)