mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Make sure not to leak any enabled vertex arrays.
When returning to EmuScreen, we need to reset any enabled vertex arrays or we could crash in EmuScreen. Also, when starting a frame / dirting the shader, make sure also to toggle the vertex arrays.
This commit is contained in:
parent
b8ad665b53
commit
6d104edb5d
6 changed files with 11 additions and 1 deletions
|
@ -454,6 +454,8 @@ void PSP_RunLoopUntil(u64 globalticks) {
|
|||
} else {
|
||||
mipsr4k.RunLoopUntil(globalticks);
|
||||
}
|
||||
|
||||
gpu->CleanupBeforeUI();
|
||||
}
|
||||
|
||||
void PSP_RunLoopFor(int cycles) {
|
||||
|
|
|
@ -2104,6 +2104,11 @@ void GLES_GPU::ClearShaderCache() {
|
|||
shaderManager_->ClearCache(true);
|
||||
}
|
||||
|
||||
void GLES_GPU::CleanupBeforeUI() {
|
||||
// Clear any enabled vertex arrays.
|
||||
shaderManager_->DirtyLastShader();
|
||||
}
|
||||
|
||||
std::vector<FramebufferInfo> GLES_GPU::GetFramebufferList() {
|
||||
return framebufferManager_.GetFramebufferList();
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
// Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*.
|
||||
virtual void Resized();
|
||||
virtual void ClearShaderCache();
|
||||
virtual void CleanupBeforeUI();
|
||||
virtual bool DecodeTexture(u8* dest, GPUgstate state) {
|
||||
return textureCache_.DecodeTexture(dest, state);
|
||||
}
|
||||
|
|
|
@ -662,7 +662,7 @@ void ShaderManager::DirtyShader() {
|
|||
// Forget the last shader ID
|
||||
lastFSID_.clear();
|
||||
lastVSID_.clear();
|
||||
lastShader_ = 0;
|
||||
DirtyLastShader();
|
||||
globalDirty_ = 0xFFFFFFFF;
|
||||
shaderSwitchDirty_ = 0;
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@ public:
|
|||
return std::vector<FramebufferInfo>();
|
||||
}
|
||||
virtual void ClearShaderCache() {}
|
||||
virtual void CleanupBeforeUI() {}
|
||||
|
||||
protected:
|
||||
// To avoid virtual calls to PreExecuteOp().
|
||||
|
|
|
@ -269,6 +269,7 @@ public:
|
|||
// Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*.
|
||||
virtual void Resized() = 0;
|
||||
virtual void ClearShaderCache() = 0;
|
||||
virtual void CleanupBeforeUI() = 0;
|
||||
virtual bool FramebufferDirty() = 0;
|
||||
virtual bool FramebufferReallyDirty() = 0;
|
||||
virtual bool BusyDrawing() = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue