diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-08-06 09:38:16 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-09-23 23:05:30 +0200 |
commit | 282ae8fa51e060e6d4ef026b734aa871b1b9331e (patch) | |
tree | 3bc4603b6add0582315dc65544f1986427e4182d /src/video_core/query_cache/query_stream.h | |
parent | QueryCache: Implement dependant queries. (diff) | |
download | yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar.gz yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar.bz2 yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar.lz yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar.xz yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.tar.zst yuzu-282ae8fa51e060e6d4ef026b734aa871b1b9331e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/query_cache/query_stream.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/video_core/query_cache/query_stream.h b/src/video_core/query_cache/query_stream.h index 0e9275565..e7aac955b 100644 --- a/src/video_core/query_cache/query_stream.h +++ b/src/video_core/query_cache/query_stream.h @@ -16,7 +16,7 @@ namespace VideoCommon { class StreamerInterface { public: - StreamerInterface(size_t id_, u64 dependance_mask_ = 0) : id{id_}, dependance_mask{dependance_mask_} {} + explicit StreamerInterface(size_t id_) : id{id_}, dependence_mask{}, dependent_mask{} {} virtual ~StreamerInterface() = default; virtual QueryBase* GetQuery(size_t id) = 0; @@ -37,7 +37,7 @@ public: /* Do Nothing */ } - virtual bool HasPendingSync() { + virtual bool HasPendingSync() const { return false; } @@ -52,7 +52,7 @@ public: virtual size_t WriteCounter(VAddr address, bool has_timestamp, u32 value, std::optional<u32> subreport = std::nullopt) = 0; - virtual bool HasUnsyncedQueries() { + virtual bool HasUnsyncedQueries() const { return false; } @@ -71,18 +71,28 @@ public: } u64 GetDependenceMask() const { - return dependance_mask; + return dependence_mask; + } + + u64 GetDependentMask() const { + return dependence_mask; } protected: + void MakeDependent(StreamerInterface* depend_on) { + dependence_mask |= 1ULL << depend_on->id; + depend_on->dependent_mask |= 1ULL << id; + } + const size_t id; - const u64 dependance_mask; + u64 dependence_mask; + u64 dependent_mask; }; template <typename QueryType> class SimpleStreamer : public StreamerInterface { public: - SimpleStreamer(size_t id_, u64 dependance_mask_ = 0) : StreamerInterface{id_, dependance_mask_} {} + explicit SimpleStreamer(size_t id_) : StreamerInterface{id_} {} virtual ~SimpleStreamer() = default; protected: |