- Bring back IncAge() for textures to avoid excessive memory usage by some games.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2140 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2009-11-06 17:13:36 +00:00
parent 5d5eac8c59
commit 35ec28eb48
2 changed files with 17 additions and 18 deletions

View File

@ -466,9 +466,7 @@ protected:
{
__super::VSync(field);
// IncAge() gets rid of "old" textures, but it's not really needed.
// Doing it causes flickering on many game scene transitions.
//m_tc->IncAge();
m_tc->IncAge();
m_skip = 0;

View File

@ -451,7 +451,7 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset* o, const GSVector4i& r)
// TODO: ds
*/
}
//Currently unused
void GSTextureCache::IncAge()
{
int maxage = m_src.m_used ? 3 : 30;
@ -470,24 +470,25 @@ void GSTextureCache::IncAge()
m_src.m_used = false;
maxage = 4; // ffx intro scene changes leave the old image untouched for a couple of frames and only then start using it
// Clearing of Rendertargets causes flickering in many scene transitions, so let's not :p
//maxage = 4; // ffx intro scene changes leave the old image untouched for a couple of frames and only then start using it
for(int type = 0; type < 2; type++)
{
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); )
{
list<Target*>::iterator j = i++;
//for(int type = 0; type < 2; type++)
//{
// for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); )
// {
// list<Target*>::iterator j = i++;
Target* t = *j;
// Target* t = *j;
if(++t->m_age > maxage)
{
m_dst[type].erase(j);
// if(++t->m_age > maxage)
// {
// m_dst[type].erase(j);
delete t;
}
}
}
// delete t;
// }
// }
//}
}
GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* dst)