mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
c/main: Guard VkQueue access when calling vkQueuePresentKHR
The VkQueue in vkQueuePresentKHR is externally synchronized, so we need to take the queue_mutex when we call that function. Found this with the [latest validation layers][1] and the OpenXR CTS test Swapchains. This has probably been a longstanding bug in Monado as that particular code is fairly old. [1]: https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/6631
This commit is contained in:
parent
c3157335ef
commit
adc3fe879d
|
@ -884,7 +884,12 @@ comp_target_swapchain_present(struct comp_target *ct,
|
|||
.pImageIndices = &index,
|
||||
};
|
||||
|
||||
|
||||
// Need to take the queue lock for present.
|
||||
os_mutex_lock(&vk->queue_mutex);
|
||||
VkResult ret = vk->vkQueuePresentKHR(queue, &presentInfo);
|
||||
os_mutex_unlock(&vk->queue_mutex);
|
||||
|
||||
|
||||
#ifdef VK_EXT_display_control
|
||||
if (cts->vblank.has_started) {
|
||||
|
|
Loading…
Reference in a new issue