mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d: Lock the heap mutex while binding heap memory.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b78087c20f
commit
c9aea8993f
@ -1941,11 +1941,17 @@ static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device,
|
|||||||
goto allocate_memory;
|
goto allocate_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Syncronisation is not required for binding, but vkMapMemory() may be called
|
||||||
|
* from another thread and it requires exclusive access. */
|
||||||
|
vkd3d_mutex_lock(&heap->mutex);
|
||||||
|
|
||||||
if (d3d12_resource_is_buffer(resource))
|
if (d3d12_resource_is_buffer(resource))
|
||||||
vr = VK_CALL(vkBindBufferMemory(vk_device, resource->u.vk_buffer, heap->vk_memory, heap_offset));
|
vr = VK_CALL(vkBindBufferMemory(vk_device, resource->u.vk_buffer, heap->vk_memory, heap_offset));
|
||||||
else
|
else
|
||||||
vr = VK_CALL(vkBindImageMemory(vk_device, resource->u.vk_image, heap->vk_memory, heap_offset));
|
vr = VK_CALL(vkBindImageMemory(vk_device, resource->u.vk_image, heap->vk_memory, heap_offset));
|
||||||
|
|
||||||
|
vkd3d_mutex_unlock(&heap->mutex);
|
||||||
|
|
||||||
if (vr == VK_SUCCESS)
|
if (vr == VK_SUCCESS)
|
||||||
{
|
{
|
||||||
resource->heap = heap;
|
resource->heap = heap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user