Module: vkd3d Branch: master Commit: 09d2c8d1909aac06091403a6691c0037de10b698 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/09d2c8d1909aac06091403a6691c00...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Thu Mar 2 12:11:55 2023 +0100
vkd3d: Always enqueue wait operations, even when they can be executed right away.
---
libs/vkd3d/command.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 5d8eb3e9..2ee1e8d5 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6611,23 +6611,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if TRACE("iface %p, fence %p, value %#"PRIx64".\n", iface, fence_iface, value);
vkd3d_mutex_lock(&command_queue->op_mutex); - vkd3d_mutex_lock(&fence->mutex); - - if (!command_queue->ops_count && value <= fence->max_pending_value) - { - hr = d3d12_command_queue_wait_locked(command_queue, fence, value); - goto done; - } - - /* This is the critical part required to support out-of-order signal. - * Normally we would be able to submit waits and signals out of order, but - * we don't have virtualized queues in Vulkan, so we need to handle the case - * where multiple queues alias over the same physical queue, so effectively, - * we need to manage out-of-order submits ourselves. */
if (!(op = d3d12_command_queue_require_space_locked(command_queue))) { - vkd3d_mutex_unlock(&fence->mutex); hr = E_OUTOFMEMORY; goto done; } @@ -6637,15 +6623,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_Wait(ID3D12CommandQueue *if
d3d12_fence_incref(fence);
- /* Add the queue to the blocked list after writing the op to ensure the queue isn't - * removed again in another thread because it has no ops. */ - if (command_queue->ops_count == 1) - hr = d3d12_command_queue_record_as_blocked(command_queue); - - /* The fence must remain locked until the op is created and the queue is added to the blocked list, - * because if an unblocking d3d12_fence_Signal() call occurs on another thread before the above - * work is done, flushing will be delayed until the next signal, if one occurs at all. */ - vkd3d_mutex_unlock(&fence->mutex); + d3d12_command_queue_submit_locked(command_queue);
done: vkd3d_mutex_unlock(&command_queue->op_mutex);