mirror of https://github.com/PCSX2/pcsx2.git
GS: Convert ee write list to vector, fix some bugs.
This commit is contained in:
parent
4c7ad66bd7
commit
412275e40d
|
@ -2001,8 +2001,11 @@ void GSState::Write(const u8* mem, int len)
|
||||||
if (GSConfig.PreloadFrameWithGSData)
|
if (GSConfig.PreloadFrameWithGSData)
|
||||||
{
|
{
|
||||||
// Store the transfer for preloading new RT's.
|
// Store the transfer for preloading new RT's.
|
||||||
if(m_draw_transfers.size() == 0 || (m_draw_transfers.size() > 0 && blit.DBP != m_draw_transfers.front().DBP))
|
if (m_draw_transfers.size() == 0 || (m_draw_transfers.size() > 0 && blit.DBP != m_draw_transfers.back().blit.DBP))
|
||||||
m_draw_transfers.push_front(blit);
|
{
|
||||||
|
GSUploadQueue new_transfer = { blit, s_n };
|
||||||
|
m_draw_transfers.push_back(new_transfer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_CACHE("Write! ... => 0x%x W:%d F:%s (DIR %d%d), dPos(%d %d) size(%d %d)",
|
GL_CACHE("Write! ... => 0x%x W:%d F:%s (DIR %d%d), dPos(%d %d) size(%d %d)",
|
||||||
|
|
|
@ -206,6 +206,12 @@ protected:
|
||||||
bool IsCoverageAlpha();
|
bool IsCoverageAlpha();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
struct GSUploadQueue
|
||||||
|
{
|
||||||
|
GIFRegBITBLTBUF blit;
|
||||||
|
int draw;
|
||||||
|
};
|
||||||
|
|
||||||
GIFPath m_path[4];
|
GIFPath m_path[4];
|
||||||
GIFRegPRIM* PRIM;
|
GIFRegPRIM* PRIM;
|
||||||
GSPrivRegSet* m_regs;
|
GSPrivRegSet* m_regs;
|
||||||
|
@ -222,7 +228,7 @@ public:
|
||||||
bool m_mipmap;
|
bool m_mipmap;
|
||||||
u32 m_dirty_gs_regs;
|
u32 m_dirty_gs_regs;
|
||||||
int m_backed_up_ctx;
|
int m_backed_up_ctx;
|
||||||
std::list<GIFRegBITBLTBUF> m_draw_transfers;
|
std::vector<GSUploadQueue> m_draw_transfers;
|
||||||
bool m_force_preload;
|
bool m_force_preload;
|
||||||
|
|
||||||
static int s_n;
|
static int s_n;
|
||||||
|
|
|
@ -207,9 +207,16 @@ void GSRendererHW::VSync(u32 field, bool registers_written)
|
||||||
m_force_preload = true;
|
m_force_preload = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_force_preload = false;
|
m_force_preload = false;
|
||||||
|
std::vector<GSState::GSUploadQueue>::iterator iter;
|
||||||
m_draw_transfers.clear();
|
for (iter = m_draw_transfers.begin(); iter != m_draw_transfers.end(); ) {
|
||||||
|
if ((s_n - iter->draw) > 5)
|
||||||
|
iter = m_draw_transfers.erase(iter);
|
||||||
|
else
|
||||||
|
iter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (GSConfig.LoadTextureReplacements)
|
if (GSConfig.LoadTextureReplacements)
|
||||||
GSTextureReplacements::ProcessAsyncLoadedTextures();
|
GSTextureReplacements::ProcessAsyncLoadedTextures();
|
||||||
|
@ -4003,10 +4010,12 @@ GSRendererHW::CLUTDrawTestResult GSRendererHW::PossibleCLUTDraw()
|
||||||
// If we have GPU CLUT enabled, don't do a CPU draw when it would result in a download.
|
// If we have GPU CLUT enabled, don't do a CPU draw when it would result in a download.
|
||||||
if (GSConfig.UserHacks_GPUTargetCLUTMode != GSGPUTargetCLUTMode::Disabled)
|
if (GSConfig.UserHacks_GPUTargetCLUTMode != GSGPUTargetCLUTMode::Disabled)
|
||||||
{
|
{
|
||||||
for (auto upload : m_draw_transfers)
|
std::vector<GSState::GSUploadQueue>::iterator iter;
|
||||||
{
|
for (iter = m_draw_transfers.begin(); iter != m_draw_transfers.end(); ) {
|
||||||
if (upload.DBP == m_context->TEX0.TBP0 && GSUtil::HasSharedBits(upload.DPSM, m_context->TEX0.PSM))
|
if (iter->blit.DBP == m_context->TEX0.TBP0 && GSUtil::HasSharedBits(iter->blit.DPSM, m_context->TEX0.PSM))
|
||||||
return CLUTDrawTestResult::CLUTDrawOnCPU;
|
return CLUTDrawTestResult::CLUTDrawOnCPU;
|
||||||
|
|
||||||
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSTextureCache::Target* tgt = m_tc->GetExactTarget(m_context->TEX0.TBP0, m_context->TEX0.TBW, m_context->TEX0.PSM);
|
GSTextureCache::Target* tgt = m_tc->GetExactTarget(m_context->TEX0.TBP0, m_context->TEX0.TBW, m_context->TEX0.PSM);
|
||||||
|
@ -4030,10 +4039,12 @@ GSRendererHW::CLUTDrawTestResult GSRendererHW::PossibleCLUTDraw()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (auto upload : m_draw_transfers)
|
std::vector<GSState::GSUploadQueue>::iterator iter;
|
||||||
{
|
for (iter = m_draw_transfers.begin(); iter != m_draw_transfers.end(); ) {
|
||||||
if (upload.DBP == m_context->TEX0.TBP0 && GSUtil::HasSharedBits(upload.DPSM, m_context->TEX0.PSM))
|
if (iter->blit.DBP == m_context->TEX0.TBP0 && GSUtil::HasSharedBits(iter->blit.DPSM, m_context->TEX0.PSM))
|
||||||
return CLUTDrawTestResult::CLUTDrawOnCPU;
|
return CLUTDrawTestResult::CLUTDrawOnCPU;
|
||||||
|
|
||||||
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -706,16 +706,18 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, con
|
||||||
{
|
{
|
||||||
if (!is_frame && !forced_preload)
|
if (!is_frame && !forced_preload)
|
||||||
{
|
{
|
||||||
for (auto transfer : static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers)
|
std::vector<GSState::GSUploadQueue>::iterator iter;
|
||||||
{
|
for (iter = static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers.begin(); iter != static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers.end(); ) {
|
||||||
if (transfer.DBP == TEX0.TBP0 && GSUtil::HasSharedBits(transfer.DPSM, TEX0.PSM))
|
if (iter->blit.DBP == TEX0.TBP0 && GSUtil::HasSharedBits(iter->blit.DPSM, TEX0.PSM))
|
||||||
{
|
{
|
||||||
|
iter = static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers.erase(iter);
|
||||||
GL_INS("Preloading the RT DATA");
|
GL_INS("Preloading the RT DATA");
|
||||||
const GSVector4i newrect = GSVector4i(0, 0, real_w, real_h);
|
const GSVector4i newrect = GSVector4i(0, 0, real_w, real_h);
|
||||||
AddDirtyRectTarget(dst, newrect, TEX0.PSM, TEX0.TBW);
|
AddDirtyRectTarget(dst, newrect, TEX0.PSM, TEX0.TBW);
|
||||||
dst->Update(true);
|
dst->Update(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -119,6 +119,7 @@ void GSRendererSW::VSync(u32 field, bool registers_written)
|
||||||
|
|
||||||
m_tc->IncAge();
|
m_tc->IncAge();
|
||||||
|
|
||||||
|
m_draw_transfers.clear();
|
||||||
// if((m_perfmon.GetFrame() & 255) == 0) m_rl->PrintStats();
|
// if((m_perfmon.GetFrame() & 255) == 0) m_rl->PrintStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue