mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-07 21:23:29 +02:00
Also avoid updating images with replacements.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user