From 4195eac04f672c4be0946c6f6fd3723d01826a1c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 27 May 2014 23:07:58 -0700 Subject: [PATCH] Get rid of depalFBOs when overwriting textures. Just in case they are not always used as framebuffers. We set to 0 later anyway. --- GPU/GLES/TextureCache.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 3345dce64..839a759c7 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -899,6 +899,7 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry) { } if (program) { GLuint clutTexture = depalShaderCache_->GetClutTexture(clutHash_, clutBuf_); + // TODO: What if the renderWidth or renderHeight changes for the attached FBO? if (!entry->depalFBO) { entry->depalFBO = fbo_create(entry->framebuffer->renderWidth, entry->framebuffer->renderHeight, 1, false, FBO_8888); } @@ -1197,6 +1198,12 @@ void TextureCache::SetTexture(bool force) { } } } + + // If we had a depalFBO, get rid of it now. + if (entry->depalFBO) { + fbo_destroy(entry->depalFBO); + entry->depalFBO = 0; + } } } else { VERBOSE_LOG(G3D, "No texture in cache, decoding...");