VirtualBox

Changeset 76269 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 17, 2018 6:05:17 PM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d: dynamic loading of OpenGL: log failures

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp

    r76263 r76269  
    133133    {
    134134        static const char s_szLibX11[] = "libX11.so.6";
    135         rc = RTLdrLoadEx(s_szLibX11, &s_hX11, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL);
     135        rc = RTLdrLoadEx(s_szLibX11, &s_hX11, RTLDRLOAD_FLAGS_LOCAL | RTLDRLOAD_FLAGS_NO_UNLOAD, NULL);
    136136        if (RT_FAILURE(rc))
    137137        {
     
    182182     * probably only after the release is out... */
    183183
     184#ifdef RT_OS_WINDOWS
     185    pfn_wglCreateContext = 0;
     186    pfn_wglDeleteContext = 0;
     187    pfn_wglMakeCurrent = 0;
     188    pfn_wglShareLists = 0;
     189#elif defined(RT_OS_LINUX)
     190    pfn_glXQueryVersion = 0;
     191    pfn_glXChooseVisual = 0;
     192    pfn_glXCreateContext = 0;
     193    pfn_glXMakeCurrent = 0;
     194    pfn_glXDestroyContext = 0;
     195    pfn_XConfigureWindow = 0;
     196    pfn_XCloseDisplay = 0;
     197    pfn_XCreateColormap = 0;
     198    pfn_XCreateWindow = 0;
     199    pfn_XDefaultRootWindow = 0;
     200    pfn_XDestroyWindow = 0;
     201    pfn_XNextEvent = 0;
     202    pfn_XOpenDisplay = 0;
     203    pfn_XPending = 0;
     204#endif
    184205    pfn_glAlphaFunc = 0;
    185206    pfn_glBindTexture = 0;
     
    248269    pfn_glVertexPointer = 0;
    249270    pfn_glViewport = 0;
     271
     272    PFNRT pfnRet;
    250273#ifdef RT_OS_WINDOWS
    251     pfn_wglCreateContext = 0;
    252     pfn_wglDeleteContext = 0;
    253     pfn_wglMakeCurrent = 0;
    254     pfn_wglShareLists = 0;
     274    GLGETPROC_(wglCreateContext, "");
     275    GLGETPROC_(wglDeleteContext, "");
     276    GLGETPROC_(wglMakeCurrent, "");
     277    GLGETPROC_(wglShareLists, "");
    255278#elif defined(RT_OS_LINUX)
    256     pfn_glXQueryVersion = 0;
    257     pfn_glXChooseVisual = 0;
    258     pfn_glXCreateContext = 0;
    259     pfn_glXMakeCurrent = 0;
    260     pfn_glXDestroyContext = 0;
    261     pfn_XConfigureWindow = 0;
    262     pfn_XCloseDisplay = 0;
    263     pfn_XCreateColormap = 0;
    264     pfn_XCreateWindow = 0;
    265     pfn_XDefaultRootWindow = 0;
    266     pfn_XDestroyWindow = 0;
    267     pfn_XNextEvent = 0;
    268     pfn_XOpenDisplay = 0;
    269     pfn_XPending = 0;
     279    X11GETPROC_(XConfigureWindow);
     280    X11GETPROC_(XCloseDisplay);
     281    X11GETPROC_(XCreateColormap);
     282    X11GETPROC_(XCreateWindow);
     283    X11GETPROC_(XDefaultRootWindow);
     284    X11GETPROC_(XDestroyWindow);
     285    X11GETPROC_(XNextEvent);
     286    X11GETPROC_(XOpenDisplay);
     287    X11GETPROC_(XPending);
     288    GLGETPROC_(glXQueryVersion, "");
     289    GLGETPROC_(glXChooseVisual, "");
     290    GLGETPROC_(glXCreateContext, "");
     291    GLGETPROC_(glXMakeCurrent, "");
     292    GLGETPROC_(glXDestroyContext, "");
    270293#endif
    271 
    272     PFNRT pfnRet;
    273294    GLGETPROC_(glAlphaFunc, "");
    274295    GLGETPROC_(glBindTexture, "");
     
    334355    GLGETPROC_(glVertexPointer, "");
    335356    GLGETPROC_(glViewport, "");
    336 #ifdef RT_OS_WINDOWS
    337     GLGETPROC_(wglCreateContext, "");
    338     GLGETPROC_(wglDeleteContext, "");
    339     GLGETPROC_(wglMakeCurrent, "");
    340     GLGETPROC_(wglShareLists, "");
    341 #elif defined(RT_OS_LINUX)
    342     GLGETPROC_(glXQueryVersion, "");
    343     GLGETPROC_(glXChooseVisual, "");
    344     GLGETPROC_(glXCreateContext, "");
    345     GLGETPROC_(glXMakeCurrent, "");
    346     GLGETPROC_(glXDestroyContext, "");
    347     X11GETPROC_(XConfigureWindow);
    348     X11GETPROC_(XCloseDisplay);
    349     X11GETPROC_(XCreateColormap);
    350     X11GETPROC_(XCreateWindow);
    351     X11GETPROC_(XDefaultRootWindow);
    352     X11GETPROC_(XDestroyWindow);
    353     X11GETPROC_(XNextEvent);
    354     X11GETPROC_(XOpenDisplay);
    355     X11GETPROC_(XPending);
    356 #endif
    357357    return VINF_SUCCESS;
    358358}
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r76266 r76269  
    30323032        /* get an X display and make sure we have glX 1.3 */
    30333033        pState->display = XOpenDisplay(0);
    3034         Assert(pState->display);
     3034        AssertLogRelMsgReturn(pState->display, ("XOpenDisplay failed"), VERR_INTERNAL_ERROR);
    30353035        int glxMajor, glxMinor;
    30363036        Bool ret = glXQueryVersion(pState->display, &glxMajor, &glxMinor);
    3037         AssertMsgReturn(ret && glxMajor == 1 && glxMinor >= 3, ("glX >=1.3 not present"), VERR_INTERNAL_ERROR);
     3037        AssertLogRelMsgReturn(ret && glxMajor == 1 && glxMinor >= 3, ("glX >=1.3 not present"), VERR_INTERNAL_ERROR);
    30383038        /* start our X event handling thread */
    30393039        rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dXEventThread, pState, 0, RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "VMSVGA3DXEVENT");
    3040         if (RT_FAILURE(rc))
    3041         {
    3042             AssertMsgFailed(("%s: Async IO Thread creation for 3d window handling failed rc=%d\n", __FUNCTION__, rc));
    3043             return rc;
    3044         }
    3045     }
    3046 
     3040        AssertLogRelMsgReturn(RT_SUCCESS(rc), ("Async IO Thread creation for 3d window handling failed rc=%Rrc\n", rc), rc);
     3041    }
     3042
     3043    Window defaultRootWindow = XDefaultRootWindow(pState->display);
    30473044    /* Create a small 4x4 window required for GL context. */
    30483045    int attrib[] =
     
    30573054    };
    30583055    XVisualInfo *vi = glXChooseVisual(pState->display, DefaultScreen(pState->display), attrib);
     3056    AssertLogRelMsgReturn(vi, ("glXChooseVisual failed"), VERR_INTERNAL_ERROR);
    30593057    XSetWindowAttributes swa;
    3060     swa.colormap = XCreateColormap(pState->display, XDefaultRootWindow(pState->display), vi->visual, AllocNone);
     3058    swa.colormap = XCreateColormap(pState->display, defaultRootWindow, vi->visual, AllocNone);
     3059    AssertLogRelMsgReturn(swa.colormap, ("XCreateColormap failed"), VERR_INTERNAL_ERROR);
    30613060    swa.border_pixel = 0;
    30623061    swa.background_pixel = 0;
    30633062    swa.event_mask = StructureNotifyMask;
    30643063    unsigned long flags = CWBorderPixel | CWBackPixel | CWColormap | CWEventMask;
    3065     pContext->window = XCreateWindow(pState->display, XDefaultRootWindow(pState->display),
     3064    pContext->window = XCreateWindow(pState->display, defaultRootWindow,
    30663065                                     0, 0, 4, 4,
    30673066                                     0, vi->depth, InputOutput,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette