some fixes for dlist, now is configurable in the video config section, still not in the gui,
disabled by default till a fix for segfaults in linux and geometry problems in some games git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6155 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
c1cac331a0
commit
c9dd11c803
|
@ -37,6 +37,7 @@
|
||||||
#include "ABI.h"
|
#include "ABI.h"
|
||||||
|
|
||||||
#include "DLCache.h"
|
#include "DLCache.h"
|
||||||
|
#include "VideoConfig.h"
|
||||||
|
|
||||||
#define DL_CODE_CACHE_SIZE (1024*1024*16)
|
#define DL_CODE_CACHE_SIZE (1024*1024*16)
|
||||||
extern int frameCount;
|
extern int frameCount;
|
||||||
|
@ -497,11 +498,9 @@ void ProgressiveCleanup()
|
||||||
// NOTE - outside the namespace on purpose.
|
// NOTE - outside the namespace on purpose.
|
||||||
bool HandleDisplayList(u32 address, u32 size)
|
bool HandleDisplayList(u32 address, u32 size)
|
||||||
{
|
{
|
||||||
// Disable display list caching since the benefit isn't much to write home about
|
//Fixed DlistCaching now is fully functional still some things to workout
|
||||||
// right now...
|
if(!g_ActiveConfig.bDlistCahchingEnable)
|
||||||
//Fixed DlistCaching now is fully functional benefits still marginal but when vertex data is stored here the story will be diferent :)
|
return false;
|
||||||
//to test remove the next line;
|
|
||||||
|
|
||||||
if(size == 0) return false;
|
if(size == 0) return false;
|
||||||
u64 dl_id = DLCache::CreateMapId(address, size);
|
u64 dl_id = DLCache::CreateMapId(address, size);
|
||||||
DLCache::DLMap::iterator iter = DLCache::dl_map.find(dl_id);
|
DLCache::DLMap::iterator iter = DLCache::dl_map.find(dl_id);
|
||||||
|
@ -512,16 +511,33 @@ bool HandleDisplayList(u32 address, u32 size)
|
||||||
DLCache::CachedDisplayList &dl = iter->second;
|
DLCache::CachedDisplayList &dl = iter->second;
|
||||||
if (dl.uncachable)
|
if (dl.uncachable)
|
||||||
{
|
{
|
||||||
// We haven't compiled it - let's return false so it gets
|
dl.check--;
|
||||||
// interpreted.
|
if(dl.check <= 0)
|
||||||
return false;
|
{
|
||||||
|
dl.pass = DLCache::DLPASS_ANALYZE;
|
||||||
|
dl.uncachable = false;
|
||||||
|
dl.check = dl.next_check;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Got one! And it's been compiled too, so let's run the compiled code!
|
// Got one! And it's been compiled too, so let's run the compiled code!
|
||||||
switch (dl.pass)
|
switch (dl.pass)
|
||||||
{
|
{
|
||||||
case DLCache::DLPASS_ANALYZE:
|
case DLCache::DLPASS_ANALYZE:
|
||||||
PanicAlert("DLPASS_ANALYZE - should have been done the first pass");
|
if (DLCache::AnalyzeAndRunDisplayList(address, size, &dl)) {
|
||||||
|
dl.dl_hash = GetHash64(Memory_GetPtr(address), size,0);
|
||||||
|
dl.pass = DLCache::DLPASS_COMPILE;
|
||||||
|
dl.check = 1;
|
||||||
|
dl.next_check = 1;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
dl.uncachable = true;
|
||||||
|
return true; // don't also interpret the list.
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DLCache::DLPASS_COMPILE:
|
case DLCache::DLPASS_COMPILE:
|
||||||
// First, check that the hash is the same as the last time.
|
// First, check that the hash is the same as the last time.
|
||||||
|
@ -529,6 +545,7 @@ bool HandleDisplayList(u32 address, u32 size)
|
||||||
{
|
{
|
||||||
// PanicAlert("uncachable %08x", address);
|
// PanicAlert("uncachable %08x", address);
|
||||||
dl.uncachable = true;
|
dl.uncachable = true;
|
||||||
|
dl.check = 60;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DLCache::CompileAndRunDisplayList(address, size, &dl);
|
DLCache::CompileAndRunDisplayList(address, size, &dl);
|
||||||
|
@ -543,6 +560,7 @@ bool HandleDisplayList(u32 address, u32 size)
|
||||||
if (dl.dl_hash != GetHash64(Memory_GetPtr(address), size,0))
|
if (dl.dl_hash != GetHash64(Memory_GetPtr(address), size,0))
|
||||||
{
|
{
|
||||||
dl.uncachable = true;
|
dl.uncachable = true;
|
||||||
|
dl.check = 60;
|
||||||
DLCache::VdataMap::iterator viter = dl.Vdata.begin();
|
DLCache::VdataMap::iterator viter = dl.Vdata.begin();
|
||||||
while (viter != dl.Vdata.end())
|
while (viter != dl.Vdata.end())
|
||||||
{
|
{
|
||||||
|
@ -554,9 +572,9 @@ bool HandleDisplayList(u32 address, u32 size)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
dl.check = dl.next_check;
|
dl.check = dl.next_check;
|
||||||
dl.next_check *= 2;
|
/*dl.next_check ++;
|
||||||
if (dl.next_check > 1024)
|
if (dl.next_check > 60)
|
||||||
dl.next_check = 1024;
|
dl.next_check = 60;*/
|
||||||
}
|
}
|
||||||
dl.frame_count= frameCount;
|
dl.frame_count= frameCount;
|
||||||
u8 *old_datareader = g_pVideoData;
|
u8 *old_datareader = g_pVideoData;
|
||||||
|
|
|
@ -732,6 +732,7 @@ void VertexLoader::RunCompiledVertices(int vtx_attr_group, int primitive, int co
|
||||||
VertexManager::Flush();
|
VertexManager::Flush();
|
||||||
memcpy_gc(VertexManager::s_pCurBufferPointer, Data, native_stride * count);
|
memcpy_gc(VertexManager::s_pCurBufferPointer, Data, native_stride * count);
|
||||||
VertexManager::s_pCurBufferPointer += native_stride * count;
|
VertexManager::s_pCurBufferPointer += native_stride * count;
|
||||||
|
DataSkip(count * m_VertexSize);
|
||||||
VertexManager::AddVertices(primitive, count);
|
VertexManager::AddVertices(primitive, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,8 @@ void VideoConfig::Load(const char *ini_file)
|
||||||
iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 1); // NOTE - this is x in (1 << x)
|
iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 1); // NOTE - this is x in (1 << x)
|
||||||
iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
|
iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
|
||||||
|
|
||||||
iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
|
iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, false);
|
||||||
|
iniFile.Get("Hacks", "DlistCachingEnable", &bDlistCahchingEnable);
|
||||||
iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, false);
|
iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, false);
|
||||||
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
|
iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
|
||||||
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, false);
|
iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, false);
|
||||||
|
@ -198,6 +199,7 @@ void VideoConfig::Save(const char *ini_file)
|
||||||
iniFile.Set("Enhancements", "PostProcessingShader", sPostProcessingShader);
|
iniFile.Set("Enhancements", "PostProcessingShader", sPostProcessingShader);
|
||||||
|
|
||||||
iniFile.Set("Hacks", "EFBAccessEnable", bEFBAccessEnable);
|
iniFile.Set("Hacks", "EFBAccessEnable", bEFBAccessEnable);
|
||||||
|
iniFile.Set("Hacks", "DlistCachingEnable", bDlistCahchingEnable);
|
||||||
iniFile.Set("Hacks", "EFBCopyDisable", bEFBCopyDisable);
|
iniFile.Set("Hacks", "EFBCopyDisable", bEFBCopyDisable);
|
||||||
iniFile.Set("Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
|
iniFile.Set("Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
|
||||||
iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
|
iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
|
||||||
|
|
|
@ -112,6 +112,7 @@ struct VideoConfig
|
||||||
|
|
||||||
// Hacks
|
// Hacks
|
||||||
bool bEFBAccessEnable;
|
bool bEFBAccessEnable;
|
||||||
|
bool bDlistCahchingEnable;
|
||||||
bool bEFBCopyDisable; // should reverse polarity of this one :) true=disabled can be confusing
|
bool bEFBCopyDisable; // should reverse polarity of this one :) true=disabled can be confusing
|
||||||
bool bOSDHotKey;
|
bool bOSDHotKey;
|
||||||
bool bHack;
|
bool bHack;
|
||||||
|
|
Loading…
Reference in New Issue