From 2be579e8bad372e7a7433a7d6300939ecef4c654 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sun, 1 Jan 2012 12:46:02 -0800 Subject: fixed some graphics problems with loading savestates (for example, wrong colors on title screen of metroid prime 3) --- Source/Core/VideoCommon/Src/VideoState.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/Src/VideoState.cpp') diff --git a/Source/Core/VideoCommon/Src/VideoState.cpp b/Source/Core/VideoCommon/Src/VideoState.cpp index b1c1ed0889..5a677a2460 100644 --- a/Source/Core/VideoCommon/Src/VideoState.cpp +++ b/Source/Core/VideoCommon/Src/VideoState.cpp @@ -24,6 +24,8 @@ #include "Fifo.h" #include "CommandProcessor.h" #include "PixelEngine.h" +#include "PixelShaderManager.h" +#include "VertexShaderManager.h" static void DoState(PointerWrap &p) { @@ -48,12 +50,17 @@ static void DoState(PointerWrap &p) CommandProcessor::DoState(p); PixelEngine::DoState(p); + + // the old way of replaying current bpmem as writes to push side effects to pixel shader manager doesn't really work. + PixelShaderManager::DoState(p); + VertexShaderManager::DoState(p); + + // TODO: search for more data that should be saved and add it here } void VideoCommon_DoState(PointerWrap &p) { DoState(p); - //TODO: search for more data that should be saved and add it here } void VideoCommon_RunLoop(bool enable) -- cgit v1.2.3 From ae242e5675b71c6c7019b31bde0abd61ba8be875 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sun, 1 Jan 2012 13:52:31 -0800 Subject: added some missing VideoBackendHardware data to savestates. I think this makes savestates more stable (fewer "GFX FIFO: Unknown Opcode" errors) in dual core mode. also added some extra verification markers around here, to potentially give better info on future version mismatches --- Source/Core/VideoCommon/Src/VideoState.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/Src/VideoState.cpp') diff --git a/Source/Core/VideoCommon/Src/VideoState.cpp b/Source/Core/VideoCommon/Src/VideoState.cpp index 5a677a2460..8b1045b71f 100644 --- a/Source/Core/VideoCommon/Src/VideoState.cpp +++ b/Source/Core/VideoCommon/Src/VideoState.cpp @@ -31,29 +31,42 @@ static void DoState(PointerWrap &p) { // BP Memory p.Do(bpmem); - // CP Memory + p.DoMarker("BP Memory"); + + // CP Memory p.DoArray(arraybases, 16); p.DoArray(arraystrides, 16); p.Do(MatrixIndexA); p.Do(MatrixIndexB); p.Do(g_VtxDesc.Hex); p.DoArray(g_VtxAttr, 8); + p.DoMarker("CP Memory"); // XF Memory p.Do(xfregs); p.DoArray(xfmem, XFMEM_SIZE); - // Texture decoder + p.DoMarker("XF Memory"); + + // Texture decoder p.DoArray(texMem, TMEM_SIZE); + p.DoMarker("texMem"); // FIFO Fifo_DoState(p); + p.DoMarker("Fifo"); CommandProcessor::DoState(p); - PixelEngine::DoState(p); + p.DoMarker("CommandProcessor"); + + PixelEngine::DoState(p); + p.DoMarker("PixelEngine"); // the old way of replaying current bpmem as writes to push side effects to pixel shader manager doesn't really work. PixelShaderManager::DoState(p); + p.DoMarker("PixelShaderManager"); + VertexShaderManager::DoState(p); + p.DoMarker("VertexShaderManager"); // TODO: search for more data that should be saved and add it here } -- cgit v1.2.3 From 99b202fd2eeac16e3c7776838e7b70c04a8a0883 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Wed, 4 Jan 2012 00:42:22 -0800 Subject: savestate vertexmanager (base) since it affects VertexLoader::RunVertices which affects g_pVideoData --- Source/Core/VideoCommon/Src/VideoState.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core/VideoCommon/Src/VideoState.cpp') diff --git a/Source/Core/VideoCommon/Src/VideoState.cpp b/Source/Core/VideoCommon/Src/VideoState.cpp index 8b1045b71f..ad5384cda9 100644 --- a/Source/Core/VideoCommon/Src/VideoState.cpp +++ b/Source/Core/VideoCommon/Src/VideoState.cpp @@ -26,6 +26,7 @@ #include "PixelEngine.h" #include "PixelShaderManager.h" #include "VertexShaderManager.h" +#include "VertexManagerBase.h" static void DoState(PointerWrap &p) { @@ -68,6 +69,9 @@ static void DoState(PointerWrap &p) VertexShaderManager::DoState(p); p.DoMarker("VertexShaderManager"); + VertexManager::DoState(p); + p.DoMarker("VertexManager"); + // TODO: search for more data that should be saved and add it here } -- cgit v1.2.3