From fc370c51364f459706e2c1157f789988fc182f3a Mon Sep 17 00:00:00 2001 From: Rodolfo Osvaldo Bogado Date: Tue, 8 Feb 2011 00:28:28 +0000 Subject: [PATCH] Experimental commit: this is the base for a more complex dlist control code, is incomplete but i need some feedback. whit this code hashing is completely disabled for the dlists content itself this must bring some fps more but i must know if this causes any glitches. i suspect that no game modify the content of the dlist so hash is time wasted but the only way to test it is with this commit. please test as many games s you can and give me feedback for any glitch. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7106 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/DLCache.cpp | 18 ++++++++++-------- Source/Core/VideoCommon/Src/DLCache.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Source/Core/VideoCommon/Src/DLCache.cpp b/Source/Core/VideoCommon/Src/DLCache.cpp index ef0b95c433..e58fe5cbab 100644 --- a/Source/Core/VideoCommon/Src/DLCache.cpp +++ b/Source/Core/VideoCommon/Src/DLCache.cpp @@ -43,7 +43,7 @@ #define DL_CODE_CACHE_SIZE (1024*1024*16) #define DL_CODE_CLEAR_THRESHOLD (128 * 1024) extern int frameCount; - +static int CheckContextId; using namespace Gen; namespace DLCache @@ -101,7 +101,6 @@ struct CachedDisplayList num_index_xf(0), num_draw_call(0), pass(DLPASS_ANALYZE), - next_check(1), BufferCount(0), Regions(NULL), LastRegion(NULL) @@ -124,7 +123,6 @@ struct CachedDisplayList u32 check; - u32 next_check; int frame_count; @@ -627,6 +625,7 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl) void Init() { + CheckContextId = 0; dlcode_cache = (u8*)AllocateExecutableMemory(DL_CODE_CACHE_SIZE, false); // Don't need low memory. emitter.SetCodePtr(dlcode_cache); } @@ -738,9 +737,9 @@ bool HandleDisplayList(u32 address, u32 size) case DLCache::DLPASS_RUN: { // Every N draws, check hash - dl.check--; - if (dl.check <= 0) + if (dl.check != CheckContextId) { + dl.check = CheckContextId; if (dl.dl_hash != GetHash64(Memory::GetPointer(address), size, 0) || !dl.CheckRegions()) { dl.uncachable = true; @@ -748,7 +747,6 @@ bool HandleDisplayList(u32 address, u32 size) dl.ClearRegions(); return false; } - dl.check = dl.next_check; } dl.frame_count= frameCount; u8 *old_datareader = g_pVideoData; @@ -778,8 +776,7 @@ bool HandleDisplayList(u32 address, u32 size) u32 dlvatused = DLCache::AnalyzeAndRunDisplayList(address, size, &dl); dl.dl_hash = GetHash64(Memory::GetPointer(address), size,0); dl.pass = DLCache::DLPASS_COMPILE; - dl.check = 1; - dl.next_check = 1; + dl.check = CheckContextId; vhash = DLCache::CreateVMapId(dlvatused); if(Parentiter != DLCache::dl_map.end()) { @@ -800,3 +797,8 @@ bool HandleDisplayList(u32 address, u32 size) return true; } + +void IncrementCheckContextId() +{ + CheckContextId++; +} diff --git a/Source/Core/VideoCommon/Src/DLCache.h b/Source/Core/VideoCommon/Src/DLCache.h index 9286f52637..3df0f4deab 100644 --- a/Source/Core/VideoCommon/Src/DLCache.h +++ b/Source/Core/VideoCommon/Src/DLCache.h @@ -19,6 +19,7 @@ #define _DLCACHE_H bool HandleDisplayList(u32 address, u32 size); +void IncrementCheckContextId(); namespace DLCache {