Also avoid updating images with replacements.

This commit is contained in:
Unknown W. Brackets
2016-06-06 23:02:56 -07:00
parent fc77e2f8fc
commit 65ae92c78b
2 changed files with 15 additions and 3 deletions
+5
View File
@@ -1328,6 +1328,11 @@ void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry, bool replaceImage
int h = gstate.getTextureHeight(0);
ReplacedTexture &replaced = replacer.FindReplacement(cachekey, entry->fullhash, w, h);
if (replaced.GetSize(0, w, h)) {
if (replaceImages) {
// Since we're replacing the texture, we can't replace the image inside.
ReleaseTexture(entry);
replaceImages = false;
}
// We're replacing, so we won't scale.
scaleFactor = 1;
entry->status |= TexCacheEntry::STATUS_IS_SCALED;
+10 -3
View File
@@ -1389,9 +1389,6 @@ void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages)
return;
}
glBindTexture(GL_TEXTURE_2D, entry->textureName);
lastBoundTexture = entry->textureName;
// Adjust maxLevel to actually present levels..
bool badMipSizes = false;
int maxLevel = entry->maxLevel;
@@ -1434,6 +1431,13 @@ void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages)
int h = gstate.getTextureHeight(0);
ReplacedTexture &replaced = replacer.FindReplacement(cachekey, entry->fullhash, w, h);
if (replaced.GetSize(0, w, h)) {
if (replaceImages) {
// Since we're replacing the texture, we can't replace the image inside.
glDeleteTextures(1, &entry->textureName);
entry->textureName = AllocTextureName();
replaceImages = false;
}
// We're replacing, so we won't scale.
scaleFactor = 1;
entry->status |= TexCacheEntry::STATUS_IS_SCALED;
@@ -1463,6 +1467,9 @@ void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages)
}
}
glBindTexture(GL_TEXTURE_2D, entry->textureName);
lastBoundTexture = entry->textureName;
// Disabled this due to issue #6075: https://github.com/hrydgard/ppsspp/issues/6075
// This breaks Dangan Ronpa 2 with mipmapping enabled. Why? No idea, it shouldn't.
// glTexStorage2D probably has few benefits for us anyway.