VirtualBox

Changeset 39834 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 23, 2012 10:19:24 AM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: adjust FBO switching logic a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_framebuffer.c

    r39833 r39834  
    748748}
    749749
    750 
    751750DECLEXPORT(void) STATE_APIENTRY
    752751crStateFramebufferObjectDisableHW(CRContext *ctx)
    753752{
     753    GLboolean fAdjustDrawReadBuffers = GL_FALSE;
     754
    754755    if (ctx->framebufferobject.drawFB)
     756    {
    755757        diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, 0);
     758        fAdjustDrawReadBuffers = GL_TRUE;
     759    }
    756760
    757761    if (ctx->framebufferobject.readFB)
     762    {
    758763        diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, 0);
    759 
    760     if (ctx->framebufferobject.drawFB)
     764        fAdjustDrawReadBuffers = GL_TRUE;
     765    }
     766
     767    if (fAdjustDrawReadBuffers)
     768    {
    761769        diff_api.DrawBuffer(GL_BACK);
    762     if (ctx->framebufferobject.readFB)
    763770        diff_api.ReadBuffer(GL_BACK);
     771    }
    764772
    765773    if (ctx->framebufferobject.renderbuffer)
     
    772780    GLboolean fAdjustDrawReadBuffers = GL_FALSE;
    773781
    774     if (fromCtx->framebufferobject.drawFB
    775             && fromCtx->framebufferobject.drawFB == toCtx->framebufferobject.drawFB)
     782    if (fromCtx->framebufferobject.drawFB /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */
     783            && fromCtx->framebufferobject.drawFB == toCtx->framebufferobject.drawFB) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */
    776784    {
    777785        diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, toCtx->framebufferobject.drawFB->hwid);
     
    779787    }
    780788
    781     if (fromCtx->framebufferobject.readFB
    782             && fromCtx->framebufferobject.readFB == toCtx->framebufferobject.readFB)
     789    if (fromCtx->framebufferobject.readFB /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */
     790            && fromCtx->framebufferobject.readFB == toCtx->framebufferobject.readFB) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */
    783791    {
    784792        diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, toCtx->framebufferobject.readFB->hwid);
     
    792800    }
    793801
    794     if (fromCtx->framebufferobject.renderbuffer
    795             && fromCtx->framebufferobject.renderbuffer==toCtx->framebufferobject.renderbuffer)
     802    if (fromCtx->framebufferobject.renderbuffer /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */
     803            && fromCtx->framebufferobject.renderbuffer==toCtx->framebufferobject.renderbuffer) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */
    796804    {
    797805        diff_api.BindRenderbufferEXT(GL_RENDERBUFFER_EXT, toCtx->framebufferobject.renderbuffer->hwid);
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