diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-22 17:14:40 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-22 17:36:27 +0200 |
commit | 4e37f1b1130b083b42f21029155e5a2e4e9a9eb3 (patch) | |
tree | 751ecd6d575de14bb9b7bf5a9bc0e2e28c9fa1e3 /src/video_core/texture_cache | |
parent | Async GPU: Correct flushing behavior to be similar to old async GPU behavior. (diff) | |
download | yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.gz yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.bz2 yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.lz yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.xz yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.zst yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.zip |
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 1148c3a34..cf6bd005a 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -68,7 +68,7 @@ public: for (const auto& surface : GetSurfacesInRegion(addr, size)) { if (surface->IsMemoryMarked()) { - Unmark(surface); + UnmarkMemory(surface); surface->SetSyncPending(true); marked_for_unregister.emplace_back(surface); } @@ -119,8 +119,8 @@ public: bool MustFlushRegion(VAddr addr, std::size_t size) { std::lock_guard lock{mutex}; - auto surfaces = GetSurfacesInRegion(addr, size); - return std::any_of(surfaces.begin(), surfaces.end(), + const auto surfaces = GetSurfacesInRegion(addr, size); + return std::any_of(surfaces.cbegin(), surfaces.cend(), [](const TSurface& surface) { return surface->IsModified(); }); } @@ -335,10 +335,7 @@ public: } bool ShouldWaitAsyncFlushes() const { - if (committed_flushes.empty()) { - return false; - } - return committed_flushes.front() != nullptr; + return !committed_flushes.empty() && committed_flushes.front() != nullptr; } void PopAsyncFlushes() { @@ -421,7 +418,7 @@ protected: rasterizer.UpdatePagesCachedCount(*cpu_addr, size, 1); } - void Unmark(TSurface surface) { + void UnmarkMemory(TSurface surface) { if (!surface->IsMemoryMarked()) { return; } @@ -438,7 +435,7 @@ protected: if (!guard_render_targets && surface->IsRenderTarget()) { ManageRenderTargetUnregister(surface); } - Unmark(surface); + UnmarkMemory(surface); if (surface->IsSyncPending()) { marked_for_unregister.remove(surface); surface->SetSyncPending(false); |