diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 8f8c410fa1..2e683d73be 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -2867,17 +2867,6 @@ void GPUCommon::DoState(PointerWrap &p) { if (s >= 6) { Do(p, edramTranslation_); } - - // TODO: Some of these things may not be necessary. - // None of these are necessary when saving. - // The textureCache_ check avoids this getting called in SoftGPU. - if (p.mode == p.MODE_READ && !PSP_CoreParameter().frozen && textureCache_) { - textureCache_->Clear(true); - drawEngineCommon_->ClearTrackedVertexArrays(); - - gstate_c.Dirty(DIRTY_TEXTURE_IMAGE); - framebufferManager_->DestroyAllFBOs(); - } } void GPUCommon::InterruptStart(int listid) { diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index ddc955a237..fd17ebc6e3 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -330,9 +330,10 @@ protected: void UpdateMSAALevel(Draw::DrawContext *draw); + DrawEngineCommon *drawEngineCommon_ = nullptr; + FramebufferManagerCommon *framebufferManager_ = nullptr; TextureCacheCommon *textureCache_ = nullptr; - DrawEngineCommon *drawEngineCommon_ = nullptr; ShaderManagerCommon *shaderManager_ = nullptr; bool flushOnParams_ = true; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index a2307d734b..27dc1981b7 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -1,13 +1,14 @@ #include "Common/GPU/thin3d.h" +#include "Common/Serialize/Serializer.h" + +#include "Core/System.h" + #include "GPU/GPUCommonHW.h" #include "GPU/Common/DrawEngineCommon.h" +#include "GPU/Common/TextureCacheCommon.h" #include "GPU/Common/FramebufferManagerCommon.h" - -GPUCommonHW::GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw) : GPUCommon(gfxCtx, draw) { - -} - +GPUCommonHW::GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw) : GPUCommon(gfxCtx, draw) {} GPUCommonHW::~GPUCommonHW() {} void GPUCommonHW::PreExecuteOp(u32 op, u32 diff) { @@ -24,3 +25,17 @@ void GPUCommonHW::CopyDisplayToOutput(bool reallyDirty) { gstate_c.Dirty(DIRTY_TEXTURE_IMAGE); } + +void GPUCommonHW::DoState(PointerWrap &p) { + GPUCommon::DoState(p); + + // TODO: Some of these things may not be necessary. + // None of these are necessary when saving. + if (p.mode == p.MODE_READ && !PSP_CoreParameter().frozen) { + textureCache_->Clear(true); + drawEngineCommon_->ClearTrackedVertexArrays(); + + gstate_c.Dirty(DIRTY_TEXTURE_IMAGE); + framebufferManager_->DestroyAllFBOs(); + } +} diff --git a/GPU/GPUCommonHW.h b/GPU/GPUCommonHW.h index d0ff630437..aa0a189564 100644 --- a/GPU/GPUCommonHW.h +++ b/GPU/GPUCommonHW.h @@ -10,8 +10,10 @@ public: ~GPUCommonHW(); void CopyDisplayToOutput(bool reallyDirty) override; + void DoState(PointerWrap &p) override; protected: void PreExecuteOp(u32 op, u32 diff); + };