mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
buffer_cache: Bring back CPU path (#3679)
It was reported this resulted in a noticeable 10+ fps drop in Driveclub so bring it back just with check to avoid it if the source range is an image alias
This commit is contained in:
@@ -365,6 +365,16 @@ void BufferCache::InlineData(VAddr address, const void* value, u32 num_bytes, bo
|
||||
}
|
||||
|
||||
void BufferCache::CopyBuffer(VAddr dst, VAddr src, u32 num_bytes, bool dst_gds, bool src_gds) {
|
||||
if (!dst_gds && !IsRegionGpuModified(dst, num_bytes)) {
|
||||
if (!src_gds && !IsRegionGpuModified(src, num_bytes) &&
|
||||
!texture_cache.FindImageFromRange(src, num_bytes)) {
|
||||
// Both buffers were not transferred to GPU yet. Can safely copy in host memory.
|
||||
memcpy(std::bit_cast<void*>(dst), std::bit_cast<void*>(src), num_bytes);
|
||||
return;
|
||||
}
|
||||
// Without a readback there's nothing we can do with this
|
||||
// Fallback to creating dst buffer on GPU to at least have this data there
|
||||
}
|
||||
texture_cache.InvalidateMemoryFromGPU(dst, num_bytes);
|
||||
auto& src_buffer = [&] -> const Buffer& {
|
||||
if (src_gds) {
|
||||
|
||||
Reference in New Issue
Block a user