~eliasnaur/gio

d3fffef86188d51cebc2a6c977d7c01c9c78798c — Elias Naur 1 year, 1 month ago 3bb1450
app/internal/egl: adjust alpha bit depth to enable sRGB on some GPUs

On my setup:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) HD Graphics 530 (SKL GT2) (0x1912)
    Version: 20.1.5
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2

eglCreateWindowSurface with the sRGB flag fails with EGL_BAD_MATCH.
Bumping the ALPHA_SIZE from 1 to 8 seems to make the driver happy
again.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M app/internal/egl/egl.go
M app/internal/egl/egl.go => app/internal/egl/egl.go +1 -1
@@ 219,7 219,7 @@ func createContext(disp _EGLDisplay) (*eglContext, error) {
			// https://bugs.freedesktop.org/show_bug.cgi?id=107782.
			//
			// Also, some Android devices (Samsung S9) needs alpha for sRGB to work.
			attribs = append(attribs, _EGL_ALPHA_SIZE, 1)
			attribs = append(attribs, _EGL_ALPHA_SIZE, 8)
		}
		// Only request a depth buffer if we're going to render directly to the framebuffer.
		attribs = append(attribs, _EGL_DEPTH_SIZE, 16)