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;
|
||||
ForEachBufferInRange(device_addr, size, [&](BufferId buffer_id, Buffer& buffer) {
|
||||
RENDERER_TRACE;
|
||||
// Note that this function synchronizes the whole buffer, not just the range.
|
||||
// This is because this function is used to sync buffers before using a
|
||||
// shader that uses DMA.
|
||||
// The ideal solution would be to sync all the mapped regions but it is
|
||||
// very slow.
|
||||
SynchronizeBuffer(buffer, buffer.CpuAddr(), buffer.SizeBytes(), false);
|
||||
VAddr start = std::max(buffer.CpuAddr(), device_addr);
|
||||
VAddr end = std::min(buffer.CpuAddr() + buffer.SizeBytes(), device_addr_end);
|
||||
u32 size = static_cast<u32>(end - start);
|
||||
SynchronizeBuffer(buffer, start, size, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user