summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2019-06-29 19:27:53 +1000
committerStenzek <stenzek@gmail.com>2019-07-24 04:10:38 +1000
commit1082468133342586ae2a5986408d163ce5aa14ca (patch)
treeac7fb57285770d9bf07b080b79360ca1b7db9386 /Source/Core/VideoCommon/RenderBase.cpp
parentb26bb0605b962456720519b273f171919ebfb65d (diff)
TextureCache: Support saving cache entries, including EFB copies
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 40b6f9d51e..48b8e4cfd3 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -25,6 +25,7 @@
#include <imgui.h>
#include "Common/Assert.h"
+#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/Config/Config.h"
#include "Common/Event.h"
@@ -1324,8 +1325,11 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
}
// Update our last xfb values
- m_last_xfb_width = (fb_width < 1 || fb_width > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fb_width;
- m_last_xfb_height = (fb_height < 1 || fb_height > MAX_XFB_HEIGHT) ? MAX_XFB_HEIGHT : fb_height;
+ m_last_xfb_addr = xfb_addr;
+ m_last_xfb_ticks = ticks;
+ m_last_xfb_width = fb_width;
+ m_last_xfb_stride = fb_stride;
+ m_last_xfb_height = fb_height;
}
else
{
@@ -1681,6 +1685,27 @@ bool Renderer::UseVertexDepthRange() const
return fabs(xfmem.viewport.zRange) > 16777215.0f || fabs(xfmem.viewport.farZ) > 16777215.0f;
}
+void Renderer::DoState(PointerWrap& p)
+{
+ p.Do(m_aspect_wide);
+ p.Do(m_frame_count);
+ p.Do(m_prev_efb_format);
+ p.Do(m_last_xfb_ticks);
+ p.Do(m_last_xfb_addr);
+ p.Do(m_last_xfb_width);
+ p.Do(m_last_xfb_stride);
+ p.Do(m_last_xfb_height);
+
+ if (p.GetMode() == PointerWrap::MODE_READ)
+ {
+ // Force the next xfb to be displayed.
+ m_last_xfb_id = std::numeric_limits<u64>::max();
+
+ // And actually display it.
+ Swap(m_last_xfb_addr, m_last_xfb_width, m_last_xfb_stride, m_last_xfb_height, m_last_xfb_ticks);
+ }
+}
+
std::unique_ptr<VideoCommon::AsyncShaderCompiler> Renderer::CreateAsyncShaderCompiler()
{
return std::make_unique<VideoCommon::AsyncShaderCompiler>();