aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/query_cache.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-04-15 00:03:48 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-04-23 04:48:50 +0200
commitae99dcd5311657c62f8ed1199779d65b18e42c1f (patch)
treeb2139045203240661f924a1cbaec017ca666d16a /src/video_core/query_cache.h
parentabcc622dae1e93ffd09fe08b7373dccc6242f85d (diff)
Fence Manager: implement async fence management in a sepparate thread.
Diffstat (limited to 'src/video_core/query_cache.h')
-rw-r--r--src/video_core/query_cache.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index 8906ba6d8a..cd339b99de 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -173,15 +173,18 @@ public:
}
void CommitAsyncFlushes() {
+ std::unique_lock lock{mutex};
committed_flushes.push_back(uncommitted_flushes);
uncommitted_flushes.reset();
}
bool HasUncommittedFlushes() const {
+ std::unique_lock lock{mutex};
return uncommitted_flushes != nullptr;
}
bool ShouldWaitAsyncFlushes() const {
+ std::unique_lock lock{mutex};
if (committed_flushes.empty()) {
return false;
}
@@ -189,6 +192,7 @@ public:
}
void PopAsyncFlushes() {
+ std::unique_lock lock{mutex};
if (committed_flushes.empty()) {
return;
}
@@ -265,7 +269,7 @@ private:
VideoCore::RasterizerInterface& rasterizer;
- std::recursive_mutex mutex;
+ mutable std::recursive_mutex mutex;
std::unordered_map<u64, std::vector<CachedQuery>> cached_queries;