summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Present.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-10-25 18:23:00 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2023-10-25 18:24:42 +0200
commit4f0c8b1657f46e4929e85c3d3e1e58cd456dcfb5 (patch)
tree386ed08f7222e76d7cadcf8aec22b878c2e0b990 /Source/Core/VideoCommon/Present.cpp
parent60e3b4c0932ca963c67922cd7deb5d7e90732b92 (diff)
VideoCommon: Don't swap on state load when there's no XFB.
This triggers an assert in TCacheEntry::SetXfbCopy() otherwise if you load a savestate that was made before the first XFB has been rendered.
Diffstat (limited to 'Source/Core/VideoCommon/Present.cpp')
-rw-r--r--Source/Core/VideoCommon/Present.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp
index a190231faa..0a3b6e90e8 100644
--- a/Source/Core/VideoCommon/Present.cpp
+++ b/Source/Core/VideoCommon/Present.cpp
@@ -737,12 +737,12 @@ void Presenter::DoState(PointerWrap& p)
p.Do(m_last_xfb_stride);
p.Do(m_last_xfb_height);
- if (p.IsReadMode())
+ // If we're loading and there is a last XFB, re-display it.
+ if (p.IsReadMode() && m_last_xfb_stride != 0)
{
// This technically counts as the end of the frame
AfterFrameEvent::Trigger();
- // re-display the most recent XFB
ImmediateSwap(m_last_xfb_addr, m_last_xfb_width, m_last_xfb_stride, m_last_xfb_height,
m_last_xfb_ticks);
}