[Bf-blender-cvs] [4f58f0b715f] wl_default: GHOST/Wayland: auto-select highest supported OpenGL version
Christian Rauch
noreply at git.blender.org
Wed Jun 23 22:44:25 CEST 2021
Commit: 4f58f0b715f51516c9943ad3d80ebb4c41f9fef3
Author: Christian Rauch
Date: Tue Jun 22 22:46:28 2021 +0100
Branches: wl_default
https://developer.blender.org/rB4f58f0b715f51516c9943ad3d80ebb4c41f9fef3
GHOST/Wayland: auto-select highest supported OpenGL version
===================================================================
M intern/ghost/intern/GHOST_SystemWayland.cpp
M intern/ghost/intern/GHOST_WindowWayland.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 83b9b2ba36b..16a6c93417e 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -1590,15 +1590,34 @@ GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*g
d->os_surfaces.push_back(os_surface);
d->os_egl_windows.push_back(os_egl_window);
- GHOST_Context *context = new GHOST_ContextEGL(false,
- EGLNativeWindowType(os_egl_window),
- EGLNativeDisplayType(d->display),
- EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
- 3,
- 3,
- GHOST_OPENGL_EGL_CONTEXT_FLAGS,
- GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
- EGL_OPENGL_API);
+ GHOST_Context *context;
+
+ for (int minor = 6; minor >= 0; --minor) {
+ context = new GHOST_ContextEGL(false,
+ EGLNativeWindowType(os_egl_window),
+ EGLNativeDisplayType(d->display),
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+ 4,
+ minor,
+ GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+ GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+ EGL_OPENGL_API);
+
+ if (context->initializeDrawingContext())
+ return context;
+ else
+ delete context;
+ }
+
+ context = new GHOST_ContextEGL(false,
+ EGLNativeWindowType(os_egl_window),
+ EGLNativeDisplayType(d->display),
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+ 3,
+ 3,
+ GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+ GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+ EGL_OPENGL_API);
if (context->initializeDrawingContext()) {
return context;
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index cbac2d6eaa1..1b9c29fc2c9 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -532,6 +532,22 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
context = new GHOST_ContextNone(m_wantStereoVisual);
break;
case GHOST_kDrawingContextTypeOpenGL:
+ for (int minor = 6; minor >= 0; --minor) {
+ context = new GHOST_ContextEGL(m_wantStereoVisual,
+ EGLNativeWindowType(w->egl_window),
+ EGLNativeDisplayType(m_system->display()),
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
+ 4,
+ minor,
+ GHOST_OPENGL_EGL_CONTEXT_FLAGS,
+ GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
+ EGL_OPENGL_API);
+
+ if (context->initializeDrawingContext())
+ return context;
+ else
+ delete context;
+ }
context = new GHOST_ContextEGL(m_wantStereoVisual,
EGLNativeWindowType(w->egl_window),
EGLNativeDisplayType(m_system->display()),
@@ -541,7 +557,6 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
GHOST_OPENGL_EGL_CONTEXT_FLAGS,
GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY,
EGL_OPENGL_API);
- break;
}
return (context->initializeDrawingContext() == GHOST_kSuccess) ? context : nullptr;
More information about the Bf-blender-cvs
mailing list