mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 17:00:57 +01:00
buffer_cache: Simplify clear logic
Use existing helper functions and avoid looping when only one buffer has to be active.
This commit is contained in:
parent
c53b688411
commit
6e2ca7fbee
1 changed files with 2 additions and 6 deletions
|
@ -553,13 +553,9 @@ bool BufferCache<P>::DMAClear(GPUVAddr dst_address, u64 amount, u32 value) {
|
||||||
ClearDownload(subtract_interval);
|
ClearDownload(subtract_interval);
|
||||||
common_ranges.subtract(subtract_interval);
|
common_ranges.subtract(subtract_interval);
|
||||||
|
|
||||||
BufferId buffer;
|
const BufferId buffer = FindBuffer(*cpu_dst_address, static_cast<u32>(size));
|
||||||
do {
|
|
||||||
has_deleted_buffers = false;
|
|
||||||
buffer = FindBuffer(*cpu_dst_address, static_cast<u32>(size));
|
|
||||||
} while (has_deleted_buffers);
|
|
||||||
auto& dest_buffer = slot_buffers[buffer];
|
auto& dest_buffer = slot_buffers[buffer];
|
||||||
const u32 offset = static_cast<u32>(*cpu_dst_address - dest_buffer.CpuAddr());
|
const u32 offset = dest_buffer.Offset(*cpu_dst_address);
|
||||||
runtime.ClearBuffer(dest_buffer, offset, size, value);
|
runtime.ClearBuffer(dest_buffer, offset, size, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue