mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-22 23:22:25 +00:00
parent
c8c6b945bc
commit
8ed1694a2f
@ -2634,14 +2634,32 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPPGETexture) {
|
bool canReplace = !isPPGETexture;
|
||||||
plan.replaced = &replacer_.FindNone();
|
if (entry->status & TexCacheEntry::TexStatus::STATUS_CLUT_GPU) {
|
||||||
plan.replaceValid = false;
|
_dbg_assert_(entry->format == GE_TFMT_CLUT4 || entry->format == GE_TFMT_CLUT8);
|
||||||
|
plan.decodeToClut8 = true;
|
||||||
|
// We only support 1 mip level when doing CLUT on GPU for now.
|
||||||
|
// Supporting more would be possible, just not very interesting until we need it.
|
||||||
|
plan.levelsToCreate = 1;
|
||||||
|
plan.levelsToLoad = 1;
|
||||||
|
plan.maxPossibleLevels = 1;
|
||||||
|
plan.scaleFactor = 1;
|
||||||
|
plan.saveTexture = false; // Can't yet save these properly.
|
||||||
|
canReplace = false;
|
||||||
} else {
|
} else {
|
||||||
|
plan.decodeToClut8 = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canReplace) {
|
||||||
plan.replaced = &FindReplacement(entry, plan.w, plan.h, plan.depth);
|
plan.replaced = &FindReplacement(entry, plan.w, plan.h, plan.depth);
|
||||||
plan.replaceValid = plan.replaced->Valid();
|
plan.replaceValid = plan.replaced->Valid();
|
||||||
|
} else {
|
||||||
|
plan.replaced = &replacer_.FindNone();
|
||||||
|
plan.replaceValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE! Last chance to change scale factor here!
|
||||||
|
|
||||||
plan.saveTexture = false;
|
plan.saveTexture = false;
|
||||||
if (plan.replaceValid) {
|
if (plan.replaceValid) {
|
||||||
// We're replacing, so we won't scale.
|
// We're replacing, so we won't scale.
|
||||||
@ -2652,7 +2670,7 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
|||||||
// But, we still need to create the texture at a larger size.
|
// But, we still need to create the texture at a larger size.
|
||||||
plan.replaced->GetSize(0, plan.createW, plan.createH);
|
plan.replaced->GetSize(0, plan.createW, plan.createH);
|
||||||
} else {
|
} else {
|
||||||
if (replacer_.Enabled() && !plan.replaceValid && plan.depth == 1) {
|
if (replacer_.Enabled() && !plan.replaceValid && plan.depth == 1 && canReplace) {
|
||||||
ReplacedTextureDecodeInfo replacedInfo;
|
ReplacedTextureDecodeInfo replacedInfo;
|
||||||
// TODO: Do we handle the race where a replacement becomes valid AFTER this but before we save?
|
// TODO: Do we handle the race where a replacement becomes valid AFTER this but before we save?
|
||||||
replacedInfo.cachekey = entry->CacheKey();
|
replacedInfo.cachekey = entry->CacheKey();
|
||||||
@ -2683,21 +2701,6 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
|||||||
plan.maxPossibleLevels = log2i(std::min(plan.createW, plan.createH)) + 1;
|
plan.maxPossibleLevels = log2i(std::min(plan.createW, plan.createH)) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->status & TexCacheEntry::TexStatus::STATUS_CLUT_GPU) {
|
|
||||||
_dbg_assert_(entry->format == GE_TFMT_CLUT4 || entry->format == GE_TFMT_CLUT8);
|
|
||||||
plan.decodeToClut8 = true;
|
|
||||||
// We only support 1 mip level when doing CLUT on GPU for now.
|
|
||||||
// Supporting more would be possible, just not very interesting until we need it.
|
|
||||||
plan.levelsToCreate = 1;
|
|
||||||
plan.levelsToLoad = 1;
|
|
||||||
plan.maxPossibleLevels = 1;
|
|
||||||
plan.scaleFactor = 1;
|
|
||||||
plan.saveTexture = false; // Can't yet save these properly.
|
|
||||||
// TODO: Also forcibly disable replacement, or check that the replacement is a 8-bit paletted texture.
|
|
||||||
} else {
|
|
||||||
plan.decodeToClut8 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plan.levelsToCreate == 1) {
|
if (plan.levelsToCreate == 1) {
|
||||||
entry->status |= TexCacheEntry::STATUS_NO_MIPS;
|
entry->status |= TexCacheEntry::STATUS_NO_MIPS;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user