Get rid of depalFBOs when overwriting textures.

Just in case they are not always used as framebuffers.  We set to 0 later
anyway.
This commit is contained in:
Unknown W. Brackets 2014-05-27 23:07:58 -07:00
parent 410fc713a4
commit 4195eac04f

@ -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...");