From 9df221dd735a245f9c3e0f9c3199f1d73425e9a1 Mon Sep 17 00:00:00 2001 From: magumagu9 Date: Thu, 15 Jan 2009 17:23:05 +0000 Subject: [PATCH] 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 --- .../Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 3f59502c4e..0fe0ddebe5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -228,17 +228,14 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width TexMode0 &tm0 = bpmem.tex[texstage > 3].texMode0[texstage & 3]; 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) ) - // 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; + u32 hash_value; + 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); - int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; + int bs = TexDecoder_GetBlockWidthInTexels(format) - 1; int expandedWidth = (width + bs) & (~bs); if (g_Config.bSafeTextureCache)