Skip to content

macos: Add (experimental) Vulkan support

Add Vulkan support to GTK on macOS via MoltenVK.

At this moment the demo app renders and looks pretty okay-ish.

Install

  1. Install the latest Vulkan SDK and set up your environment.
  2. meson setup ...
  3. export GSK_RENDERER=vulkan (GL is preffered)
  4. build and run the gtk4-demo app

Open issues

  • After a while complains about swapchain mismatches:
    (gtk4-demo:34539): Gdk-WARNING **: 14:12:37.064: vkAcquireNextImageKHR(): A swapchain
    no longer matches the surface properties exactly, but can still be used to present to
    the surface successfully. (VK_SUBOPTIMAL_KHR) (1000001003)
  • Doesn't run on secondary monitor.
  • Window starts flickering sometimes (sync issue?)
  • Doesn't scale when moved from one monitor to another (different scale factor?)
  • windows do not show on gtk_widget_set_visible (), but do with gtk_window_present ()
  • Prefer Vulkan over GL renderer for macOS

image

Help is appreciated since I have no experience with Vulkan and Metal.

A meson fix for dealing with Vulkan installed in a user's home directory: https://github.com/mesonbuild/meson/pull/14557

Edited by Arjan Molenaar

Merge request reports

Loading