summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-08-29 18:19:53 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-08-29 18:19:53 +0200
commitff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7 (patch)
tree2392bbc76f6005587df9d1b1415e35818fba0ac7 /src/video_core
parentGarbage Collection: enable as default, eliminate option. (diff)
downloadyuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar.gz
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar.bz2
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar.lz
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar.xz
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.tar.zst
yuzu-ff48f06fb92e5fe2105fd6b4c5d4f57bbb2714c7.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/buffer_cache/buffer_base.h9
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h6
-rw-r--r--src/video_core/texture_cache/image_base.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h
index 4b696a60f..18a3390c0 100644
--- a/src/video_core/buffer_cache/buffer_base.h
+++ b/src/video_core/buffer_cache/buffer_base.h
@@ -297,7 +297,13 @@ public:
return words.size_bytes;
}
- size_t lru_id;
+ size_t getLRUID() const noexcept {
+ return lru_id;
+ }
+
+ void setLRUID(size_t lru_id_) {
+ lru_id = lru_id_;
+ }
private:
template <Type type>
@@ -597,6 +603,7 @@ private:
Words words;
BufferFlagBits flags{};
int stream_score = 0;
+ size_t lru_id = SIZE_MAX;
};
} // namespace VideoCommon
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index e40aa7fe6..617435968 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -1539,10 +1539,10 @@ void BufferCache<P>::ChangeRegister(BufferId buffer_id) {
const auto size = buffer.SizeBytes();
if (insert) {
total_used_memory += Common::AlignUp(size, 1024);
- buffer.lru_id = lru_cache.Insert(buffer_id, frame_tick);
+ buffer.setLRUID(lru_cache.Insert(buffer_id, frame_tick));
} else {
total_used_memory -= Common::AlignUp(size, 1024);
- lru_cache.Free(buffer.lru_id);
+ lru_cache.Free(buffer.getLRUID());
}
const VAddr cpu_addr_begin = buffer.CpuAddr();
const VAddr cpu_addr_end = cpu_addr_begin + size;
@@ -1560,7 +1560,7 @@ void BufferCache<P>::ChangeRegister(BufferId buffer_id) {
template <class P>
void BufferCache<P>::TouchBuffer(Buffer& buffer, BufferId buffer_id) noexcept {
if (buffer_id != NULL_BUFFER_ID) {
- lru_cache.Touch(buffer.lru_id, frame_tick);
+ lru_cache.Touch(buffer.getLRUID(), frame_tick);
}
}
diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h
index 662089e3d..0c17a791b 100644
--- a/src/video_core/texture_cache/image_base.h
+++ b/src/video_core/texture_cache/image_base.h
@@ -80,7 +80,7 @@ struct ImageBase {
VAddr cpu_addr_end = 0;
u64 modification_tick = 0;
- size_t lru_index = ~0;
+ size_t lru_index = SIZE_MAX;
std::array<u32, MAX_MIP_LEVELS> mip_level_offsets{};