VirtualBox

Changeset 57946 in vbox


Ignore:
Timestamp:
Sep 29, 2015 3:28:40 PM (9 years ago)
Author:
vboxsync
Message:

SharedOpenGL: log OpenGL extensions which are enabled in Chromium but not supported by the host

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r54582 r57946  
    426426}
    427427
     428/* Check that OpenGL extensions listed in pszRequiredExts string also exist in the pszAvailableExts string. */
     429static void renderCompareGLExtensions(const char *pszAvailableExts, const char *pszRequiredExts)
     430{
     431    unsigned char fPrintHeader = 1;
     432    const char *pszExt = pszRequiredExts;
     433
     434    for (;;)
     435    {
     436        const char *pszSrc = pszAvailableExts;
     437        size_t offExtEnd;
     438
     439        while (*pszExt == ' ')
     440            ++pszExt;
     441
     442        if (!*pszExt)
     443            break;
     444
     445        offExtEnd = RTStrOffCharOrTerm(pszExt, ' ');
     446
     447        for (;;)
     448        {
     449            size_t offSrcEnd;
     450
     451            while (*pszSrc == ' ')
     452                ++pszSrc;
     453
     454            if (!*pszSrc)
     455                break;
     456
     457            offSrcEnd = RTStrOffCharOrTerm(pszSrc, ' ');
     458
     459            if (   offSrcEnd == offExtEnd
     460                && memcmp(pszSrc, pszExt, offSrcEnd) == 0)
     461                    break;
     462
     463            pszSrc += offSrcEnd;
     464        }
     465
     466        if (!*pszSrc)
     467        {
     468            if (fPrintHeader)
     469            {
     470                fPrintHeader = 0;
     471                crInfo("Host does not support OpenGL extension(s):");
     472            }
     473            crInfo("%.*s", offExtEnd, pszExt);
     474        }
     475
     476        pszExt += offExtEnd;
     477    }
     478}
     479
    428480void renderspuPerformMakeCurrent(WindowInfo *window, GLint nativeWindow, ContextInfo *context)
    429481{
     
    449501        renderspu_SystemMakeCurrent( window, nativeWindow, context );
    450502        if (!context->everCurrent) {
     503            static volatile uint32_t u32ExtCompared = 0;
    451504            /* print OpenGL info */
    452505            const char *extString = (const char *) render_spu.ws.glGetString( GL_EXTENSIONS );
     
    458511            crInfo( "Render SPU: GL_VERSION:  %s", render_spu.ws.glGetString( GL_VERSION ) );
    459512            crInfo( "Render SPU: GL_EXTENSIONS: %s", render_spu.ws.glGetString( GL_EXTENSIONS ) );
     513
     514            if (ASMAtomicCmpXchgU32(&u32ExtCompared, 1, 0))
     515                renderCompareGLExtensions(extString, crExtensions);
     516
    460517            if (crStrstr(extString, "GL_ARB_window_pos"))
    461518                context->haveWindowPosARB = GL_TRUE;
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