mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Fix another replacer lifecycle issue, causing unnecessary texture invalidation.
This commit is contained in:
parent
44c4e63753
commit
b253225815
@ -515,6 +515,7 @@ void TextureReplacer::PopulateReplacement(ReplacedTexture *texture, u64 cachekey
|
||||
|
||||
if (!foundReplacement || ignored) {
|
||||
// nothing to do?
|
||||
texture->prepareDone_ = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -529,16 +529,18 @@ TexCacheEntry *TextureCacheCommon::SetTexture() {
|
||||
int h0 = gstate.getTextureHeight(0);
|
||||
int d0 = 1;
|
||||
ReplacedTexture *replaced = FindReplacement(entry, w0, h0, d0);
|
||||
if (replaced && replaced->IsInvalid()) {
|
||||
entry->status &= ~TexCacheEntry::STATUS_TO_REPLACE;
|
||||
if (g_Config.bSaveNewTextures) {
|
||||
// Load once more to actually save.
|
||||
if (replaced) {
|
||||
if (replaced->IsInvalid()) {
|
||||
entry->status &= ~TexCacheEntry::STATUS_TO_REPLACE;
|
||||
if (g_Config.bSaveNewTextures) {
|
||||
// Load once more to actually save.
|
||||
match = false;
|
||||
reason = "replacing";
|
||||
}
|
||||
} else {
|
||||
match = false;
|
||||
reason = "replacing";
|
||||
}
|
||||
} else {
|
||||
match = false;
|
||||
reason = "replacing";
|
||||
}
|
||||
}
|
||||
|
||||
@ -2784,7 +2786,7 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
||||
|
||||
if (canReplace) {
|
||||
plan.replaced = FindReplacement(entry, plan.w, plan.h, plan.depth);
|
||||
plan.replaceValid = plan.replaced ? plan.replaced->Valid() : plan.replaced;
|
||||
plan.replaceValid = plan.replaced ? plan.replaced->Valid() : false;
|
||||
} else {
|
||||
plan.replaced = nullptr;
|
||||
plan.replaceValid = false;
|
||||
|
Loading…
Reference in New Issue
Block a user