Make the DoState stuff less ugly

This commit is contained in:
Henrik Rydgård 2023-02-25 14:34:30 +01:00
parent 285ffbaa52
commit 9e8f1d3cb3
4 changed files with 24 additions and 17 deletions

View file

@ -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) {

View file

@ -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;

View file

@ -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();
}
}

View file

@ -10,8 +10,10 @@ public:
~GPUCommonHW();
void CopyDisplayToOutput(bool reallyDirty) override;
void DoState(PointerWrap &p) override;
protected:
void PreExecuteOp(u32 op, u32 diff);
};