[retro-gtk] gl-renderer: Fix context initialization with GLES
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] gl-renderer: Fix context initialization with GLES
- Date: Sun, 21 Mar 2021 07:35:02 +0000 (UTC)
commit 54f7627a5cc20a254d3379b739bd426f5534d38d
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Mar 19 00:31:38 2021 +0500
gl-renderer: Fix context initialization with GLES
Also stop using extensions.
See https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglCreateContext.xhtml
retro-runner/retro-gl-renderer.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/retro-runner/retro-gl-renderer.c b/retro-runner/retro-gl-renderer.c
index 1bc12c1..f096606 100644
--- a/retro-runner/retro-gl-renderer.c
+++ b/retro-runner/retro-gl-renderer.c
@@ -336,18 +336,22 @@ retro_gl_renderer_new (RetroCore *core,
check_egl_errors ("eglBindAPI");
i = 0;
+
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
context_attribs[i++] = major_version;
- context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
- context_attribs[i++] = minor_version;
- context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK;
- context_attribs[i++] = use_compat_profile ?
- EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT :
- EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT;
+
+ if (!is_opengl_es) {
+ context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
+ context_attribs[i++] = minor_version;
+ context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK;
+ context_attribs[i++] = use_compat_profile ?
+ EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT :
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT;
+ }
if (callback->debug_context) {
- context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
- context_attribs[i++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
+ context_attribs[i++] = EGL_CONTEXT_OPENGL_DEBUG;
+ context_attribs[i++] = EGL_TRUE;
}
context_attribs[i++] = EGL_NONE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]