Batch contiguous GMMU ranges into one

This commit is contained in:
Billy Laws 2022-10-16 17:53:52 +01:00
parent e52dbf202f
commit 77d76ed05a

View File

@ -253,6 +253,10 @@ namespace skyline {
if (cpuAccessCallback)
cpuAccessCallback(cpuBlock);
// Batch contiguous ranges into one
if (!ranges.empty() && ranges.back().data() + ranges.back().size() == cpuBlock.data())
ranges.back() = {ranges.back().data(), ranges.back().size() + cpuBlock.size()};
else
ranges.push_back(cpuBlock);
} else {
ranges.push_back(span<u8>{static_cast<u8*>(nullptr), blockSize});