aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx/indirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/glx/indirect.c')
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index 495e366ca..605f975c0 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -601,7 +601,9 @@ glxWinScreenProbe(ScreenPtr pScreen)
if (NULL == screen)
return NULL;
- /* Dump out some useful information about the native renderer */
+ // Select the native GL implementation (WGL)
+ if (glWinSelectImplementation(1))
+ return NULL;
// create window class
{
@@ -650,11 +652,12 @@ glxWinScreenProbe(ScreenPtr pScreen)
// (but we need to have a current context for them to be resolvable)
wglResolveExtensionProcs();
- winDebug("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION));
- winDebug("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
- gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER);
+ /* Dump out some useful information about the native renderer */
+ winDebug("GL_VERSION: %s\n", glGetString(GL_VERSION));
+ winDebug("GL_VENDOR: %s\n", glGetString(GL_VENDOR));
+ gl_renderer = (const char *) glGetString(GL_RENDERER);
winDebug("GL_RENDERER: %s\n", gl_renderer);
- gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS);
+ gl_extensions = (const char *) glGetString(GL_EXTENSIONS);
wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
if (!wgl_extensions)
wgl_extensions = "";
@@ -668,7 +671,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
free(screen);
LogMessage(X_ERROR,
"AIGLX: Won't use generic native renderer as it is not accelerated\n");
- return NULL;
+ goto error;
}
// Can you see the problem here? The extensions string is DC specific
@@ -779,7 +782,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
free(screen);
LogMessage(X_ERROR,
"AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n");
- return NULL;
+ goto error;
}
/* These will be set by __glXScreenInit */
@@ -848,6 +851,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
pScreen->DestroyWindow = glxWinDestroyWindow;
return &screen->base;
+
+ error:
+ // Something went wrong and we can't use the native GL implementation
+ // so make sure the mesa GL implementation is selected instead
+ glWinSelectImplementation(0);
+
+ return NULL;
}
/* ---------------------------------------------------------------------- */
@@ -1037,7 +1047,7 @@ static void
glxWinDrawableCopySubBuffer(__GLXdrawable * drawable,
int x, int y, int w, int h)
{
- glAddSwapHintRectWINWrapperNonstatic(x, y, w, h);
+ glAddSwapHintRectWINWrapper(x, y, w, h);
glxWinDrawableSwapBuffers(NULL, drawable);
}
@@ -1619,7 +1629,6 @@ glxWinContextMakeCurrent(__GLXcontext * base)
#ifdef _DEBUG
GLWIN_TRACE_MSG("glxWinContextMakeCurrent context %p (native ctx %p)", gc, gc->ctx);
- glWinCallDelta();
#endif
/* Keep a note of the last active context in the drawable */
@@ -1691,7 +1700,6 @@ glxWinContextLoseCurrent(__GLXcontext * base)
#ifdef _DEBUG
GLWIN_TRACE_MSG("glxWinContextLoseCurrent context %p (native ctx %p)", gc, gc->ctx);
- glWinCallDelta();
#endif
/* Clear the last active context in the drawable */
@@ -1805,8 +1813,6 @@ glxWinCreateContext(__GLXscreen * screen,
context->Dispatch=calloc(sizeof(void*), (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS));
_glapi_set_dispatch(context->Dispatch);
- glWinSetupDispatchTable();
-
GLWIN_DEBUG_MSG("GLXcontext %p created", context);
return &(context->base);