diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-04-22 11:59:57 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-04-23 22:03:44 +0200 |
commit | 7e76c1642cb4dfde5bfc97600ca3df7dcbea01de (patch) | |
tree | 6d68c31d9588def484be15d84cb54bb2f72af4df /src/video_core/fence_manager.h | |
parent | Fence Manager: implement async fence management in a sepparate thread. (diff) | |
download | yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.gz yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.bz2 yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.lz yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.xz yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.zst yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.zip |
Diffstat (limited to 'src/video_core/fence_manager.h')
-rw-r--r-- | src/video_core/fence_manager.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index 027e663bf..19bbdd547 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h @@ -64,19 +64,24 @@ public: } void SignalFence(std::function<void()>&& func) { + bool delay_fence = Settings::IsGPULevelHigh(); if constexpr (!can_async_check) { TryReleasePendingFences<false>(); } - std::function<void()> callback = std::move(func); const bool should_flush = ShouldFlush(); CommitAsyncFlushes(); TFence new_fence = CreateFence(!should_flush); if constexpr (can_async_check) { guard.lock(); } + if (delay_fence) { + uncommitted_operations.emplace_back(std::move(func)); + } pending_operations.emplace_back(std::move(uncommitted_operations)); QueueFence(new_fence); - callback(); + if (!delay_fence) { + func(); + } fences.push(std::move(new_fence)); if (should_flush) { rasterizer.FlushCommands(); |