diff options
Diffstat (limited to 'src/video_core/query_cache')
| -rw-r--r-- | src/video_core/query_cache/query_base.h | 1 | ||||
| -rw-r--r-- | src/video_core/query_cache/query_cache.h | 18 | ||||
| -rw-r--r-- | src/video_core/query_cache/query_stream.h | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/video_core/query_cache/query_base.h b/src/video_core/query_cache/query_base.h index 485ed669c..0ae23af9f 100644 --- a/src/video_core/query_cache/query_base.h +++ b/src/video_core/query_cache/query_base.h | |||
| @@ -18,6 +18,7 @@ enum class QueryFlagBits : u32 { | |||
| 18 | IsInvalidated = 1 << 6, ///< Indicates the value of th query has been nullified. | 18 | IsInvalidated = 1 << 6, ///< Indicates the value of th query has been nullified. |
| 19 | IsOrphan = 1 << 7, ///< Indicates the query has not been set by a guest query. | 19 | IsOrphan = 1 << 7, ///< Indicates the query has not been set by a guest query. |
| 20 | IsFence = 1 << 8, ///< Indicates the query is a fence. | 20 | IsFence = 1 << 8, ///< Indicates the query is a fence. |
| 21 | IsQueuedForAsyncFlush = 1 <<9,///< Indicates that the query can be flushed at any moment | ||
| 21 | }; | 22 | }; |
| 22 | DECLARE_ENUM_FLAG_OPERATORS(QueryFlagBits) | 23 | DECLARE_ENUM_FLAG_OPERATORS(QueryFlagBits) |
| 23 | 24 | ||
diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h index f6af48d14..f1393d5c7 100644 --- a/src/video_core/query_cache/query_cache.h +++ b/src/video_core/query_cache/query_cache.h | |||
| @@ -489,8 +489,22 @@ void QueryCacheBase<Traits>::PopAsyncFlushes() { | |||
| 489 | if (mask == 0) { | 489 | if (mask == 0) { |
| 490 | return; | 490 | return; |
| 491 | } | 491 | } |
| 492 | impl->ForEachStreamerIn(mask, | 492 | u64 ran_mask = 0; |
| 493 | [](StreamerInterface* streamer) { streamer->PopUnsyncedQueries(); }); | 493 | u64 next_phase = 0; |
| 494 | while (mask) { | ||
| 495 | impl->ForEachStreamerIn(mask, [&mask, &ran_mask, &next_phase](StreamerInterface* streamer) { | ||
| 496 | u64 dep_mask = streamer->GetDependenceMask(); | ||
| 497 | if ((dep_mask & ~ran_mask) != 0) { | ||
| 498 | next_phase |= dep_mask; | ||
| 499 | return; | ||
| 500 | } | ||
| 501 | u64 index = streamer->GetId(); | ||
| 502 | ran_mask |= (1ULL << index); | ||
| 503 | mask &= ~(1ULL << index); | ||
| 504 | streamer->PopUnsyncedQueries(); | ||
| 505 | }); | ||
| 506 | ran_mask |= next_phase; | ||
| 507 | } | ||
| 494 | } | 508 | } |
| 495 | 509 | ||
| 496 | // Invalidation | 510 | // Invalidation |
diff --git a/src/video_core/query_cache/query_stream.h b/src/video_core/query_cache/query_stream.h index dd5f95b3c..0e9275565 100644 --- a/src/video_core/query_cache/query_stream.h +++ b/src/video_core/query_cache/query_stream.h | |||
| @@ -70,6 +70,10 @@ public: | |||
| 70 | return id; | 70 | return id; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | u64 GetDependenceMask() const { | ||
| 74 | return dependance_mask; | ||
| 75 | } | ||
| 76 | |||
| 73 | protected: | 77 | protected: |
| 74 | const size_t id; | 78 | const size_t id; |
| 75 | const u64 dependance_mask; | 79 | const u64 dependance_mask; |
| @@ -78,7 +82,7 @@ protected: | |||
| 78 | template <typename QueryType> | 82 | template <typename QueryType> |
| 79 | class SimpleStreamer : public StreamerInterface { | 83 | class SimpleStreamer : public StreamerInterface { |
| 80 | public: | 84 | public: |
| 81 | SimpleStreamer(size_t id_) : StreamerInterface{id_} {} | 85 | SimpleStreamer(size_t id_, u64 dependance_mask_ = 0) : StreamerInterface{id_, dependance_mask_} {} |
| 82 | virtual ~SimpleStreamer() = default; | 86 | virtual ~SimpleStreamer() = default; |
| 83 | 87 | ||
| 84 | protected: | 88 | protected: |