summaryrefslogtreecommitdiff
path: root/src/video_core/query_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/query_cache.h')
-rw-r--r--src/video_core/query_cache.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index 98d956b68..2f75f8801 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -176,41 +176,34 @@ public:
176 } 176 }
177 177
178 void CommitAsyncFlushes() { 178 void CommitAsyncFlushes() {
179 commited_flushes.push_back(uncommited_flushes); 179 committed_flushes.push_back(uncommitted_flushes);
180 uncommited_flushes.reset(); 180 uncommitted_flushes.reset();
181 } 181 }
182 182
183 bool HasUncommitedFlushes() { 183 bool HasUncommittedFlushes() const {
184 if (uncommited_flushes) { 184 return uncommitted_flushes != nullptr;
185 return true;
186 }
187 return false;
188 } 185 }
189 186
190 bool ShouldWaitAsyncFlushes() { 187 bool ShouldWaitAsyncFlushes() const {
191 if (commited_flushes.empty()) { 188 if (committed_flushes.empty()) {
192 return false;
193 }
194 auto& flush_list = commited_flushes.front();
195 if (!flush_list) {
196 return false; 189 return false;
197 } 190 }
198 return true; 191 return committed_flushes.front() != nullptr;
199 } 192 }
200 193
201 void PopAsyncFlushes() { 194 void PopAsyncFlushes() {
202 if (commited_flushes.empty()) { 195 if (committed_flushes.empty()) {
203 return; 196 return;
204 } 197 }
205 auto& flush_list = commited_flushes.front(); 198 auto& flush_list = committed_flushes.front();
206 if (!flush_list) { 199 if (!flush_list) {
207 commited_flushes.pop_front(); 200 committed_flushes.pop_front();
208 return; 201 return;
209 } 202 }
210 for (VAddr query_address : *flush_list) { 203 for (VAddr query_address : *flush_list) {
211 FlushAndRemoveRegion(query_address, 4); 204 FlushAndRemoveRegion(query_address, 4);
212 } 205 }
213 commited_flushes.pop_front(); 206 committed_flushes.pop_front();
214 } 207 }
215 208
216protected: 209protected:
@@ -268,10 +261,10 @@ private:
268 } 261 }
269 262
270 void AsyncFlushQuery(VAddr addr) { 263 void AsyncFlushQuery(VAddr addr) {
271 if (!uncommited_flushes) { 264 if (!uncommitted_flushes) {
272 uncommited_flushes = std::make_shared<std::unordered_set<VAddr>>(); 265 uncommitted_flushes = std::make_shared<std::unordered_set<VAddr>>();
273 } 266 }
274 uncommited_flushes->insert(addr); 267 uncommitted_flushes->insert(addr);
275 } 268 }
276 269
277 static constexpr std::uintptr_t PAGE_SIZE = 4096; 270 static constexpr std::uintptr_t PAGE_SIZE = 4096;
@@ -286,8 +279,8 @@ private:
286 279
287 std::array<CounterStream, VideoCore::NumQueryTypes> streams; 280 std::array<CounterStream, VideoCore::NumQueryTypes> streams;
288 281
289 std::shared_ptr<std::unordered_set<VAddr>> uncommited_flushes{}; 282 std::shared_ptr<std::unordered_set<VAddr>> uncommitted_flushes{};
290 std::list<std::shared_ptr<std::unordered_set<VAddr>>> commited_flushes; 283 std::list<std::shared_ptr<std::unordered_set<VAddr>>> committed_flushes;
291}; 284};
292 285
293template <class QueryCache, class HostCounter> 286template <class QueryCache, class HostCounter>