diff options
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index d9b1a009c..fc664a52b 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -1134,14 +1134,19 @@ public: | |||
| 1134 | const VkSemaphore semaphore = fence_.semaphore(); | 1134 | const VkSemaphore semaphore = fence_.semaphore(); |
| 1135 | context_.enqueue_fence_callback(semaphore, queued, [context, semaphore, queued, value, held = held_] { | 1135 | context_.enqueue_fence_callback(semaphore, queued, [context, semaphore, queued, value, held = held_] { |
| 1136 | std::uint64_t now = 0; | 1136 | std::uint64_t now = 0; |
| 1137 | context->vk.vkGetSemaphoreCounterValue(context->device(), semaphore, &now); | 1137 | bool signaled = false; |
| 1138 | if (now >= queued && now < value) { | 1138 | if (context->vk.vkGetSemaphoreCounterValue(context->device(), semaphore, &now) == VK_SUCCESS && |
| 1139 | now >= queued && now < value) { | ||
| 1139 | VkSemaphoreSignalInfo info{VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO}; | 1140 | VkSemaphoreSignalInfo info{VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO}; |
| 1140 | info.semaphore = semaphore; | 1141 | info.semaphore = semaphore; |
| 1141 | info.value = value; | 1142 | info.value = value; |
| 1142 | context->vk.vkSignalSemaphore(context->device(), &info); | 1143 | signaled = context->vk.vkSignalSemaphore(context->device(), &info) == VK_SUCCESS; |
| 1143 | } | 1144 | } |
| 1144 | held->fetch_sub(1); | 1145 | held->fetch_sub(1); |
| 1146 | if (signaled) { | ||
| 1147 | context->holds().signaled(semaphore, value); | ||
| 1148 | context->holds().pump_ready(); | ||
| 1149 | } | ||
| 1145 | }); | 1150 | }); |
| 1146 | return S_OK; | 1151 | return S_OK; |
| 1147 | } | 1152 | } |