mirror of https://github.com/PCSX2/pcsx2.git
gsdx tc: add a shareable texture flag
Plan is to bypass shader conversion/rescaling/copy for depth texture
This commit is contained in:
parent
8ec1461842
commit
9ee090a36e
plugins/GSdx
|
@ -944,8 +944,12 @@ void GSTextureCache::IncAge()
|
||||||
|
|
||||||
Source* s = *j;
|
Source* s = *j;
|
||||||
|
|
||||||
if(++s->m_age > maxage)
|
if(s->m_shared_texture) {
|
||||||
{
|
// Shared textures are temporary only added in the hash set but not in the texture
|
||||||
|
// cache list therefore you can't use RemoveAt
|
||||||
|
m_src.m_surfaces.erase(s);
|
||||||
|
delete s;
|
||||||
|
} else if(++s->m_age > maxage) {
|
||||||
m_src.RemoveAt(s);
|
m_src.RemoveAt(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1339,7 +1343,7 @@ void GSTextureCache::PrintMemoryUsage()
|
||||||
uint32 dss = 0;
|
uint32 dss = 0;
|
||||||
for(hash_set<Source*>::iterator i = m_src.m_surfaces.begin(); i != m_src.m_surfaces.end(); i++) {
|
for(hash_set<Source*>::iterator i = m_src.m_surfaces.begin(); i != m_src.m_surfaces.end(); i++) {
|
||||||
Source* s = *i;
|
Source* s = *i;
|
||||||
if (s) {
|
if (s && !s->m_shared_texture) {
|
||||||
if (s->m_target)
|
if (s->m_target)
|
||||||
tex_rt += s->m_texture->GetMemUsage();
|
tex_rt += s->m_texture->GetMemUsage();
|
||||||
else
|
else
|
||||||
|
@ -1370,13 +1374,17 @@ GSTextureCache::Surface::Surface(GSRenderer* r, uint8* temp)
|
||||||
, m_age(0)
|
, m_age(0)
|
||||||
, m_temp(temp)
|
, m_temp(temp)
|
||||||
, m_32_bits_fmt(false)
|
, m_32_bits_fmt(false)
|
||||||
|
, m_shared_texture(false)
|
||||||
{
|
{
|
||||||
m_TEX0.TBP0 = 0x3fff;
|
m_TEX0.TBP0 = 0x3fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSTextureCache::Surface::~Surface()
|
GSTextureCache::Surface::~Surface()
|
||||||
{
|
{
|
||||||
m_renderer->m_dev->Recycle(m_texture);
|
// Shared textures are pointers copy. Therefore no allocation
|
||||||
|
// to recycle.
|
||||||
|
if (!m_shared_texture)
|
||||||
|
m_renderer->m_dev->Recycle(m_texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSTextureCache::Surface::Update()
|
void GSTextureCache::Surface::Update()
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
int m_age;
|
int m_age;
|
||||||
uint8* m_temp;
|
uint8* m_temp;
|
||||||
bool m_32_bits_fmt; // Allow to detect the casting of 32 bits as 16 bits texture
|
bool m_32_bits_fmt; // Allow to detect the casting of 32 bits as 16 bits texture
|
||||||
|
bool m_shared_texture;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Surface(GSRenderer* r, uint8* temp);
|
Surface(GSRenderer* r, uint8* temp);
|
||||||
|
|
Loading…
Reference in New Issue