mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
Don't sync entire buffers
This commit is contained in:
parent
ec391a4739
commit
63055efdd4
@ -916,12 +916,10 @@ void BufferCache::SynchronizeBuffersInRange(VAddr device_addr, u64 size) {
|
|||||||
VAddr device_addr_end = device_addr + size;
|
VAddr device_addr_end = device_addr + size;
|
||||||
ForEachBufferInRange(device_addr, size, [&](BufferId buffer_id, Buffer& buffer) {
|
ForEachBufferInRange(device_addr, size, [&](BufferId buffer_id, Buffer& buffer) {
|
||||||
RENDERER_TRACE;
|
RENDERER_TRACE;
|
||||||
// Note that this function synchronizes the whole buffer, not just the range.
|
VAddr start = std::max(buffer.CpuAddr(), device_addr);
|
||||||
// This is because this function is used to sync buffers before using a
|
VAddr end = std::min(buffer.CpuAddr() + buffer.SizeBytes(), device_addr_end);
|
||||||
// shader that uses DMA.
|
u32 size = static_cast<u32>(end - start);
|
||||||
// The ideal solution would be to sync all the mapped regions but it is
|
SynchronizeBuffer(buffer, start, size, false);
|
||||||
// very slow.
|
|
||||||
SynchronizeBuffer(buffer, buffer.CpuAddr(), buffer.SizeBytes(), false);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user