aboutsummaryrefslogtreecommitdiff
path: root/src/strategies/low_latency2/device_strategy.cc
diff options
context:
space:
mode:
authorNicolas James <nj3ahxac@gmail.com>2026-04-12 18:45:49 +1000
committerNicolas James <nj3ahxac@gmail.com>2026-04-12 18:45:49 +1000
commit59289c6fcd79e52a4395451f61851661c417dbb3 (patch)
treed3cb760880805c84ed29b2d5e9fcfa69015e1625 /src/strategies/low_latency2/device_strategy.cc
parent973532a7d28c2afbaaf0fe79efa9a5084d14e3aa (diff)
LowLatency2: Check semaphore value before signalling
Diffstat (limited to 'src/strategies/low_latency2/device_strategy.cc')
-rw-r--r--src/strategies/low_latency2/device_strategy.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/strategies/low_latency2/device_strategy.cc b/src/strategies/low_latency2/device_strategy.cc
index f82098d..81934ba 100644
--- a/src/strategies/low_latency2/device_strategy.cc
+++ b/src/strategies/low_latency2/device_strategy.cc
@@ -112,19 +112,18 @@ void LowLatency2DeviceStrategy::notify_latency_sleep_nv(
const auto lock = std::scoped_lock{this->mutex};
+ const auto semaphore_signal =
+ SemaphoreSignal{info.signalSemaphore, info.value};
+
const auto iter = this->swapchain_monitors.find(swapchain);
if (iter == std::end(this->swapchain_monitors)) {
// If we can't find the swapchain we have to signal the semaphore
// anyway. We must *never* discard these semaphores without signalling
// them first.
- const auto ssi = VkSemaphoreSignalInfo{
- .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO,
- .semaphore = info.signalSemaphore,
- .value = info.value};
- THROW_NOT_VKSUCCESS(device.vtable.SignalSemaphore(device.device, &ssi));
+ semaphore_signal.signal(this->device);
return;
}
- iter->second.notify_semaphore(info.signalSemaphore, info.value);
+ iter->second.notify_semaphore(semaphore_signal);
}
} // namespace low_latency