early-access version 2450

This commit is contained in:
pineappleEA 2022-01-31 12:25:49 +01:00
parent 0956837e51
commit 119ad710e0
2 changed files with 16 additions and 6 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2448. This is the source code for early-access 2450.
## Legal Notice ## Legal Notice

View file

@ -1495,21 +1495,31 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(VAddr cpu
overlap_ids.push_back(overlap_id); overlap_ids.push_back(overlap_id);
overlap.Pick(); overlap.Pick();
const VAddr overlap_cpu_addr = overlap.CpuAddr(); const VAddr overlap_cpu_addr = overlap.CpuAddr();
bool goes_left = false;
if (overlap_cpu_addr < begin) { if (overlap_cpu_addr < begin) {
goes_left = true;
cpu_addr = begin = overlap_cpu_addr; cpu_addr = begin = overlap_cpu_addr;
} }
end = std::max(end, overlap_cpu_addr + overlap.SizeBytes()); const VAddr overlap_end = overlap_cpu_addr + overlap.SizeBytes();
bool goes_right = false;
if (overlap_end > end) {
goes_right = true;
end = overlap_end;
}
stream_score += overlap.StreamScore(); stream_score += overlap.StreamScore();
if (stream_score > STREAM_LEAP_THRESHOLD && !has_stream_leap) { if (stream_score > STREAM_LEAP_THRESHOLD && !has_stream_leap) {
// When this memory region has been joined a bunch of times, we assume it's being used // When this memory region has been joined a bunch of times, we assume it's being used
// as a stream buffer. Increase the size to skip constantly recreating buffers. // as a stream buffer. Increase the size to skip constantly recreating buffers.
has_stream_leap = true; has_stream_leap = true;
if (goes_right) {
begin -= PAGE_SIZE * 256; begin -= PAGE_SIZE * 256;
cpu_addr = begin; cpu_addr = begin;
}
if (goes_left) {
end += PAGE_SIZE * 256; end += PAGE_SIZE * 256;
} }
} }
}
return OverlapResult{ return OverlapResult{
.ids = std::move(overlap_ids), .ids = std::move(overlap_ids),
.begin = begin, .begin = begin,