|
|
@ -53,6 +53,7 @@ vkr_device_alloc_queue_sync(struct vkr_device *dev, |
|
|
|
vkResetFences(dev->base.handle.device, 1, &sync->fence); |
|
|
|
vkResetFences(dev->base.handle.device, 1, &sync->fence); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sync->device_lost = false; |
|
|
|
sync->flags = fence_flags; |
|
|
|
sync->flags = fence_flags; |
|
|
|
sync->queue_id = queue_id; |
|
|
|
sync->queue_id = queue_id; |
|
|
|
sync->fence_cookie = fence_cookie; |
|
|
|
sync->fence_cookie = fence_cookie; |
|
|
@ -101,9 +102,11 @@ vkr_queue_get_signaled_syncs(struct vkr_queue *queue, |
|
|
|
mtx_unlock(&queue->mutex); |
|
|
|
mtx_unlock(&queue->mutex); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
LIST_FOR_EACH_ENTRY_SAFE (sync, tmp, &queue->pending_syncs, head) { |
|
|
|
LIST_FOR_EACH_ENTRY_SAFE (sync, tmp, &queue->pending_syncs, head) { |
|
|
|
|
|
|
|
if (!sync->device_lost) { |
|
|
|
VkResult result = vkGetFenceStatus(dev->base.handle.device, sync->fence); |
|
|
|
VkResult result = vkGetFenceStatus(dev->base.handle.device, sync->fence); |
|
|
|
if (result == VK_NOT_READY) |
|
|
|
if (result == VK_NOT_READY) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool is_last_sync = sync->head.next == &queue->pending_syncs; |
|
|
|
bool is_last_sync = sync->head.next == &queue->pending_syncs; |
|
|
|
|
|
|
|
|
|
|
@ -201,8 +204,13 @@ vkr_queue_thread(void *arg) |
|
|
|
|
|
|
|
|
|
|
|
mtx_unlock(&queue->mutex); |
|
|
|
mtx_unlock(&queue->mutex); |
|
|
|
|
|
|
|
|
|
|
|
VkResult result = |
|
|
|
VkResult result; |
|
|
|
vkWaitForFences(dev->base.handle.device, 1, &sync->fence, true, ns_per_sec * 3); |
|
|
|
if (sync->device_lost) { |
|
|
|
|
|
|
|
result = VK_ERROR_DEVICE_LOST; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
result = vkWaitForFences(dev->base.handle.device, 1, &sync->fence, true, |
|
|
|
|
|
|
|
ns_per_sec * 3); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mtx_lock(&queue->mutex); |
|
|
|
mtx_lock(&queue->mutex); |
|
|
|
|
|
|
|
|
|
|
|