From 716b3fefd423fc443b3280a65336e9bc0504d96c Mon Sep 17 00:00:00 2001 From: magumagu Date: Fri, 2 May 2014 23:07:55 -0700 Subject: [PATCH] VideoCommon: recreate XFB texture when the XFB size changes. We need to do this to correctly deal with games which dynamically change the XFB width and height. --- Source/Core/VideoCommon/FramebufferManagerBase.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/FramebufferManagerBase.cpp index f23af5e36c..6e26dea190 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/FramebufferManagerBase.cpp @@ -46,6 +46,13 @@ const XFBSourceBase* const* FramebufferManagerBase::GetRealXFBSource(u32 xfbAddr { xfbCount = 1; + // recreate if needed + if (m_realXFBSource && (m_realXFBSource->texWidth != fbWidth || m_realXFBSource->texHeight != fbHeight)) + { + delete m_realXFBSource; + m_realXFBSource = nullptr; + } + if (!m_realXFBSource) m_realXFBSource = g_framebuffer_manager->CreateXFBSource(fbWidth, fbHeight); @@ -142,8 +149,8 @@ void FramebufferManagerBase::CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHe // recreate if needed if (vxfb->xfbSource && (vxfb->xfbSource->texWidth != target_width || vxfb->xfbSource->texHeight != target_height)) { - //delete vxfb->xfbSource; - //vxfb->xfbSource = nullptr; + delete vxfb->xfbSource; + vxfb->xfbSource = nullptr; } if (!vxfb->xfbSource)