diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.cpp | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 992200a0b09..8cee785cdf6 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -1316,10 +1316,12 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type if (type == GHOST_kDrawingContextTypeOpenGL) { // During development: + // try 4.x compatibility profile // try 3.3 compatibility profile // fall back to 3.0 if needed // // Final Blender 2.8: + // try 4.x core profile // try 3.3 core profile // no fallbacks @@ -1332,24 +1334,9 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type # error // must specify either core or compat at build time #endif - GHOST_Context *context = new GHOST_ContextGLX( - m_wantStereoVisual, - m_wantNumOfAASamples, - m_window, - m_display, - m_visualInfo, - (GLXFBConfig)m_fbconfig, - profile_mask, - 3, 3, - GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0), - GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY); + GHOST_Context *context; - if (context->initializeDrawingContext()) - return context; - else { - delete context; - - // since that failed try 3.0 (mostly for Mesa, which doesn't implement compatibility profile) + for (int minor = 5; minor >= 0; --minor) { context = new GHOST_ContextGLX( m_wantStereoVisual, m_wantNumOfAASamples, @@ -1357,8 +1344,8 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type m_display, m_visualInfo, (GLXFBConfig)m_fbconfig, - 0, // no profile bit - 3, 0, + profile_mask, + 4, minor, GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0), GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY); @@ -1367,6 +1354,41 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type else delete context; } + + context = new GHOST_ContextGLX( + m_wantStereoVisual, + m_wantNumOfAASamples, + m_window, + m_display, + m_visualInfo, + (GLXFBConfig)m_fbconfig, + profile_mask, + 3, 3, + GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0), + GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY); + + if (context->initializeDrawingContext()) + return context; + else + delete context; + + // since that failed try 3.0 (mostly for Mesa, which doesn't implement compatibility profile) + context = new GHOST_ContextGLX( + m_wantStereoVisual, + m_wantNumOfAASamples, + m_window, + m_display, + m_visualInfo, + (GLXFBConfig)m_fbconfig, + 0, // no profile bit + 3, 0, + GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0), + GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY); + + if (context->initializeDrawingContext()) + return context; + else + delete context; } return NULL; |