diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-07-25 13:50:57 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-25 13:50:57 +1000 |
| commit | ac9912bad3ad35b1ef27151ba724a3424c110acc (patch) | |
| tree | 3f6873682f9c6f2570ed0123be82475cc62873d4 /Source/Core/VideoCommon/VideoState.cpp | |
| parent | d82e0e0761aa8cf08048aed64011f0edf5d967a8 (diff) | |
| parent | 2d4d61e967baa460fa45abd4fd6bccfb12fe3cac (diff) | |
Merge pull request #6321 from stenzek/efb-savestates
Support saving EFB and texture cache in save states
Diffstat (limited to 'Source/Core/VideoCommon/VideoState.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VideoState.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index ab84e1b001..9b6418f98f 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -10,9 +10,12 @@ #include "VideoCommon/CPMemory.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" +#include "VideoCommon/FramebufferManager.h" #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 +24,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 +75,19 @@ 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_framebuffer_manager->DoState(p); + p.DoMarker("FramebufferManager"); + + 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(); + } } |
