egl_helpers: change minimum framebuffer size to 8 bit per component

This is for working around bugs in certain Android devices. At least one
device fails to sort EGLConfigs by size, so eglChooseConfig() ends up
choosing a config with 5/6/5 bits per r/g/b component. The other
attributes in the affected EGLConfigs did not look like they should
affect the sorting process as specified by the EGL 1.4 standard.

The device was reported as:

Sony Xperia Z3 Tablet Compact
Firmware 6.0.1 build number 23.5.A.1.291
GL_VERSION='OpenGL ES 3.0 V@140.0 AU@ (GIT@I741a3d36ca)'
GL_VENDOR='Qualcomm'
GL_RENDERER='Adreno (TM) 330'

Other Qualcom/Adreno devices have been reported as unaffected by this
(including some with same GL_RENDERER string).

"Fix" this by always requiring at least 8 bit. This means it would fail
on devices which cannot provide this. We're fine with this.

mpv-android/mpv-android#112
This commit is contained in:
wm4 2018-04-26 21:48:57 +02:00 committed by Jan Ekström
parent b4173c1fd2
commit eb33556cbf
1 changed files with 3 additions and 3 deletions

View File

@ -115,9 +115,9 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display,
EGLint attributes[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, ctx->opts.want_alpha ? 1 : 0,
EGL_RENDERABLE_TYPE, rend,
EGL_NONE