app: disable Vulkan on X11

According to

https://gioui.org/issue/347 and
https://github.com/godotengine/godot/issues/43714

choosing the integrated Intel GPU on a multi-GPU system with NVIDIA
doesn't work well in X11. According to Godot, forcing the use of the
discrete (NVIDIA) GPU works around the problem. This change disables
Vulkan on X11 instead, which is a more conservative and targeted fix.

Disabling Vulkan on X11 will reduce testing of Vulkan, but

- Pierre is making Wayland the default driver on Linux, where Vulkan
is enabled.
- The OpenGL driver will be exercized more.

Fixes: https://todo.sr.ht/~eliasnaur/gio/347
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-01-27 12:32:13 +01:00
parent 1bad440ef6
commit 90ad0010ec
+5 -1
View File
@@ -118,9 +118,13 @@ var (
newX11VulkanContext func(w *x11Window) (context, error)
)
// X11 and Vulkan doesn't work reliably on NVIDIA systems.
// See https://gioui.org/issue/347.
const vulkanBuggy = true
func (w *x11Window) NewContext() (context, error) {
var firstErr error
if f := newX11VulkanContext; f != nil {
if f := newX11VulkanContext; f != nil && !vulkanBuggy {
c, err := f(w)
if err == nil {
return c, nil