From ffed23c059f52dfbe1dbd089d6861c68b8960035 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Fri, 7 Oct 2022 12:25:04 -0700 Subject: 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. --- Source/Core/VideoCommon/VideoState.cpp | 9 ++++++++- 1 file changed, 8 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 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(); } } -- cgit v1.2.3