GSdx: Polished the recent changes a bit. Single threaded mode should be back to normal, 2-4 threads might be faster or slower. All in all, it has a lot more potential now. Rendering is almost as separated as with d3d, everything needed is packed and copied for the worker threads, synchronization between local memory and the temporary buffers is properly done. This model could also be back-ported to d3d. Or the software rasterizers could be hardware assisted somehow, there are a lot less sync points where those buffers should match with the contents of the local memory.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4993 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 committed 2011-12-18 21:57:48 +00:00
1 parent f318e84aca
commit b86e3ebd19
7 files changed
+236 -146

No files matched your search

+1 -24
View File
@@ -25,7 +25,6 @@
GSTextureCacheSW::GSTextureCacheSW(GSState* state)
: m_state(state)
{
memset(m_invalid, 0, sizeof(m_invalid));
}
GSTextureCacheSW::~GSTextureCacheSW()
@@ -102,11 +101,9 @@ GSTextureCacheSW::Texture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TEX0, cons
void GSTextureCacheSW::InvalidateVideoMem(const GSOffset* o, const GSVector4i& rect)
{
uint32 bp = o->bp;
uint32 bw = o->bw;
uint32 psm = o->psm;
GSVector2i bs = (bp & 31) == 0 ? GSLocalMemory::m_psm[psm].pgs : GSLocalMemory::m_psm[psm].bs;
GSVector2i bs = (o->bp & 31) == 0 ? GSLocalMemory::m_psm[psm].pgs : GSLocalMemory::m_psm[psm].bs;
GSVector4i r = rect.ralign<Align_Outside>(bs);
@@ -120,8 +117,6 @@ void GSTextureCacheSW::InvalidateVideoMem(const GSOffset* o, const GSVector4i& r
if(page < MAX_PAGES)
{
m_invalid[page >> 5] |= 1 << (page & 31); // remember which pages might be invalid for future texture updates
const list<Texture*>& map = m_map[page];
for(list<Texture*>::const_iterator i = map.begin(); i != map.end(); i++)
@@ -198,24 +193,6 @@ void GSTextureCacheSW::IncAge()
}
}
bool GSTextureCacheSW::CanUpdate(Texture* t)
{
for(size_t i = 0; i < countof(m_invalid); i++)
{
if(m_invalid[i] & t->m_pages[i])
{
return false;
}
}
return true;
}
void GSTextureCacheSW::ResetInvalidPages()
{
memset(m_invalid, 0, sizeof(m_invalid));
}
//
GSTextureCacheSW::Texture::Texture(GSState* state, const GSOffset* offset, uint32 tw0, const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA)