summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-05-13 19:14:02 -0400
committerGravatar ReinUsesLisp2019-06-20 21:36:12 -0300
commita79831d9d02f7c42d82ea36210cac7952a3ef16e (patch)
treeee201e6957b5018159eafe01b6378c11fef8c4cf /src/video_core/texture_cache
parenttexture_cache: General Fixes (diff)
downloadyuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.gz
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.xz
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.zip
texture_cache: Implement Guard mechanism
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 419c0de5e..2ad6210dd 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -64,6 +64,10 @@ public:
64 } 64 }
65 } 65 }
66 66
67 void Guard(bool new_guard) {
68 guard_cache = new_guard;
69 }
70
67 void FlushRegion(CacheAddr addr, std::size_t size) { 71 void FlushRegion(CacheAddr addr, std::size_t size) {
68 std::lock_guard lock{mutex}; 72 std::lock_guard lock{mutex};
69 73
@@ -251,7 +255,7 @@ protected:
251 void Unregister(TSurface surface) { 255 void Unregister(TSurface surface) {
252 std::lock_guard lock{mutex}; 256 std::lock_guard lock{mutex};
253 257
254 if (surface->IsProtected()) { 258 if (guard_cache && surface->IsProtected()) {
255 return; 259 return;
256 } 260 }
257 const GPUVAddr gpu_addr = surface->GetGpuAddr(); 261 const GPUVAddr gpu_addr = surface->GetGpuAddr();
@@ -573,6 +577,9 @@ private:
573 577
574 u64 ticks{}; 578 u64 ticks{};
575 579
580 // Guards the cache for protection conflicts.
581 bool guard_cache{};
582
576 // The internal Cache is different for the Texture Cache. It's based on buckets 583 // The internal Cache is different for the Texture Cache. It's based on buckets
577 // of 1MB. This fits better for the purpose of this cache as textures are normaly 584 // of 1MB. This fits better for the purpose of this cache as textures are normaly
578 // large in size. 585 // large in size.