- trying the dx10.1-only "gather" shader instruction for palletized lookups ("8-bit texture" mode), saves 4 instructions which isn't much but still... (not tested, don't have ati)
- may fix the intel gma "no output" bug (don't have gma either :P)
- and the usual small code optimizations


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1549 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 committed 2009-07-22 03:55:28 +00:00
1 parent 6aeda9884a
commit 83b15dbac0
52 files changed
+904 -1239

No files matched your search

+46 -48
View File
@@ -70,7 +70,7 @@ const GSTextureCacheSW::GSTexture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TE
m_textures.insert(t);
const GSLocalMemory::BlockOffset* bo = m_state->m_mem.GetBlockOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM);
const GSOffset* o = m_state->m_context->offset.tex;
GSVector2i bs = (TEX0.TBP0 & 31) == 0 ? psm.pgs : psm.bs;
@@ -79,11 +79,11 @@ const GSTextureCacheSW::GSTexture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TE
for(int y = 0; y < th; y += bs.y)
{
uint32 base = bo->row[y >> 3];
uint32 base = o->block.row[y >> 3];
for(int x = 0; x < tw; x += bs.x)
{
uint32 page = (base + bo->col[x >> 3]) >> 5;
uint32 page = (base + o->block.col[x >> 3]) >> 5;
if(page < MAX_PAGES)
{
@@ -124,6 +124,43 @@ const GSTextureCacheSW::GSTexture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TE
return t;
}
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;
GSVector4i r = rect.ralign<GSVector4i::Outside>(bs);
for(int y = r.top; y < r.bottom; y += bs.y)
{
uint32 base = o->block.row[y >> 3];
for(int x = r.left; x < r.right; x += bs.x)
{
uint32 page = (base + o->block.col[x >> 3]) >> 5;
if(page < MAX_PAGES)
{
const list<GSTexture*>& map = m_map[page];
for(list<GSTexture*>::const_iterator i = map.begin(); i != map.end(); i++)
{
GSTexture* t = *i;
if(GSUtil::HasSharedBits(psm, t->m_TEX0.PSM))
{
t->m_valid[page] = 0;
t->m_complete = false;
}
}
}
}
}
}
void GSTextureCacheSW::RemoveAll()
{
for_each(m_textures.begin(), m_textures.end(), delete_object());
@@ -170,45 +207,6 @@ void GSTextureCacheSW::IncAge()
}
}
void GSTextureCacheSW::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const GSVector4i& rect)
{
uint32 bp = BITBLTBUF.DBP;
uint32 bw = BITBLTBUF.DBW;
uint32 psm = BITBLTBUF.DPSM;
const GSLocalMemory::BlockOffset* bo = m_state->m_mem.GetBlockOffset(bp, bw, psm);
GSVector2i bs = (bp & 31) == 0 ? GSLocalMemory::m_psm[psm].pgs : GSLocalMemory::m_psm[psm].bs;
GSVector4i r = rect.ralign<GSVector4i::Outside>(bs);
for(int y = r.top; y < r.bottom; y += bs.y)
{
uint32 base = bo->row[y >> 3];
for(int x = r.left; x < r.right; x += bs.x)
{
uint32 page = (base + bo->col[x >> 3]) >> 5;
if(page < MAX_PAGES)
{
const list<GSTexture*>& map = m_map[page];
for(list<GSTexture*>::const_iterator i = map.begin(); i != map.end(); i++)
{
GSTexture* t = *i;
if(GSUtil::HasSharedBits(psm, t->m_TEX0.PSM))
{
t->m_valid[page] = 0;
t->m_complete = false;
}
}
}
}
}
}
//
GSTextureCacheSW::GSTexture::GSTexture(GSState* state)
@@ -267,7 +265,7 @@ bool GSTextureCacheSW::GSTexture::Update(const GIFRegTEX0& TEX0, const GIFRegTEX
GSLocalMemory& mem = m_state->m_mem;
const GSLocalMemory::BlockOffset* bo = mem.GetBlockOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM);
const GSOffset* o = m_state->m_context->offset.tex;
bool repeating = m_TEX0.IsRepeating();
@@ -281,13 +279,13 @@ bool GSTextureCacheSW::GSTexture::Update(const GIFRegTEX0& TEX0, const GIFRegTEX
uint8* dst = (uint8*)m_buff + pitch * r.top;
for(int y = r.top, o = pitch * bs.y; y < r.bottom; y += bs.y, dst += o)
for(int y = r.top, block_pitch = pitch * bs.y; y < r.bottom; y += bs.y, dst += block_pitch)
{
uint32 base = bo->row[y >> 3];
uint32 base = o->block.row[y >> 3];
for(int x = r.left; x < r.right; x += bs.x)
{
uint32 block = base + bo->col[x >> 3];
uint32 block = base + o->block.col[x >> 3];
if(block < MAX_BLOCKS)
{
@@ -315,11 +313,11 @@ bool GSTextureCacheSW::GSTexture::Update(const GIFRegTEX0& TEX0, const GIFRegTEX
{
for(int y = r.top; y < r.bottom; y += bs.y)
{
uint32 base = bo->row[y >> 3];
uint32 base = o->block.row[y >> 3];
for(int x = r.left; x < r.right; x += bs.x)
{
uint32 block = base + bo->col[x >> 3];
uint32 block = base + o->block.col[x >> 3];
if(block < MAX_BLOCKS)
{