vkd3d: Avoid busy-waiting in fence worker thread.

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 <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-06-13 13:47:35 +02:00 committed by Alexandre Julliard
parent 0baf0302d1
commit 206fd23afe

View File

@ -362,7 +362,7 @@ static void vkd3d_wait_for_gpu_fences(struct vkd3d_fence_worker *worker)
return; return;
vr = VK_CALL(vkWaitForFences(device->vk_device, 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) if (vr == VK_TIMEOUT)
return; return;
if (vr != VK_SUCCESS) if (vr != VK_SUCCESS)