diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2022-10-07 12:25:04 -0700 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2022-10-09 19:32:59 -0700 |
| commit | ffed23c059f52dfbe1dbd089d6861c68b8960035 (patch) | |
| tree | fccdfd4a0887a6a46f15bda34f81bb39236956c8 /Source/Core/VideoCommon/VideoState.cpp | |
| parent | 05f3bbfa4d22bf50e803dfb1c75657e1a9f953a7 (diff) | |
Simplify saving CP state
Rather than makring some parts of VertexLoaderManager dirty in some places and some in others, do it all in VideoState. Also, since CPState no longer contains pointers/non-CP data after d039b1bc0dfaba2a88036468b6d971bb1d7e463d, we can just use p.Do on it instead of manually saving each field.
Diffstat (limited to 'Source/Core/VideoCommon/VideoState.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VideoState.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index 538c3d0904..b56c931b48 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -18,6 +18,7 @@ #include "VideoCommon/TMEM.h" #include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/TextureDecoder.h" +#include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/XFMemory.h" @@ -38,7 +39,12 @@ void VideoCommon_DoState(PointerWrap& p) p.DoMarker("BP Memory"); // CP Memory - DoCPState(p); + // We don't save g_preprocess_cp_state separately because the GPU should be + // synced around state save/load. + p.Do(g_main_cp_state); + p.DoMarker("CP Memory"); + if (p.IsReadMode()) + CopyPreprocessCPStateFromMain(); // XF Memory p.Do(xfmem); @@ -90,5 +96,6 @@ void VideoCommon_DoState(PointerWrap& p) { // Inform backend of new state from registers. BPReload(); + VertexLoaderManager::MarkAllDirty(); } } |
