diff options
Diffstat (limited to 'src/video_core/query_cache.h')
| -rw-r--r-- | src/video_core/query_cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 8906ba6d8..cd339b99d 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h | |||
| @@ -173,15 +173,18 @@ public: | |||
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | void CommitAsyncFlushes() { | 175 | void CommitAsyncFlushes() { |
| 176 | std::unique_lock lock{mutex}; | ||
| 176 | committed_flushes.push_back(uncommitted_flushes); | 177 | committed_flushes.push_back(uncommitted_flushes); |
| 177 | uncommitted_flushes.reset(); | 178 | uncommitted_flushes.reset(); |
| 178 | } | 179 | } |
| 179 | 180 | ||
| 180 | bool HasUncommittedFlushes() const { | 181 | bool HasUncommittedFlushes() const { |
| 182 | std::unique_lock lock{mutex}; | ||
| 181 | return uncommitted_flushes != nullptr; | 183 | return uncommitted_flushes != nullptr; |
| 182 | } | 184 | } |
| 183 | 185 | ||
| 184 | bool ShouldWaitAsyncFlushes() const { | 186 | bool ShouldWaitAsyncFlushes() const { |
| 187 | std::unique_lock lock{mutex}; | ||
| 185 | if (committed_flushes.empty()) { | 188 | if (committed_flushes.empty()) { |
| 186 | return false; | 189 | return false; |
| 187 | } | 190 | } |
| @@ -189,6 +192,7 @@ public: | |||
| 189 | } | 192 | } |
| 190 | 193 | ||
| 191 | void PopAsyncFlushes() { | 194 | void PopAsyncFlushes() { |
| 195 | std::unique_lock lock{mutex}; | ||
| 192 | if (committed_flushes.empty()) { | 196 | if (committed_flushes.empty()) { |
| 193 | return; | 197 | return; |
| 194 | } | 198 | } |
| @@ -265,7 +269,7 @@ private: | |||
| 265 | 269 | ||
| 266 | VideoCore::RasterizerInterface& rasterizer; | 270 | VideoCore::RasterizerInterface& rasterizer; |
| 267 | 271 | ||
| 268 | std::recursive_mutex mutex; | 272 | mutable std::recursive_mutex mutex; |
| 269 | 273 | ||
| 270 | std::unordered_map<u64, std::vector<CachedQuery>> cached_queries; | 274 | std::unordered_map<u64, std::vector<CachedQuery>> cached_queries; |
| 271 | 275 | ||