From 8613d81a94ea8f23655e35cc04917e91ddcfbfee Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 10 Nov 2021 15:39:37 +0100 Subject: [PATCH] gpu/headless: accept the lavapipe Vulkan driver On headless setups such as sr.ht CI machines, lavapipe is the only available Vulkan driver. This change accepts the lavapipe software driver for headless contexts, so that CI won't fall back to OpenGL. Signed-off-by: Elias Naur --- internal/vk/vulkan.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/vk/vulkan.go b/internal/vk/vulkan.go index 78928be4..f210d40b 100644 --- a/internal/vk/vulkan.go +++ b/internal/vk/vulkan.go @@ -892,8 +892,9 @@ func ChoosePhysicalDevice(inst Instance, surf Surface) (PhysicalDevice, int, err for _, pd := range devs { var props C.VkPhysicalDeviceProperties C.vkGetPhysicalDeviceProperties(funcs.vkGetPhysicalDeviceProperties, pd, &props) - // Skip software implementations such as lavapipe. - if props.deviceType == C.VK_PHYSICAL_DEVICE_TYPE_CPU { + // The lavapipe software implementation doesn't work well rendering to a surface. + // See https://gitlab.freedesktop.org/mesa/mesa/-/issues/5473. + if surf != 0 && props.deviceType == C.VK_PHYSICAL_DEVICE_TYPE_CPU { continue } const caps = C.VK_QUEUE_GRAPHICS_BIT | C.VK_QUEUE_COMPUTE_BIT