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
1 changed files with 7 additions and 10 deletions

View File

@ -229,14 +229,11 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
u8 *ptr = g_VideoInitialize.pGetMemoryPointer(address);
u32 hash_value;
// Needed for texture format using tlut.
u32 hashseed;
//if ( (format == GX_TF_C4) || (format == GX_TF_C8) || (format == GX_TF_C14X2) )
u32 hashseed = address;
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.
//hashseed = TexDecoder_GetTlutHash(&texMem[tlutaddr], TexDecoder_GetPaletteSize(format)&0x7FFF);
hashseed = TexDecoder_GetTlutHash(texMem + tlutaddr, 32);
//else
// hashseed = address;
hashseed += TexDecoder_GetTlutHash(texMem + tlutaddr, 32);
int bs = TexDecoder_GetBlockWidthInTexels(format) - 1;
int expandedWidth = (width + bs) & (~bs);