Move GPU state to sceDisplay, reset GPU on load.

This commit is contained in:
Unknown W. Brackets committed 2012-12-29 12:49:49 -08:00
1 parent ea9f0be28a
commit 589916fca2
4 files changed
+29 -8

No files matched your search

+14 -1
View File
@@ -109,7 +109,6 @@ void __DisplayInit() {
vCount = 0;
hCount = 0;
hCountTotal = 0;
hasSetMode = false;
lastFrameTime = 0;
InitGfxState();
@@ -133,6 +132,20 @@ void __DisplayDoState(PointerWrap &p) {
p.Do(leaveVblankEvent);
CoreTiming::RestoreRegisterEvent(leaveVblankEvent, "LeaveVBlank", &hleLeaveVblank);
p.Do(gstate);
p.Do(gstate_c);
p.Do(gpuStats);
gpu->DoState(p);
ReapplyGfxState();
if (p.mode == p.MODE_READ) {
if (hasSetMode) {
gpu->InitClear();
}
gpu->SetDisplayFramebuffer(framebuf.topaddr, framebuf.pspFramebufLinesize, framebuf.pspFramebufFormat);
}
p.DoMarker("sceDisplay");
}
+1 -7
View File
@@ -31,13 +31,7 @@ void __GeInit()
void __GeDoState(PointerWrap &p)
{
p.Do(gstate);
p.Do(gstate_c);
p.Do(gpuStats);
ReapplyGfxState();
gpu->InvalidateCache(0, -1);
gpu->DoState(p);
// Everything is done in sceDisplay.
p.DoMarker("sceGe");
}
+13
View File
@@ -1120,3 +1120,16 @@ void GLES_GPU::InvalidateCache(u32 addr, int size) {
void GLES_GPU::Flush() {
transformDraw_.Flush();
}
void GLES_GPU::DoState(PointerWrap &p) {
GPUCommon::DoState(p);
TextureCache_Clear(true);
gstate_c.textureChanged = true;
for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) {
fbo_destroy((*iter)->fbo);
delete (*iter);
}
vfbs_.clear();
shaderManager_->ClearCache(true);
}
+1
View File
@@ -53,6 +53,7 @@ public:
virtual void DumpNextFrame();
virtual void Flush();
virtual void DoState(PointerWrap &p);
private:
void DoBlockTransfer();