Module: vkd3d Branch: master Commit: df36026633a4f0949e2893638e481c829ac53247 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/df36026633a4f0949e2893638e481c...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Wed Feb 8 14:13:06 2023 +0100
vkd3d: Do not read max_pending_value without holding the fence's mutex.
---
libs/vkd3d/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 45620e86..9cf35831 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6801,13 +6801,14 @@ static bool d3d12_command_queue_flush_ops(struct d3d12_command_queue *queue, boo { case VKD3D_CS_OP_WAIT: fence = op->u.wait.fence; + vkd3d_mutex_lock(&fence->mutex); if (op->u.wait.value > fence->max_pending_value) { + vkd3d_mutex_unlock(&fence->mutex); queue->ops_count -= i; memmove(queue->ops, op, queue->ops_count * sizeof(*op)); goto done; } - vkd3d_mutex_lock(&fence->mutex); d3d12_command_queue_wait_locked(queue, fence, op->u.wait.value); d3d12_fence_decref(fence); break;