JetBrains / JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
GNU General Public License v2.0
1.21k stars 188 forks source link

JBR-7237 Fix cyclic dependency of Wayland and Vulkan initialization #396

Closed YaaZ closed 1 month ago

YaaZ commented 1 month ago

This adds asynchronous Vulkan initialization.

  1. WLGraphicsEnvironment starts Vulkan initialization in separate thread and proceeds with Wayland initialization
  2. Before vkGetPhysicalDeviceWaylandPresentationSupportKHR Vulkan init waits for the wl_display to become available
  3. VKInstance.isVulkanEnabled() which is used later by WLGraphicsDevice waits for the Vulkan initialization to finish
mkartashev commented 1 month ago

NB: we decided to split WLToolkit initialization in two phases so that the dependency of the toolkit initialization and Vulkan initialization on the Wayland display can be made apparent and easy to impose. See https://github.com/JetBrains/JetBrainsRuntime/pull/397 for the first part.