diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-08 16:59:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 16:59:52 +0100 |
commit | bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca (patch) | |
tree | e191f5ca2ddc770c026a8cb771d751cdbd88700a | |
parent | Merge pull request #12939 from german77/wonder (diff) | |
parent | SMMU: Ensure the backing address range matches the current (diff) | |
download | yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar.gz yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar.bz2 yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar.lz yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar.xz yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.tar.zst yuzu-bc9711cb1e921ce9764169aa6eff1ee1e9dde9ca.zip |
-rw-r--r-- | src/core/device_memory_manager.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index b026f4220..6dfee806c 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -532,6 +532,7 @@ void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size cache_bytes = 0; } }; + size_t old_vpage = (base_vaddress >> Memory::YUZU_PAGEBITS) - 1; for (; page != page_end; ++page) { CounterAtomicType& count = cached_pages->at(page >> subentries_shift).Count(page); auto [asid_2, vpage] = ExtractCPUBacking(page); @@ -547,6 +548,12 @@ void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size memory_device_inter = registered_processes[asid_2.id]; } + if (vpage != old_vpage + 1) [[unlikely]] { + release_pending(); + } + + old_vpage = vpage; + // Adds or subtracts 1, as count is a unsigned 8-bit value count.fetch_add(static_cast<CounterType>(delta), std::memory_order_release); |