mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
buffer_cache: Fix CopyBuffers bug
This commit is contained in:
parent
cf9f6ef376
commit
dda2e71bd0
1 changed files with 6 additions and 2 deletions
|
@ -288,13 +288,17 @@ void BufferCache::CopyBuffer(VAddr dst, VAddr src, u32 num_bytes, bool dst_gds,
|
||||||
if (src_gds) {
|
if (src_gds) {
|
||||||
return gds_buffer;
|
return gds_buffer;
|
||||||
}
|
}
|
||||||
const auto [buffer, offset] = ObtainBuffer(src, num_bytes, false);
|
// Avoid using ObtainBuffer here as that might give us the stream buffer.
|
||||||
return *buffer;
|
const BufferId buffer_id = FindBuffer(src, num_bytes);
|
||||||
|
auto& buffer = slot_buffers[buffer_id];
|
||||||
|
SynchronizeBuffer(buffer, src, num_bytes, false);
|
||||||
|
return buffer;
|
||||||
}();
|
}();
|
||||||
auto& dst_buffer = [&] -> const Buffer& {
|
auto& dst_buffer = [&] -> const Buffer& {
|
||||||
if (dst_gds) {
|
if (dst_gds) {
|
||||||
return gds_buffer;
|
return gds_buffer;
|
||||||
}
|
}
|
||||||
|
// Prefer using ObtainBuffer here as that will auto-mark the region as GPU modified.
|
||||||
const auto [buffer, offset] = ObtainBuffer(dst, num_bytes, true);
|
const auto [buffer, offset] = ObtainBuffer(dst, num_bytes, true);
|
||||||
return *buffer;
|
return *buffer;
|
||||||
}();
|
}();
|
||||||
|
|
Loading…
Add table
Reference in a new issue