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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-10-12 07:04:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-12 07:08:20 +0300
commit9cea429f787727d8a19b9dfe179a5b7ba2d92fd0 (patch)
tree2b71c91be73e10e91fa566e63ae8c2e8ad7753d1 /intern/ghost
parente0c05a1e6ab82b365146b5149cec1dfd89b1cd2f (diff)
Fix T46431: Init glew before glx-context crashes
Initialize glxew before glew, so we can check whats supported before creating the context. This also removes need for mxIgnoreNoVersion.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 4d45d493aa2..c431e7e2a01 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -40,9 +40,6 @@
#include <cstdio>
#include <cstring>
-/* this should eventually be enabled, but causes T46431 */
-// #define USE_CONTEXT_FLAGS
-
#ifdef WITH_GLEW_MX
GLXEWContext *glxewContext = NULL;
#endif
@@ -156,19 +153,11 @@ 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
+ /* important to initialize only glxew (_not_ glew),
+ * since this breaks w/ Mesa's `swrast`, see: T46431 */
+ glxewInit();
-#ifdef USE_CONTEXT_FLAGS
- if (GLXEW_ARB_create_context)
-#else
- if (0)
-#endif
- {
+ if (GLXEW_ARB_create_context) {
int profileBitCore = m_contextProfileMask & GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
int profileBitCompat = m_contextProfileMask & GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
@@ -273,11 +262,9 @@ 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);