mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
GLES: Free textures on device lost, and unsubmitted step data at exit
- The texture and fragment test caches dropped their GLRTexture objects on DeviceLost without queueing them for deletion, leaking them on every Android background/resume. The deleter already skips the GL calls when the context is gone. - GLRenderManager::ThreadEnd cleared unsubmitted init and render steps without freeing the data they own. Run them through the dry run instead, which now also frees stereo matrices and shader code. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
b72927bbeb
commit
39049a67fd
5 files changed
+15
-10
No files matched your search
@@ -144,7 +144,7 @@ GLRTexture *FragmentTestCacheGLES::CreateTestTexture(const GEComparison funcs[4]
|
||||
}
|
||||
|
||||
void FragmentTestCacheGLES::Clear(bool deleteThem) {
|
||||
if (deleteThem) {
|
||||
if (deleteThem && render_) {
|
||||
for (const auto &[_, v] : cache_) {
|
||||
render_->DeleteTexture(v.texture);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ public:
|
||||
void BindTestTexture(int slot);
|
||||
|
||||
void DeviceLost() {
|
||||
Clear(false);
|
||||
// Queue the deletes anyway, the deleter frees the GLRTexture objects and skips the GL calls if needed.
|
||||
Clear(true);
|
||||
render_ = nullptr;
|
||||
}
|
||||
void DeviceRestore(Draw::DrawContext *draw);
|
||||
|
||||
@@ -51,10 +51,10 @@ void TextureCacheGLES::SetFramebufferManager(FramebufferManagerGLES *fbManager)
|
||||
}
|
||||
|
||||
void TextureCacheGLES::ReleaseTexture(TexCacheEntry *entry, bool delete_them) {
|
||||
if (delete_them) {
|
||||
if (entry->textureName) {
|
||||
render_->DeleteTexture(entry->textureName);
|
||||
}
|
||||
// Delete even when !delete_them (device lost): the GLRTexture is a heap object that only the deleter
|
||||
// frees, and the deleter skips the GL calls itself once the context is gone.
|
||||
if (entry->textureName && render_) {
|
||||
render_->DeleteTexture(entry->textureName);
|
||||
}
|
||||
entry->textureName = nullptr;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user