diff options
Diffstat (limited to 'xorg-server/hw/xwin/glx/indirect.c')
-rw-r--r-- | xorg-server/hw/xwin/glx/indirect.c | 30 |
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 4f09652f0..3d01bed39 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -550,7 +550,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 #define WIN_GL_TEST_WINDOW_CLASS "XWinGLTest" @@ -597,11 +599,12 @@ glxWinScreenProbe(ScreenPtr pScreen) // (but we need to have a current context for them to be resolvable) wglResolveExtensionProcs(); - ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION)); - ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR)); - gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); + /* Dump out some useful information about the native renderer */ + ErrorF("GL_VERSION: %s\n", glGetString(GL_VERSION)); + ErrorF("GL_VENDOR: %s\n", glGetString(GL_VENDOR)); + gl_renderer = (const char *) glGetString(GL_RENDERER); ErrorF("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 = ""; @@ -615,7 +618,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 @@ -726,7 +729,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 */ @@ -789,6 +792,13 @@ glxWinScreenProbe(ScreenPtr pScreen) pScreen->CopyWindow = glxWinCopyWindow; 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; } /* ---------------------------------------------------------------------- */ @@ -910,7 +920,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); } @@ -1458,7 +1468,6 @@ glxWinContextMakeCurrent(__GLXcontext * base) GLWIN_TRACE_MSG("glxWinContextMakeCurrent context %p (native ctx %p)", gc, gc->ctx); - glWinCallDelta(); /* Keep a note of the last active context in the drawable */ drawPriv = gc->base.drawPriv; @@ -1528,7 +1537,6 @@ glxWinContextLoseCurrent(__GLXcontext * base) GLWIN_TRACE_MSG("glxWinContextLoseCurrent context %p (native ctx %p)", gc, gc->ctx); - glWinCallDelta(); /* An error seems to be reported if we try to make no context current @@ -1623,8 +1631,6 @@ glxWinCreateContext(__GLXscreen * screen, context->ctx = NULL; context->shareContext = shareContext; - glWinSetupDispatchTable(); - GLWIN_DEBUG_MSG("GLXcontext %p created", context); return &(context->base); |