diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-13 02:52:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 02:52:34 +0200 |
commit | 335a3cc115535d73974cf4e626599bb555f64d0f (patch) | |
tree | 6044d00b85b02efa4d9c86b1bf44e98030c7ff0d /src | |
parent | Merge pull request #6193 from lioncash/incguard (diff) | |
parent | query_cache: Make use of std::erase_if (diff) | |
download | yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar.gz yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar.bz2 yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar.lz yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar.xz yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.tar.zst yuzu-335a3cc115535d73974cf4e626599bb555f64d0f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/query_cache.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 203f2af05..639d7ce7e 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h @@ -208,9 +208,9 @@ public: private: /// Flushes a memory range to guest memory and removes it from the cache. void FlushAndRemoveRegion(VAddr addr, std::size_t size) { - const u64 addr_begin = static_cast<u64>(addr); - const u64 addr_end = addr_begin + static_cast<u64>(size); - const auto in_range = [addr_begin, addr_end](CachedQuery& query) { + const u64 addr_begin = addr; + const u64 addr_end = addr_begin + size; + const auto in_range = [addr_begin, addr_end](const CachedQuery& query) { const u64 cache_begin = query.GetCpuAddr(); const u64 cache_end = cache_begin + query.SizeInBytes(); return cache_begin < addr_end && addr_begin < cache_end; @@ -230,8 +230,7 @@ private: rasterizer.UpdatePagesCachedCount(query.GetCpuAddr(), query.SizeInBytes(), -1); query.Flush(); } - contents.erase(std::remove_if(std::begin(contents), std::end(contents), in_range), - std::end(contents)); + std::erase_if(contents, in_range); } } |