mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-21 00:27:53 -05:00
texture_cache: Implement Guard mechanism
This commit is contained in:
committed by
ReinUsesLisp
parent
7731a0e2d1
commit
a79831d9d0
@ -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.
|
||||
|
Reference in New Issue
Block a user