summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-18 03:15:43 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-22 17:36:11 +0200
commit57fdbd9b8992de4eaf2b262e6a2cece43c141894 (patch)
treef7d0bb17daffdffa76c61bd39eef3fa766150d9c /src
parentGPU: Implement a Fence Manager. (diff)
downloadyuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar.gz
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar.bz2
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar.lz
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar.xz
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.tar.zst
yuzu-57fdbd9b8992de4eaf2b262e6a2cece43c141894.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/fence_manager.h8
-rw-r--r--src/video_core/texture_cache/texture_cache.h11
2 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h
index 19cec0f66..036f3996c 100644
--- a/src/video_core/fence_manager.h
+++ b/src/video_core/fence_manager.h
@@ -53,7 +53,10 @@ public:
void WaitPendingFences() {
while (!fences.empty()) {
TFence& current_fence = fences.front();
- WaitFence(current_fence);
+ bool should_wait = texture_cache.ShouldWaitAsyncFlushes();
+ if (should_wait) {
+ WaitFence(current_fence);
+ }
texture_cache.PopAsyncFlushes();
auto& gpu{system.GPU()};
auto& memory_manager{gpu.MemoryManager()};
@@ -80,7 +83,8 @@ private:
void TryReleasePendingFences() {
while (!fences.empty()) {
TFence& current_fence = fences.front();
- if (!IsFenceSignaled(current_fence)) {
+ bool should_wait = texture_cache.ShouldWaitAsyncFlushes();
+ if (should_wait && !IsFenceSignaled(current_fence)) {
return;
}
texture_cache.PopAsyncFlushes();
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 6629c59ed..04fe69c11 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -322,6 +322,17 @@ public:
uncommited_flushes.reset();
}
+ bool ShouldWaitAsyncFlushes() {
+ if (commited_flushes.empty()) {
+ return false;
+ }
+ auto& flush_list = commited_flushes.front();
+ if (!flush_list) {
+ return false;
+ }
+ return true;
+ }
+
void PopAsyncFlushes() {
if (commited_flushes.empty()) {
return;