summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-05-14 01:14:02 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:36:12 +0200
commita79831d9d02f7c42d82ea36210cac7952a3ef16e (patch)
treeee201e6957b5018159eafe01b6378c11fef8c4cf /src/video_core/texture_cache
parenttexture_cache: General Fixes (diff)
downloadyuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.gz
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.bz2
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.lz
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.xz
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.tar.zst
yuzu-a79831d9d02f7c42d82ea36210cac7952a3ef16e.zip
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:
}
}
+ void Guard(bool new_guard) {
+ guard_cache = new_guard;
+ }
+
void FlushRegion(CacheAddr addr, std::size_t size) {
std::lock_guard lock{mutex};
@@ -251,7 +255,7 @@ protected:
void Unregister(TSurface surface) {
std::lock_guard lock{mutex};
- if (surface->IsProtected()) {
+ if (guard_cache && surface->IsProtected()) {
return;
}
const GPUVAddr gpu_addr = surface->GetGpuAddr();
@@ -573,6 +577,9 @@ private:
u64 ticks{};
+ // Guards the cache for protection conflicts.
+ bool guard_cache{};
+
// The internal Cache is different for the Texture Cache. It's based on buckets
// of 1MB. This fits better for the purpose of this cache as textures are normaly
// large in size.