summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2026-10-30 15:14:15 -0500
committerGitHub <noreply@github.com>2026-10-30 15:14:15 -0500
commit2c6a598fae31be8c123181e74e3f2f08d601e0d3 (patch)
treec0e5feaf6c5d03ea8a8e4e23aea6f997fb000797 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent3eb30c7620b4475b2e0404228ba0d2b238a132f1 (diff)
parent8c1f30bb3043bff6b7d204fc162395d1fcd817c5 (diff)
Merge pull request #14866 from SuperSamus/efb-to-texture-clear-byte
VideoCommon: Option for byte to memset in RAM when `EFBToTextureEnable = True`
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 0282914424..44020bbc90 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -2493,12 +2493,19 @@ void TextureCacheBase::UninitializeEFBMemory(u8* dst, u32 stride, u32 bytes_per_
u32 num_blocks_y)
{
// Hack: Most games don't actually need the correct texture data in RAM
- // and we can just keep a copy in VRAM. We zero the memory so we
+ // and we can just keep a copy in VRAM. We clear the memory so we
// can check it hasn't changed before using our copy in VRAM.
+ // Note: Some games memset that memory (e.g. Rhythm Heaven Fever).
+ // In that case the clear byte must be different from the game's,
+ // otherwise the data in RAM doesn't change and Dolphin won't
+ // invalidate the stale texture in VRAM.
+ // Setting a clear byte different from 0 is also useful when the
+ // game does use the texture from RAM, if we can more closely
+ // resemble an actual EFB copy (e.g. Excite Truck).
u8* ptr = dst;
for (u32 i = 0; i < num_blocks_y; i++)
{
- std::memset(ptr, 0, bytes_per_row);
+ std::memset(ptr, g_ActiveConfig.uSkipEFBCopyToRamClearByte, bytes_per_row);
ptr += stride;
}
}