summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2018-09-11 23:25:28 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2018-09-15 13:56:45 +0200
commitf2fa63783b3099ddb0d903cc50f8bddd409c6b7d (patch)
treea52a55a2bc6360c40b9a76cfe1b20ceeced1b73d /Source/Core/VideoCommon/TextureCacheBase.cpp
parentce9e9186f715408af8d9abb60b73ccb1e4d3c474 (diff)
Do not consider XFB copies for invalidating textures when loading a new texture.
This fixes severe image flickering in some cutscenes of Twin Snakes. The game appears to sometimes load a previously made XFB copy as a texture before it is actually rendered to the screen, which we took as an invitation to invalidate the XFB copy.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index cd8a024fbc..62d188e1b9 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -811,6 +811,11 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
continue;
}
+ // TODO: Some games (Rogue Squadron 3, Twin Snakes) seem to load a previously made XFB
+ // copy as a regular texture. You can see this particularly well in RS3 whenever the
+ // game freezes the image and fades it out to black on screen transitions, which fades
+ // out a purple screen in XFB2Tex. Check for this here and convert them if necessary.
+
// Do not load strided EFB copies, they are not meant to be used directly.
// Also do not directly load EFB copies, which were partly overwritten.
if (entry->IsEfbCopy() && entry->native_width == nativeW && entry->native_height == nativeH &&
@@ -863,8 +868,10 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
// improves the performance a lot in some games that use paletted textures.
// Example: Sonic the Fighters (inside Sonic Gems Collection)
// Skip EFB copies here, so they can be used for partial texture updates
+ // Also skip XFB copies, we might need to still scan them out
+ // or load them as regular textures later.
if (entry->frameCount != FRAMECOUNT_INVALID && entry->frameCount < temp_frameCount &&
- !entry->IsEfbCopy() && !(isPaletteTexture && entry->base_hash == base_hash))
+ !entry->IsCopy() && !(isPaletteTexture && entry->base_hash == base_hash))
{
temp_frameCount = entry->frameCount;
oldest_entry = iter;