From 88917cb14f05585e695345d8e416a3298d73d4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 8 Jan 2025 20:13:01 +0800 Subject: [PATCH] OpenGL (EGL): try GLES 2.0+; then fallback to 1.1 if failed --- src/detection/opengl/opengl_shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/opengl/opengl_shared.c b/src/detection/opengl/opengl_shared.c index 0e44e32ff..e32b681b8 100644 --- a/src/detection/opengl/opengl_shared.c +++ b/src/detection/opengl/opengl_shared.c @@ -67,9 +67,11 @@ static const char* eglHandleContext(FFOpenGLResult* result, EGLData* data) static const char* eglHandleSurface(FFOpenGLResult* result, EGLData* data, bool gles) { data->context = data->ffeglCreateContext(data->display, data->config, EGL_NO_CONTEXT, (EGLint[]){ - EGL_CONTEXT_CLIENT_VERSION, gles ? 2 : 1, + EGL_CONTEXT_CLIENT_VERSION, gles ? 2 : 1, // Try GLES 2.0+ first EGL_NONE }); + if(data->context == EGL_NO_CONTEXT && gles) // Some ANGLE builds support GLES 1.1 only + data->context = data->ffeglCreateContext(data->display, data->config, EGL_NO_CONTEXT, (EGLint[]){EGL_NONE}); if(data->context == EGL_NO_CONTEXT) return "eglCreateContext returned EGL_NO_CONTEXT";