~eliasnaur/gio

dbf64290265178823970cccf3e8c4a0b0aa45110 — Chris Waldon 2 years ago 276b7ee
app,gpu/headless: [linux] make EGL the default backend

This commit switches the priority of EGL and Vulkan so that EGL is always
tried first. This is because our EGL backend performs significantly better
than the Vulkan one, and we want the most performant experience to be the
default.

Our hypothesis is that the EGL backend is benefitting from lots of optimization
within the OpenGL driver that Vulkan drivers expect applications to perform
themselves. Rather than invest a bunch of time optimizing the Vulkan backend
right now, this change lets us focus on other priorities.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
3 files changed, 4 insertions(+), 4 deletions(-)

M app/os_wayland.go
M gpu/headless/headless_egl.go
M gpu/headless/headless_vulkan.go
M app/os_wayland.go => app/os_wayland.go +2 -2
@@ 1731,14 1731,14 @@ func (w *window) EditorStateChanged(old, new editorState) {}

func (w *window) NewContext() (context, error) {
	var firstErr error
	if f := newWaylandVulkanContext; f != nil {
	if f := newWaylandEGLContext; f != nil {
		c, err := f(w)
		if err == nil {
			return c, nil
		}
		firstErr = err
	}
	if f := newWaylandEGLContext; f != nil {
	if f := newWaylandVulkanContext; f != nil {
		c, err := f(w)
		if err == nil {
			return c, nil

M gpu/headless/headless_egl.go => gpu/headless/headless_egl.go +1 -1
@@ 10,7 10,7 @@ import (
)

func init() {
	newContextFallback = func() (context, error) {
	newContextPrimary = func() (context, error) {
		return egl.NewContext(egl.EGL_DEFAULT_DISPLAY)
	}
}

M gpu/headless/headless_vulkan.go => gpu/headless/headless_vulkan.go +1 -1
@@ 21,7 21,7 @@ type vkContext struct {
}

func init() {
	newContextPrimary = newVulkanContext
	newContextFallback = newVulkanContext
}

func newVulkanContext() (context, error) {