summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2022-06-25 00:42:17 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2022-06-27 18:20:52 -0500
commit62c186e14b35d896d67172bc5092df2af59e715e (patch)
tree600d7fa40f414767b1598226ea13b43d35084e06 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent0f8815572991511e490e87a50e4e57d1648702e0 (diff)
VideoCommon: add UninitializeEFBMemory to mirror XFB function
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 0ed5ffe014..195e4f9443 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -2225,15 +2225,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(
}
else
{
- // 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
- // can check it hasn't changed before using our copy in VRAM.
- u8* ptr = dst;
- for (u32 i = 0; i < num_blocks_y; i++)
- {
- std::memset(ptr, 0, bytes_per_row);
- ptr += dstStride;
- }
+ UninitializeEFBMemory(dst, dstStride, bytes_per_row, num_blocks_y);
}
}
@@ -2403,6 +2395,20 @@ void TextureCacheBase::ReleaseEFBCopyStagingTexture(std::unique_ptr<AbstractStag
m_efb_copy_staging_texture_pool.push_back(std::move(tex));
}
+void TextureCacheBase::UninitializeEFBMemory(u8* dst, u32 stride, u32 bytes_per_row,
+ 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
+ // can check it hasn't changed before using our copy in VRAM.
+ u8* ptr = dst;
+ for (u32 i = 0; i < num_blocks_y; i++)
+ {
+ std::memset(ptr, 0, bytes_per_row);
+ ptr += stride;
+ }
+}
+
void TextureCacheBase::UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_row,
u32 num_blocks_y)
{