VirtualBox

Ignore:
Timestamp:
May 4, 2012 9:55:53 AM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: render to fbo fixes

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c

    r41000 r41160  
    314314    CRASSERT(ctx);
    315315
     316    oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow);
     317
    316318    /* Ubuntu 11.04 hosts misbehave if context window switch is
    317319     * done with non-default framebuffer object settings.
     
    319321     * crStateSwichPrepare restores the FBO state to its default values before the context window switch,
    320322     * while crStateSwichPostprocess restores it back to the original values */
    321     if (!cr_server.bUseMultipleContexts)
    322         oldCtx = crStateSwichPrepare(ctx);
     323    oldCtx = crStateSwichPrepare(ctx, cr_server.bUseMultipleContexts, oldMural && oldMural->bUseFBO && crServerSupportRedirMuralFBO() ? oldMural->idFBO : 0);
    323324
    324325    /*
     
    357358                    cr_server.currentWindow, window);
    358359    */
    359 
    360     oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow);
    361360
    362361    if (1/*cr_server.firstCallMakeCurrent ||
     
    384383    crStateMakeCurrent( ctx );
    385384
    386 
    387     if (!cr_server.bUseMultipleContexts)
    388         crStateSwichPostprocess(oldCtx);
    389 
    390     if (oldMural != mural && crServerSupportRedirMuralFBO())
    391     {
    392         if (!crStateGetCurrent()->framebufferobject.drawFB)
    393         {
    394             cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, mural->bUseFBO ? mural->idFBO:0);
    395         }
    396         if (!crStateGetCurrent()->framebufferobject.readFB)
    397         {
    398             cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_READ_FRAMEBUFFER, mural->bUseFBO ? mural->idFBO:0);
    399         }
    400     }
     385    crStateSwichPostprocess(oldCtx, cr_server.bUseMultipleContexts, mural->bUseFBO && crServerSupportRedirMuralFBO() ? mural->idFBO : 0);
    401386
    402387    if (!mural->bUseFBO)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c

    r37613 r41160  
    198198GLboolean crServerSupportRedirMuralFBO(void)
    199199{
    200     const GLubyte* pExt = cr_server.head_spu->dispatch_table.GetString(GL_REAL_EXTENSIONS);
    201 
    202     return ( NULL!=crStrstr((const char*)pExt, "GL_ARB_framebuffer_object")
    203              || NULL!=crStrstr((const char*)pExt, "GL_EXT_framebuffer_object"))
    204            && NULL!=crStrstr((const char*)pExt, "GL_ARB_texture_non_power_of_two");
     200    static GLboolean fInited = GL_FALSE;
     201    static GLboolean fSupported = GL_FALSE;
     202    if (!fInited)
     203    {
     204        const GLubyte* pExt = cr_server.head_spu->dispatch_table.GetString(GL_REAL_EXTENSIONS);
     205
     206        fSupported = ( NULL!=crStrstr((const char*)pExt, "GL_ARB_framebuffer_object")
     207                 || NULL!=crStrstr((const char*)pExt, "GL_EXT_framebuffer_object"))
     208               && NULL!=crStrstr((const char*)pExt, "GL_ARB_texture_non_power_of_two");
     209        fInited = GL_TRUE;
     210    }
     211    return fSupported;
    205212}
    206213
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