Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-10-10 11:39:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-10 11:39:35 +0300
commitf42ae6c569fd09a17f6554a2c72057239e5477ec (patch)
treee76ab56608337383db4e6723a4f19e3cd019af57 /intern
parent64e4f9967fbc5ee40c6aa8a46d7527faf2ca356e (diff)
Fix/Workaround T46431: blender-softwaregl crashes
Order of initialization bug only impacted mesa's software-gl. For now effectively revert support for glx-context-flags.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 02b43abec6c..4d45d493aa2 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -40,6 +40,8 @@
#include <cstdio>
#include <cstring>
+/* this should eventually be enabled, but causes T46431 */
+// #define USE_CONTEXT_FLAGS
#ifdef WITH_GLEW_MX
GLXEWContext *glxewContext = NULL;
@@ -154,12 +156,19 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
XIOErrorHandler old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
#endif
+#ifdef USE_CONTEXT_FLAGS
/* needed so 'GLXEW_ARB_create_context' is valid */
mxIgnoreNoVersion(1);
initContextGLXEW();
mxIgnoreNoVersion(0);
+#endif
- if (GLXEW_ARB_create_context) {
+#ifdef USE_CONTEXT_FLAGS
+ if (GLXEW_ARB_create_context)
+#else
+ if (0)
+#endif
+ {
int profileBitCore = m_contextProfileMask & GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
int profileBitCompat = m_contextProfileMask & GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
@@ -264,6 +273,12 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
glXMakeCurrent(m_display, m_window, m_context);
+#ifndef USE_CONTEXT_FLAGS
+ // Seems that this has to be called after MakeCurrent,
+ // which means we cannot use glX extensions until after we create a context
+ initContextGLXEW();
+#endif
+
initClearGL();
::glXSwapBuffers(m_display, m_window);