From d99632fef964d9dda8ebefb645c5989fac333fb5 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 12 Sep 2023 13:14:42 -0700 Subject: [PATCH] Add warning about Vulkan queue usage in embedder.h --- shell/platform/embedder/embedder.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/shell/platform/embedder/embedder.h b/shell/platform/embedder/embedder.h index dbbb346dd8758..4cdbf08a4c036 100644 --- a/shell/platform/embedder/embedder.h +++ b/shell/platform/embedder/embedder.h @@ -757,6 +757,19 @@ typedef struct { /// The queue family index of the VkQueue supplied in the next field. uint32_t queue_family_index; /// VkQueue handle. + /// + /// @warning There is a synchronization bug where Flutter will submit + /// to this queue on both the raster and IO threads. This is + /// invalid behavior and may result in crashes! As a temporary + /// workaround, we strongly recommand wrapping `vkQueueSubmit` and + /// `vkQueueWaitIdle` with a mutex lock. + /// + /// This can be done by intercepting `vkGetDeviceProcAddr` in the + /// supplied `get_instance_proc_address_callback` with a version + /// that intercepts `vkQueueSubmit` and `vkQueueWaitIdle` with + /// locking versions of the procs. + /// + /// See also: https://github.com/flutter/flutter/issues/134573 FlutterVulkanQueueHandle queue; /// The number of instance extensions available for enumerating in the next /// field.