diff options
| author | 2020-04-22 11:14:40 -0400 | |
|---|---|---|
| committer | 2020-04-22 11:36:27 -0400 | |
| 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.gz yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.tar.xz yuzu-4e37f1b1130b083b42f21029155e5a2e4e9a9eb3.zip | |
Address Feedback.
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: | |||
| 68 | 68 | ||
| 69 | for (const auto& surface : GetSurfacesInRegion(addr, size)) { | 69 | for (const auto& surface : GetSurfacesInRegion(addr, size)) { |
| 70 | if (surface->IsMemoryMarked()) { | 70 | if (surface->IsMemoryMarked()) { |
| 71 | Unmark(surface); | 71 | UnmarkMemory(surface); |
| 72 | surface->SetSyncPending(true); | 72 | surface->SetSyncPending(true); |
| 73 | marked_for_unregister.emplace_back(surface); | 73 | marked_for_unregister.emplace_back(surface); |
| 74 | } | 74 | } |
| @@ -119,8 +119,8 @@ public: | |||
| 119 | bool MustFlushRegion(VAddr addr, std::size_t size) { | 119 | bool MustFlushRegion(VAddr addr, std::size_t size) { |
| 120 | std::lock_guard lock{mutex}; | 120 | std::lock_guard lock{mutex}; |
| 121 | 121 | ||
| 122 | auto surfaces = GetSurfacesInRegion(addr, size); | 122 | const auto surfaces = GetSurfacesInRegion(addr, size); |
| 123 | return std::any_of(surfaces.begin(), surfaces.end(), | 123 | return std::any_of(surfaces.cbegin(), surfaces.cend(), |
| 124 | [](const TSurface& surface) { return surface->IsModified(); }); | 124 | [](const TSurface& surface) { return surface->IsModified(); }); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| @@ -335,10 +335,7 @@ public: | |||
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | bool ShouldWaitAsyncFlushes() const { | 337 | bool ShouldWaitAsyncFlushes() const { |
| 338 | if (committed_flushes.empty()) { | 338 | return !committed_flushes.empty() && committed_flushes.front() != nullptr; |
| 339 | return false; | ||
| 340 | } | ||
| 341 | return committed_flushes.front() != nullptr; | ||
| 342 | } | 339 | } |
| 343 | 340 | ||
| 344 | void PopAsyncFlushes() { | 341 | void PopAsyncFlushes() { |
| @@ -421,7 +418,7 @@ protected: | |||
| 421 | rasterizer.UpdatePagesCachedCount(*cpu_addr, size, 1); | 418 | rasterizer.UpdatePagesCachedCount(*cpu_addr, size, 1); |
| 422 | } | 419 | } |
| 423 | 420 | ||
| 424 | void Unmark(TSurface surface) { | 421 | void UnmarkMemory(TSurface surface) { |
| 425 | if (!surface->IsMemoryMarked()) { | 422 | if (!surface->IsMemoryMarked()) { |
| 426 | return; | 423 | return; |
| 427 | } | 424 | } |
| @@ -438,7 +435,7 @@ protected: | |||
| 438 | if (!guard_render_targets && surface->IsRenderTarget()) { | 435 | if (!guard_render_targets && surface->IsRenderTarget()) { |
| 439 | ManageRenderTargetUnregister(surface); | 436 | ManageRenderTargetUnregister(surface); |
| 440 | } | 437 | } |
| 441 | Unmark(surface); | 438 | UnmarkMemory(surface); |
| 442 | if (surface->IsSyncPending()) { | 439 | if (surface->IsSyncPending()) { |
| 443 | marked_for_unregister.remove(surface); | 440 | marked_for_unregister.remove(surface); |
| 444 | surface->SetSyncPending(false); | 441 | surface->SetSyncPending(false); |