diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-03-24 15:33:51 +1100 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-03-24 15:33:51 +1100 |
| commit | 7810f837b3cfa7dc45f360282cd1cafb2c3e6ca6 (patch) | |
| tree | 2d23b96b841fb4f3ae824e9538a0b639a2e598bf | |
| parent | 02a873a1c38fe6f0dca4471127d5a85712b0d727 (diff) | |
Resolve hang via hack, WIP
| -rw-r--r-- | src/layer.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/layer.cc b/src/layer.cc index 9344114..77ce296 100644 --- a/src/layer.cc +++ b/src/layer.cc @@ -294,6 +294,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice( DEVICE_VTABLE_LOAD(QueueSubmit2KHR); DEVICE_VTABLE_LOAD(GetCalibratedTimestampsKHR); DEVICE_VTABLE_LOAD(ResetQueryPoolEXT); + DEVICE_VTABLE_LOAD(SignalSemaphore); #undef DEVICE_VTABLE_LOAD const auto key = layer_context.get_key(*pDevice); @@ -749,6 +750,30 @@ void GetLatencyTimingsNV(VkDevice device, VkSwapchainKHR swapchain, VkResult LatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV* pSleepInfo) { + + const auto context = layer_context.get_context(device); + assert(pSleepInfo); + + // Keep going. + if (pSleepInfo->signalSemaphore) { + + // This is a hack obviously. I will have to associate queue submits with + // a semaphore and signal it correctly later. I'm not sure about the + // implications regarding multithreading, will have to think a bit about how to do this cleanly + // with our current anti lag. + static std::uint32_t counter = 1024; + + const auto ssi = VkSemaphoreSignalInfo{ + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, + .semaphore = pSleepInfo->signalSemaphore, + .value = counter, + }; + + // So we don't wait and this becomes a no-op instead of a freeze! + context->vtable.SignalSemaphore(device, &ssi); + + ++counter; + } // STUB return VK_SUCCESS; } @@ -766,6 +791,9 @@ void SetLatencyMarkerNV(VkDevice device, VkSwapchainKHR swapchain, VkResult SetLatencySleepModeNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV* pSleepModeInfo) { + const auto context = layer_context.get_context(device); + assert(pSleepModeInfo); + // STUB return VK_SUCCESS; } |
