diff options
| author | pmilewsskiedu-gif <pmilewsskiedu-gif@users.noreply.github.com> | 2026-11-22 21:32:39 -0500 |
|---|---|---|
| committer | pmilewsskiedu-gif <pmilewsskiedu-gif@users.noreply.github.com> | 2026-11-22 21:32:39 -0500 |
| commit | a5412e0d736f71b273f299475c2d37710dfe2709 (patch) | |
| tree | 654d9513a8d82ad224c4d5a96eb4d30e96574cf7 /runtime/shims/d3d12_com.cpp | |
| parent | 8728339f9e8e7fb46ac4d965d4d4e03276f62378 (diff) | |
Runtime: report device loss from blocking multi-fence waits
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index d9b1a009c..d156db28f 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -1604,7 +1604,11 @@ HRESULT set_event_on_multiple_fence_completion(leonida::VulkanContext& context, | |||
| 1604 | wait.semaphoreCount = count; | 1604 | wait.semaphoreCount = count; |
| 1605 | wait.pSemaphores = semaphores.data(); | 1605 | wait.pSemaphores = semaphores.data(); |
| 1606 | wait.pValues = values; | 1606 | wait.pValues = values; |
| 1607 | return context.vk.vkWaitSemaphores(context.device(), &wait, UINT64_MAX) == VK_SUCCESS ? S_OK : E_FAIL; | 1607 | const VkResult result = context.vk.vkWaitSemaphores(context.device(), &wait, UINT64_MAX); |
| 1608 | // Unlike a single fence's blocking SetEventOnCompletion, this path invokes Vulkan directly. | ||
| 1609 | // A lost device must wake its other registered fence waiters and reject later submissions. | ||
| 1610 | if (result == VK_ERROR_DEVICE_LOST) context.mark_device_lost(); | ||
| 1611 | return result == VK_SUCCESS ? S_OK : E_FAIL; | ||
| 1608 | } | 1612 | } |
| 1609 | // Each fence's own waiter thread counts the shared waiter down; no thread of its own. | 1613 | // Each fence's own waiter thread counts the shared waiter down; no thread of its own. |
| 1610 | const auto waiter = std::make_shared<FenceWaiter>(event, any ? 1u : count); | 1614 | const auto waiter = std::make_shared<FenceWaiter>(event, any ? 1u : count); |