summaryrefslogtreecommitdiff
path: root/src/video_core/rasterizer_cache.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-04-16 16:39:27 -0400
committerGravatar FernandoS272019-04-19 20:44:56 -0400
commita3eb91ed8ce3384d5bb1cf6df2cea4a6ebb5a976 (patch)
treeb686fa63959634e2ea9fdaf5974b1826392d99d0 /src/video_core/rasterizer_cache.h
parentMerge pull request #2415 from lioncash/const (diff)
downloadyuzu-a3eb91ed8ce3384d5bb1cf6df2cea4a6ebb5a976.tar.gz
yuzu-a3eb91ed8ce3384d5bb1cf6df2cea4a6ebb5a976.tar.xz
yuzu-a3eb91ed8ce3384d5bb1cf6df2cea4a6ebb5a976.zip
RasterizerCache Redesign: Flush
flushing is now responsability of children caches instead of the cache object. This change will allow the specific cache to pass extra parameters on flushing and will allow more flexibility.
Diffstat (limited to 'src/video_core/rasterizer_cache.h')
-rw-r--r--src/video_core/rasterizer_cache.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/video_core/rasterizer_cache.h b/src/video_core/rasterizer_cache.h
index 291772186..f820f3ed9 100644
--- a/src/video_core/rasterizer_cache.h
+++ b/src/video_core/rasterizer_cache.h
@@ -37,9 +37,6 @@ public:
37 /// Gets the size of the shader in guest memory, required for cache management 37 /// Gets the size of the shader in guest memory, required for cache management
38 virtual std::size_t GetSizeInBytes() const = 0; 38 virtual std::size_t GetSizeInBytes() const = 0;
39 39
40 /// Wriets any cached resources back to memory
41 virtual void Flush() = 0;
42
43 /// Sets whether the cached object should be considered registered 40 /// Sets whether the cached object should be considered registered
44 void SetIsRegistered(bool registered) { 41 void SetIsRegistered(bool registered) {
45 is_registered = registered; 42 is_registered = registered;
@@ -158,6 +155,8 @@ protected:
158 return ++modified_ticks; 155 return ++modified_ticks;
159 } 156 }
160 157
158 virtual void FlushObjectInner(const T& object) = 0;
159
161 /// Flushes the specified object, updating appropriate cache state as needed 160 /// Flushes the specified object, updating appropriate cache state as needed
162 void FlushObject(const T& object) { 161 void FlushObject(const T& object) {
163 std::lock_guard lock{mutex}; 162 std::lock_guard lock{mutex};
@@ -165,7 +164,7 @@ protected:
165 if (!object->IsDirty()) { 164 if (!object->IsDirty()) {
166 return; 165 return;
167 } 166 }
168 object->Flush(); 167 FlushObjectInner(object);
169 object->MarkAsModified(false, *this); 168 object->MarkAsModified(false, *this);
170 } 169 }
171 170