GS/PCRTC: Avoid trying to lookup bad framebuffers

This commit is contained in:
refractionpcsx2 2023-09-13 13:48:19 +01:00
parent 8c65d4e131
commit 357a90db71
2 changed files with 10 additions and 2 deletions

View File

@ -162,6 +162,9 @@ GSTexture* GSRendererHW::GetOutput(int i, float& scale, int& y_offset)
GSPCRTCRegs::PCRTCDisplay& curFramebuffer = PCRTCDisplays.PCRTCDisplays[index];
const GSVector2i framebufferSize(PCRTCDisplays.GetFramebufferSize(i));
if (curFramebuffer.framebufferRect.rempty() || curFramebuffer.FBW == 0)
return nullptr;
PCRTCDisplays.RemoveFramebufferOffset(i);
// TRACE(_T("[%d] GetOutput %d %05x (%d)\n"), (int)m_perfmon.GetFrame(), i, (int)TEX0.TBP0, (int)TEX0.PSM);

View File

@ -115,8 +115,13 @@ GSTexture* GSRendererSW::GetOutput(int i, float& scale, int& y_offset)
GSPCRTCRegs::PCRTCDisplay& curFramebuffer = PCRTCDisplays.PCRTCDisplays[index];
GSVector2i framebufferSize = PCRTCDisplays.GetFramebufferSize(i);
GSVector4i framebufferRect = PCRTCDisplays.GetFramebufferRect(i);
int w = curFramebuffer.FBW * 64;
int h = framebufferSize.y;
// Try to avoid broken/incomplete setups which are probably ingnored on console, but can cause us problems.
if (framebufferRect.rempty() || curFramebuffer.FBW == 0)
return nullptr;
const int w = curFramebuffer.FBW * 64;
const int h = framebufferSize.y;
if (g_gs_device->ResizeRenderTarget(&m_texture[index], w, h, false, false))
{