diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-08-04 13:38:49 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-09-23 23:05:29 +0200 |
commit | aa6587d854e4953876b02ca71278a665bcae8179 (patch) | |
tree | f2dafb0cda400fe1321f670c9eacc26051eca9aa /src/video_core/query_cache/query_cache.h | |
parent | Macro HLE: Add DrawIndirectByteCount (diff) | |
download | yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar.gz yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar.bz2 yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar.lz yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar.xz yuzu-aa6587d854e4953876b02ca71278a665bcae8179.tar.zst yuzu-aa6587d854e4953876b02ca71278a665bcae8179.zip |
Diffstat (limited to 'src/video_core/query_cache/query_cache.h')
-rw-r--r-- | src/video_core/query_cache/query_cache.h | 18 |
1 files changed, 16 insertions, 2 deletions
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() { if (mask == 0) { return; } - impl->ForEachStreamerIn(mask, - [](StreamerInterface* streamer) { streamer->PopUnsyncedQueries(); }); + u64 ran_mask = 0; + u64 next_phase = 0; + while (mask) { + impl->ForEachStreamerIn(mask, [&mask, &ran_mask, &next_phase](StreamerInterface* streamer) { + u64 dep_mask = streamer->GetDependenceMask(); + if ((dep_mask & ~ran_mask) != 0) { + next_phase |= dep_mask; + return; + } + u64 index = streamer->GetId(); + ran_mask |= (1ULL << index); + mask &= ~(1ULL << index); + streamer->PopUnsyncedQueries(); + }); + ran_mask |= next_phase; + } } // Invalidation |