diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-04-13 13:56:11 +1000 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-04-13 13:56:11 +1000 |
| commit | 458797a7a726d6f30be2acaea1761d489c31061a (patch) | |
| tree | 0788fae8303322ce450c3bd6ddada34717d64f59 /src/strategies/low_latency2/swapchain_monitor.cc | |
| parent | 59289c6fcd79e52a4395451f61851661c417dbb3 (diff) | |
Diffstat (limited to 'src/strategies/low_latency2/swapchain_monitor.cc')
| -rw-r--r-- | src/strategies/low_latency2/swapchain_monitor.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/strategies/low_latency2/swapchain_monitor.cc b/src/strategies/low_latency2/swapchain_monitor.cc index 0dcd1ce..088e9bd 100644 --- a/src/strategies/low_latency2/swapchain_monitor.cc +++ b/src/strategies/low_latency2/swapchain_monitor.cc @@ -45,6 +45,7 @@ void SwapchainMonitor::do_monitor(const std::stop_token stoken) { // Grab mutex protected present delay before we sleep - doesn't matter // if it's 'old'. const auto delay = this->present_delay; + this->is_monitor_processing.store(true, std::memory_order_relaxed); lock.unlock(); // Wait for work to complete. @@ -62,6 +63,7 @@ void SwapchainMonitor::do_monitor(const std::stop_token stoken) { } this->last_signal_time.set(std::chrono::steady_clock::now()); + this->is_monitor_processing.store(false, std::memory_order_relaxed); pending_signal.semaphore_signal.signal(this->device); } } @@ -81,6 +83,7 @@ void SwapchainMonitor::notify_semaphore( // we have no outstanding work. using namespace std::chrono; if (this->present_delay == 0us && + !this->is_monitor_processing.load(std::memory_order_relaxed) && std::ranges::all_of(this->pending_frame_spans, [](const auto& frame_span) { if (!frame_span) { |
