summaryrefslogtreecommitdiffstats
path: root/src/video_core/buffer_cache/buffer_base.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-01-18 21:14:14 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-02-13 06:17:24 +0100
commit2b95c137ff1796daf2b262f90c25104db1161b5f (patch)
tree4f5c57a9a476ba92488713e2ca99d1aa212c99ad /src/video_core/buffer_cache/buffer_base.h
parentbuffer_cache: Split CreateBuffer in separate functions (diff)
downloadyuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar.gz
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar.bz2
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar.lz
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar.xz
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.tar.zst
yuzu-2b95c137ff1796daf2b262f90c25104db1161b5f.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/buffer_cache/buffer_base.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h
index 8a5e6a3e7..0c00ae280 100644
--- a/src/video_core/buffer_cache/buffer_base.h
+++ b/src/video_core/buffer_cache/buffer_base.h
@@ -251,6 +251,16 @@ public:
flags &= ~BufferFlagBits::Picked;
}
+ /// Increases the likeliness of this being a stream buffer
+ void IncreaseStreamScore(int score) noexcept {
+ stream_score += score;
+ }
+
+ /// Returns the likeliness of this being a stream buffer
+ [[nodiscard]] int StreamScore() const noexcept {
+ return stream_score;
+ }
+
/// Returns true when vaddr -> vaddr+size is fully contained in the buffer
[[nodiscard]] bool IsInBounds(VAddr addr, u64 size) const noexcept {
return addr >= cpu_addr && addr + size <= cpu_addr + SizeBytes();
@@ -574,6 +584,7 @@ private:
VAddr cpu_addr = 0;
Words words;
BufferFlagBits flags{};
+ int stream_score = 0;
};
} // namespace VideoCommon