mirror of https://github.com/PCSX2/pcsx2.git
GS-HW: Force preload 1 frame after reset
This commit is contained in:
parent
2fd88b901b
commit
8ac21357c3
|
@ -223,6 +223,7 @@ public:
|
||||||
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::list<GIFRegBITBLTBUF> m_draw_transfers;
|
||||||
|
bool m_force_preload;
|
||||||
|
|
||||||
static int s_n;
|
static int s_n;
|
||||||
|
|
||||||
|
|
|
@ -202,9 +202,13 @@ void GSRendererHW::VSync(u32 field, bool registers_written)
|
||||||
{
|
{
|
||||||
if (m_reset)
|
if (m_reset)
|
||||||
{
|
{
|
||||||
m_tc->InvalidateFrameAge();
|
m_tc->RemoveAll();
|
||||||
m_reset = false;
|
m_reset = false;
|
||||||
|
m_force_preload = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_force_preload = false;
|
||||||
|
|
||||||
|
|
||||||
if (GSConfig.LoadTextureReplacements)
|
if (GSConfig.LoadTextureReplacements)
|
||||||
GSTextureReplacements::ProcessAsyncLoadedTextures();
|
GSTextureReplacements::ProcessAsyncLoadedTextures();
|
||||||
|
@ -1363,7 +1367,7 @@ void GSRendererHW::Draw()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SW CLUT Render enable.
|
// SW CLUT Render enable.
|
||||||
bool preload = GSConfig.PreloadFrameWithGSData;
|
bool preload = GSConfig.PreloadFrameWithGSData | m_force_preload;
|
||||||
if (GSConfig.UserHacks_CPUCLUTRender > 0 || GSConfig.UserHacks_GPUTargetCLUTMode != GSGPUTargetCLUTMode::Disabled)
|
if (GSConfig.UserHacks_CPUCLUTRender > 0 || GSConfig.UserHacks_GPUTargetCLUTMode != GSGPUTargetCLUTMode::Disabled)
|
||||||
{
|
{
|
||||||
const CLUTDrawTestResult result = (GSConfig.UserHacks_CPUCLUTRender == 2) ? PossibleCLUTDrawAggressive() : PossibleCLUTDraw();
|
const CLUTDrawTestResult result = (GSConfig.UserHacks_CPUCLUTRender == 2) ? PossibleCLUTDrawAggressive() : PossibleCLUTDraw();
|
||||||
|
|
|
@ -61,19 +61,6 @@ void GSTextureCache::RemovePartial()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Causes old frames to be flushed
|
|
||||||
void GSTextureCache::InvalidateFrameAge()
|
|
||||||
{
|
|
||||||
for (int type = 0; type < 2; type++)
|
|
||||||
{
|
|
||||||
for (auto t : m_dst[type])
|
|
||||||
{
|
|
||||||
if (t->m_is_frame)
|
|
||||||
t->m_age = 9999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GSTextureCache::RemoveAll()
|
void GSTextureCache::RemoveAll()
|
||||||
{
|
{
|
||||||
m_src.RemoveAll();
|
m_src.RemoveAll();
|
||||||
|
@ -713,10 +700,11 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, con
|
||||||
//
|
//
|
||||||
// From a performance point of view, it might cost a little on big upscaling
|
// From a performance point of view, it might cost a little on big upscaling
|
||||||
// but normally few RT are miss so it must remain reasonable.
|
// but normally few RT are miss so it must remain reasonable.
|
||||||
bool supported_fmt = !GSConfig.UserHacks_DisableDepthSupport || psm_s.depth == 0;
|
const bool supported_fmt = !GSConfig.UserHacks_DisableDepthSupport || psm_s.depth == 0;
|
||||||
if ((is_frame || preload) && TEX0.TBW > 0 && supported_fmt)
|
const bool forced_preload = static_cast<GSRendererHW*>(g_gs_renderer.get())->m_force_preload;
|
||||||
|
if ((is_frame || preload || forced_preload) && TEX0.TBW > 0 && supported_fmt)
|
||||||
{
|
{
|
||||||
if (!is_frame)
|
if (!is_frame && !forced_preload)
|
||||||
{
|
{
|
||||||
// Check for an EE transfer that matches our RT.
|
// Check for an EE transfer that matches our RT.
|
||||||
while (static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers.size() > 0)
|
while (static_cast<GSRendererHW*>(g_gs_renderer.get())->m_draw_transfers.size() > 0)
|
||||||
|
|
|
@ -353,7 +353,6 @@ public:
|
||||||
void Read(Target* t, const GSVector4i& r);
|
void Read(Target* t, const GSVector4i& r);
|
||||||
void Read(Source* t, const GSVector4i& r);
|
void Read(Source* t, const GSVector4i& r);
|
||||||
void RemoveAll();
|
void RemoveAll();
|
||||||
void InvalidateFrameAge();
|
|
||||||
void RemovePartial();
|
void RemovePartial();
|
||||||
void AddDirtyRectTarget(Target* target, GSVector4i rect, u32 psm, u32 bw);
|
void AddDirtyRectTarget(Target* target, GSVector4i rect, u32 psm, u32 bw);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue