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>
This commit is contained in:
Elias Naur
2020-08-20 14:23:05 +02:00
parent 3bb1450d0d
commit d3fffef861
+1 -1
View File
@@ -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)