VideoCommon: add UninitializeEFBMemory to mirror XFB function
This commit is contained in:
parent
0f88155729
commit
62c186e14b
|
@ -2225,15 +2225,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Hack: Most games don't actually need the correct texture data in RAM
|
UninitializeEFBMemory(dst, dstStride, bytes_per_row, num_blocks_y);
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2403,6 +2395,20 @@ void TextureCacheBase::ReleaseEFBCopyStagingTexture(std::unique_ptr<AbstractStag
|
||||||
m_efb_copy_staging_texture_pool.push_back(std::move(tex));
|
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,
|
void TextureCacheBase::UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_row,
|
||||||
u32 num_blocks_y)
|
u32 num_blocks_y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -331,6 +331,7 @@ private:
|
||||||
TexAddrCache::iterator InvalidateTexture(TexAddrCache::iterator t_iter,
|
TexAddrCache::iterator InvalidateTexture(TexAddrCache::iterator t_iter,
|
||||||
bool discard_pending_efb_copy = false);
|
bool discard_pending_efb_copy = false);
|
||||||
|
|
||||||
|
void UninitializeEFBMemory(u8* dst, u32 stride, u32 bytes_per_row, u32 num_blocks_y);
|
||||||
void UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_row, u32 num_blocks_y);
|
void UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_row, u32 num_blocks_y);
|
||||||
|
|
||||||
// Precomputing the coefficients for the previous, current, and next lines for the copy filter.
|
// Precomputing the coefficients for the previous, current, and next lines for the copy filter.
|
||||||
|
|
Loading…
Reference in New Issue