summaryrefslogtreecommitdiffstats
path: root/src/video_core/rasterizer_accelerated.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-03-03 01:57:53 +0100
committerbunnei <bunneidev@gmail.com>2021-03-03 01:57:53 +0100
commit94da1e8a7e876eaae911332e3539ffcfc783cfac (patch)
tree343c8017ef745c6fc9c4e4e300587fe42c15e1ab /src/video_core/rasterizer_accelerated.h
parentMerge pull request #6019 from Kelebek1/bcat (diff)
downloadyuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar.gz
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar.bz2
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar.lz
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar.xz
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.tar.zst
yuzu-94da1e8a7e876eaae911332e3539ffcfc783cfac.zip
Diffstat (limited to 'src/video_core/rasterizer_accelerated.h')
-rw-r--r--src/video_core/rasterizer_accelerated.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/video_core/rasterizer_accelerated.h b/src/video_core/rasterizer_accelerated.h
index 91866d7dd..9227a4adc 100644
--- a/src/video_core/rasterizer_accelerated.h
+++ b/src/video_core/rasterizer_accelerated.h
@@ -4,9 +4,8 @@
#pragma once
-#include <mutex>
-
-#include <boost/icl/interval_map.hpp>
+#include <array>
+#include <atomic>
#include "common/common_types.h"
#include "video_core/rasterizer_interface.h"
@@ -26,10 +25,24 @@ public:
void UpdatePagesCachedCount(VAddr addr, u64 size, int delta) override;
private:
- using CachedPageMap = boost::icl::interval_map<u64, int>;
- CachedPageMap cached_pages;
- std::mutex pages_mutex;
+ class CacheEntry final {
+ public:
+ CacheEntry() = default;
+
+ std::atomic_uint8_t& Count(std::size_t page) {
+ return values[page & 7];
+ }
+
+ const std::atomic_uint8_t& Count(std::size_t page) const {
+ return values[page & 7];
+ }
+
+ private:
+ std::array<std::atomic_uint8_t, 8> values{};
+ };
+ static_assert(sizeof(CacheEntry) == 8, "CacheEntry should be 8 bytes!");
+ std::array<CacheEntry, 0x800000> cached_pages;
Core::Memory::Memory& cpu_memory;
};