mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Cleanup fbTexInfo_ when detaching framebuffers.
This commit is contained in:
1 parent
aad04f2941
commit
f31fbb9417
5 files changed
+35
-19
No files matched your search
@@ -118,7 +118,7 @@ void TextureCache::Clear(bool delete_them) {
|
||||
|
||||
void TextureCache::DeleteTexture(TexCache::iterator it) {
|
||||
glDeleteTextures(1, &it->second.textureName);
|
||||
auto fbInfo = fbTexInfo_.find(it->second.addr);
|
||||
auto fbInfo = fbTexInfo_.find(it->first);
|
||||
if (fbInfo != fbTexInfo_.end()) {
|
||||
fbTexInfo_.erase(fbInfo);
|
||||
}
|
||||
@@ -716,6 +716,9 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffe
|
||||
bool useBufferedRendering = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
if (useBufferedRendering) {
|
||||
const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat();
|
||||
const u64 cachekey = entry->CacheKey();
|
||||
const auto &fbInfo = fbTexInfo_[cachekey];
|
||||
|
||||
DepalShader *depal = nullptr;
|
||||
if ((entry->status & TexCacheEntry::STATUS_DEPALETTIZE) && !g_Config.bDisableSlowFramebufEffects) {
|
||||
depal = depalShaderCache_->GetDepalettizeShader(clutFormat, framebuffer->drawnFormat);
|
||||
@@ -740,8 +743,8 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffe
|
||||
// We need to force it, since we may have set it on a texture before attaching.
|
||||
gstate_c.curTextureWidth = framebuffer->bufferWidth;
|
||||
gstate_c.curTextureHeight = framebuffer->bufferHeight;
|
||||
gstate_c.curTextureXOffset = fbTexInfo_[entry->addr].xOffset;
|
||||
gstate_c.curTextureYOffset = fbTexInfo_[entry->addr].yOffset;
|
||||
gstate_c.curTextureXOffset = fbInfo.xOffset;
|
||||
gstate_c.curTextureYOffset = fbInfo.yOffset;
|
||||
gstate_c.needShaderTexClamp = gstate_c.curTextureWidth != (u32)gstate.getTextureWidth(0) || gstate_c.curTextureHeight != (u32)gstate.getTextureHeight(0);
|
||||
if (gstate_c.curTextureXOffset != 0 || gstate_c.curTextureYOffset != 0) {
|
||||
gstate_c.needShaderTexClamp = true;
|
||||
|
||||
Reference in new issue
Block a user