[gtk/wip.win32.fixes] gdkglcontext.c: Ensure EGL context are in-sync with shared context
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes] gdkglcontext.c: Ensure EGL context are in-sync with shared context
- Date: Mon, 17 Jan 2022 10:51:25 +0000 (UTC)
commit a6378b9d80e7b3451eb6e61f73d92e4dc27847da
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jan 17 17:27:10 2022 +0800
gdkglcontext.c: Ensure EGL context are in-sync with shared context
The EGL context that we are actually creating must have matching OpenGL/ES
versions and allowed GL API set with the previously-created EGL context
that will be shared with it so that they can interoperate together, if
applicable.
This will fix the situation by making sure that we request for the
OpenGL/ES version that matches with what we have in our shared EGL
context where, as well as the OpenGL API set that is supported by the
shared EGL context. Otherwise, the newly-created EGL context assumed a
OpenGL/ES 2.0 context that supported desktop OpenGL, which may not be
what we wanted, such as in the case of libANGLE.
gdk/gdkglcontext.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 3c5e4ffdb1..531344b72e 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -278,7 +278,15 @@ gdk_gl_context_real_realize (GdkGLContext *context,
int i = 0;
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
- gdk_gl_context_get_required_version (context, &major, &minor);
+ if (share != NULL)
+ {
+ gdk_gl_context_get_required_version (share, &major, &minor);
+ gdk_gl_context_set_allowed_apis (context,
+ gdk_gl_context_get_allowed_apis (share));
+ }
+ else
+ gdk_gl_context_get_required_version (context, &major, &minor);
+
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]