mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-15 10:40:39 +01:00
GSdx: little code cleanup
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1591 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
1 parent
8b288e8917
commit
3f4f3db3e6
22 files changed
+607
-776
No files matched your search
@@ -29,44 +29,40 @@ GSTextureCache9::GSTextureCache9(GSRenderer* r)
|
||||
{
|
||||
}
|
||||
|
||||
// Source9
|
||||
|
||||
// Target9
|
||||
|
||||
void GSTextureCache9::Target9::Read(const GSVector4i& r)
|
||||
void GSTextureCache9::Read(Target* t, const GSVector4i& r)
|
||||
{
|
||||
if(m_type != RenderTarget)
|
||||
if(t->m_type != RenderTarget)
|
||||
{
|
||||
// TODO
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_TEX0.PSM != PSM_PSMCT32
|
||||
&& m_TEX0.PSM != PSM_PSMCT24
|
||||
&& m_TEX0.PSM != PSM_PSMCT16
|
||||
&& m_TEX0.PSM != PSM_PSMCT16S)
|
||||
const GIFRegTEX0& TEX0 = t->m_TEX0;
|
||||
|
||||
if(TEX0.PSM != PSM_PSMCT32
|
||||
&& TEX0.PSM != PSM_PSMCT24
|
||||
&& TEX0.PSM != PSM_PSMCT16
|
||||
&& TEX0.PSM != PSM_PSMCT16S)
|
||||
{
|
||||
//ASSERT(0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!m_dirty.empty())
|
||||
if(!t->m_dirty.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// printf("GSRenderTarget::Read %d,%d - %d,%d (%08x)\n", r.left, r.top, r.right, r.bottom, m_TEX0.TBP0);
|
||||
|
||||
// m_renderer->m_perfmon.Put(GSPerfMon::ReadRT, 1);
|
||||
// printf("GSRenderTarget::Read %d,%d - %d,%d (%08x)\n", r.left, r.top, r.right, r.bottom, TEX0.TBP0);
|
||||
|
||||
int w = r.width();
|
||||
int h = r.height();
|
||||
|
||||
GSVector4 src = GSVector4(r) * GSVector4(m_texture->m_scale).xyxy() / GSVector4(m_texture->GetSize()).xyxy();
|
||||
GSVector4 src = GSVector4(r) * GSVector4(t->m_texture->m_scale).xyxy() / GSVector4(t->m_texture->GetSize()).xyxy();
|
||||
|
||||
if(GSTexture* offscreen = m_renderer->m_dev->CopyOffscreen(m_texture, src, w, h))
|
||||
if(GSTexture* offscreen = m_renderer->m_dev->CopyOffscreen(t->m_texture, src, w, h))
|
||||
{
|
||||
GSTexture::GSMap m;
|
||||
|
||||
@@ -74,9 +70,9 @@ void GSTextureCache9::Target9::Read(const GSVector4i& r)
|
||||
{
|
||||
// TODO: block level write
|
||||
|
||||
GSOffset* o = m_renderer->m_mem.GetOffset(m_TEX0.TBP0, m_TEX0.TBW, m_TEX0.PSM);
|
||||
GSOffset* o = m_renderer->m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM);
|
||||
|
||||
switch(m_TEX0.PSM)
|
||||
switch(TEX0.PSM)
|
||||
{
|
||||
case PSM_PSMCT32:
|
||||
m_renderer->m_mem.WritePixel32(m.bits, m.pitch, o, r);
|
||||
|
||||
Reference in new issue
Block a user