From 206fd23afea6793cce0aba05a680607fc6f2d628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Thu, 13 Jun 2019 13:47:35 +0200 Subject: [PATCH] vkd3d: Avoid busy-waiting in fence worker thread. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This might delay updating a d3d12_fence when a fence enqueued later than other fences is signaled before them. On the other hand, it significantly reduces CPU usage. I haven't found a program negatively impacted by this change so far. Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 7634e71b..75556f53 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -362,7 +362,7 @@ static void vkd3d_wait_for_gpu_fences(struct vkd3d_fence_worker *worker) return; vr = VK_CALL(vkWaitForFences(device->vk_device, - worker->fence_count, worker->vk_fences, VK_FALSE, 0)); + worker->fence_count, worker->vk_fences, VK_FALSE, ~(uint64_t)0)); if (vr == VK_TIMEOUT) return; if (vr != VK_SUCCESS)