VirtualBox

Ignore:
Timestamp:
Feb 18, 2013 5:02:47 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: OSX backend rework; oddscreen rendering generalization

File:
1 edited

Legend:

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

    r44529 r44740  
    2020#include "cr_string.h"
    2121#include "cr_mem.h"
     22#include "cr_vreg.h"
    2223#include "render/renderspu.h"
    2324
     
    315316    CRASSERT(mural->aidFBOs[0]==0);
    316317    CRASSERT(mural->aidFBOs[1]==0);
     318    CRASSERT(mural->width == mural->CEntry.Tex.width);
     319    CRASSERT(mural->height == mural->CEntry.Tex.height);
    317320
    318321    pMuralContextInfo = cr_server.currentCtxInfo;
     
    415418    }
    416419
     420    CRASSERT(mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)]);
     421    CrVrScrCompositorEntryTexNameUpdate(&mural->CEntry, mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)]);
     422
    417423    if (RestoreSpuWindow >= 0 && RestoreSpuContext >= 0)
    418424    {
     
    512518    GLuint idPBO;
    513519    CRContext *ctx = crStateGetCurrent();
    514     CR_BLITTER_TEXTURE Tex;
     520    VBOXVR_TEXTURE Tex;
    515521
    516522    CRASSERT(mural->fUseFBO);
     
    524530    if (!mural->width || !mural->height)
    525531    {
     532        return;
     533    }
     534
     535    if (!CrVrScrCompositorEntryIsInList(&mural->CEntry))
     536        return;
     537
     538    if (mural->fUseFBO == CR_SERVER_REDIR_FBO_BLT)
     539    {
     540        GLuint idDrawFBO, idReadFBO;
     541
     542        idDrawFBO = mural->aidFBOs[mural->iCurDrawBuffer];
     543        idReadFBO = mural->aidFBOs[mural->iCurReadBuffer];
     544
     545        crStateSwitchPrepare(NULL, ctx, idDrawFBO, idReadFBO);
     546
     547        cr_server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry);
     548
     549        crStateSwitchPostprocess(ctx, NULL, idDrawFBO, idReadFBO);
     550
    526551        return;
    527552    }
     
    532557    Tex.hwid = mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)];
    533558    CRASSERT(Tex.hwid);
    534 
    535     if (mural->fUseFBO == CR_SERVER_REDIR_FBO_BLT)
    536     {
    537         int rc;
    538         PCR_BLITTER pBlitter = crServerGetFBOPresentBlitter(mural);
    539         if (!pBlitter)
    540         {
    541             static int cPrintedWarnings = 0;
    542             if (++cPrintedWarnings <= 5)
    543             {
    544                 crWarning("crServerGetFBOPresentBlitter returned no blitter %d", cPrintedWarnings);
    545                 if (cPrintedWarnings == 5)
    546                     crWarning("won't print the above crServerGetFBOPresentBlitter warning any more", cPrintedWarnings);
    547             }
    548             return;
    549         }
    550 
    551         CrBltMuralSetCurrent(pBlitter, mural);
    552         rc = CrBltEnter(pBlitter, cr_server.currentCtxInfo, cr_server.currentMural);
    553         if (RT_SUCCESS(rc))
    554         {
    555             RTRECT Rect;
    556             Rect.xLeft = 0;
    557             Rect.yTop = 0;
    558             Rect.xRight = Tex.width;
    559             Rect.yBottom = Tex.height;
    560 
    561             CrBltBlitTexMural(pBlitter, &Tex, &Rect, &Rect, 1, 0);
    562             CrBltPresent(pBlitter);
    563 
    564             CrBltLeave(pBlitter);
    565         }
    566         else
    567         {
    568             crWarning("CrBltEnter failed rc %d", rc);
    569             return;
    570         }
    571         return;
    572     }
    573559
    574560    if (cr_server.bUsePBOForReadback && !mural->idPBO)
     
    687673        cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_READ_FRAMEBUFFER, mural->aidFBOs[mural->iCurReadBuffer]);
    688674    }
    689 }
     675    Assert(mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)]);
     676    CrVrScrCompositorEntryTexNameUpdate(&mural->CEntry, mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)]);
     677}
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