From 1082468133342586ae2a5986408d163ce5aa14ca Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 29 Jun 2019 19:27:53 +1000 Subject: TextureCache: Support saving cache entries, including EFB copies --- Source/Core/VideoCommon/VideoState.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VideoState.cpp') diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index ab84e1b001..0fdeebcfa1 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -13,6 +13,8 @@ #include "VideoCommon/GeometryShaderManager.h" #include "VideoCommon/PixelEngine.h" #include "VideoCommon/PixelShaderManager.h" +#include "VideoCommon/RenderBase.h" +#include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/TextureDecoder.h" #include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VertexShaderManager.h" @@ -21,6 +23,15 @@ void VideoCommon_DoState(PointerWrap& p) { + bool software = false; + p.Do(software); + + if (p.GetMode() == PointerWrap::MODE_READ && software == true) + { + // change mode to abort load of incompatible save state. + p.SetMode(PointerWrap::MODE_VERIFY); + } + // BP Memory p.Do(bpmem); p.DoMarker("BP Memory"); @@ -63,5 +74,16 @@ void VideoCommon_DoState(PointerWrap& p) BoundingBox::DoState(p); p.DoMarker("BoundingBox"); - // TODO: search for more data that should be saved and add it here + g_texture_cache->DoState(p); + p.DoMarker("TextureCache"); + + g_renderer->DoState(p); + p.DoMarker("Renderer"); + + // Refresh state. + if (p.GetMode() == PointerWrap::MODE_READ) + { + // Inform backend of new state from registers. + BPReload(); + } } -- cgit v1.2.3