GS: limit merge circuit memory read height

This commit is contained in:
refractionpcsx2 2022-04-28 10:30:46 +01:00
parent a20a3866d0
commit a271fe11e9
2 changed files with 8 additions and 2 deletions

View File

@ -267,11 +267,14 @@ GSTexture* GSRendererHW::GetOutput(int i, int& y_offset)
TEX0.TBW = DISPFB.FBW;
TEX0.PSM = DISPFB.PSM;
const int videomode = static_cast<int>(GetVideoMode()) - 1;
int display_height = VideoModeOffsets[videomode].y * ((isinterlaced() && !m_regs->SMODE2.FFMD) ? 2 : 1);
int fb_height = std::min(GetFramebufferHeight(), display_height);
// TRACE(_T("[%d] GetOutput %d %05x (%d)\n"), (int)m_perfmon.GetFrame(), i, (int)TEX0.TBP0, (int)TEX0.PSM);
GSTexture* t = NULL;
if (GSTextureCache::Target* rt = m_tc->LookupTarget(TEX0, GetTargetSize(), GetFramebufferHeight()))
if (GSTextureCache::Target* rt = m_tc->LookupTarget(TEX0, GetTargetSize(), fb_height))
{
t = rt->m_texture;

View File

@ -141,7 +141,10 @@ GSTexture* GSRendererSW::GetOutput(int i, int& y_offset)
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
int w = DISPFB.FBW * 64;
int h = GetFramebufferHeight();
const int videomode = static_cast<int>(GetVideoMode()) - 1;
int display_height = VideoModeOffsets[videomode].y * ((isinterlaced() && !m_regs->SMODE2.FFMD) ? 2 : 1);
int h = std::min(GetFramebufferHeight(), display_height);
// TODO: round up bottom