summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/DLCache.cpp
diff options
context:
space:
mode:
authorRodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com>2011-02-08 12:00:41 +0000
committerRodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com>2011-02-08 12:00:41 +0000
commit00c35451f607e479db47b25ddac50d0d18507a9d (patch)
treecd1a043229fa7a00205db46c9392b71c160c8dd0 /Source/Core/VideoCommon/Src/DLCache.cpp
parent8c41d31651924e7cab5123eedfd5d994e672acbe (diff)
second step in dlist optimizations: test the hashes only when the cpu could change the contents of the dlist, this is after it been processed, or at frame finish.
this is marcos idea so the credits go to him. please test the broken games in my last commits to see if this solve all the issues. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7114 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/DLCache.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/DLCache.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/Src/DLCache.cpp b/Source/Core/VideoCommon/Src/DLCache.cpp
index d7cd27952b..9f8df67951 100644
--- a/Source/Core/VideoCommon/Src/DLCache.cpp
+++ b/Source/Core/VideoCommon/Src/DLCache.cpp
@@ -49,10 +49,6 @@ using namespace Gen;
namespace DLCache
{
-// Currently just recompiles the DLs themselves, doesn't bother with the vertex data.
-// The speed boost is pretty small. The real big boost will come when we also store
-// vertex arrays in the cached DLs.
-
enum DisplayListPass {
DLPASS_ANALYZE,
DLPASS_COMPILE,
@@ -578,7 +574,7 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
numVertices);
u8* EndAddress = VertexManager::s_pCurBufferPointer;
u32 Vdatasize = (u32)(EndAddress - StartAddress);
- if (size > 0)
+ if (size > 0 && numVertices > 0)
{
// Compile
ReferencedDataRegion* NewRegion = new ReferencedDataRegion;
@@ -735,17 +731,17 @@ bool HandleDisplayList(u32 address, u32 size)
break;
case DLCache::DLPASS_RUN:
{
- // Every N draws, check hash
+ bool DlistChanged = false;
if (dl.check != CheckContextId)
{
dl.check = CheckContextId;
- if (dl.dl_hash != GetHash64(Memory::GetPointer(address), size, 0) || !dl.CheckRegions())
- {
- dl.uncachable = true;
- dl.check = 60;
- dl.ClearRegions();
- return false;
- }
+ DlistChanged = !dl.CheckRegions() || dl.dl_hash != GetHash64(Memory::GetPointer(address), size, 0);
+ }
+ if (DlistChanged)
+ {
+ dl.uncachable = true;
+ dl.ClearRegions();
+ return false;
}
dl.frame_count= frameCount;
u8 *old_datareader = g_pVideoData;