VirtualBox

Ignore:
Timestamp:
Nov 21, 2012 7:28:05 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: host offscreen rendering to fix gnome-shell issues, repaint problems and more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r43890 r43932  
    7979struct BucketingInfo;
    8080
    81 /**
    82  * Mural info
    83  */
    84 typedef struct {
    85     GLuint width, height;
    86     GLint gX, gY;            /*guest coordinates*/
    87     GLint hX, hY;            /*host coordinates, screenID related*/
    88 
    89     int spuWindow;           /*the SPU's corresponding window ID */
    90 
    91     int screenId;
    92 
    93     GLboolean bVisible;      /*guest window is visible*/
    94     GLboolean bUseFBO;       /*redirect to FBO instead of real host window*/
    95     GLboolean bFbDraw;       /*GL_FRONT buffer is drawn to directly*/
    96 
    97     GLint       cVisibleRects;    /*count of visible rects*/
    98     GLint      *pVisibleRects;    /*visible rects left, top, right, bottom*/
    99     GLboolean   bReceivedRects;   /*indicates if guest did any updates for visible regions*/
    100 
    101     GLuint idFBO, idColorTex, idDepthStencilRB;
    102     GLuint fboWidth, fboHeight;
    103     GLuint idPBO;
    104 
    105     void *pvOutputRedirectInstance;
    106 } CRMuralInfo;
    107 
    10881typedef struct {
    10982    char   *pszDpyName;
     
    11184    int32_t externalID;
    11285} CRCreateInfo_t;
     86
     87/**
     88 * Mural info
     89 */
     90typedef struct {
     91    GLuint width, height;
     92    GLint gX, gY;            /*guest coordinates*/
     93    GLint hX, hY;            /*host coordinates, screenID related*/
     94
     95    int spuWindow;           /*the SPU's corresponding window ID */
     96
     97    int screenId;
     98
     99    GLboolean bVisible;      /*guest window is visible*/
     100    GLubyte   fUseFBO;       /*redirect to FBO instead of real host window*/
     101    GLboolean bFbDraw;       /*GL_FRONT buffer is drawn to directly*/
     102
     103    GLint       cVisibleRects;    /*count of visible rects*/
     104    GLint      *pVisibleRects;    /*visible rects left, top, right, bottom*/
     105    GLboolean   bReceivedRects;   /*indicates if guest did any updates for visible regions*/
     106
     107    GLuint idFBO, idColorTex, idDepthStencilRB;
     108    GLuint fboWidth, fboHeight;
     109    GLuint idPBO;
     110
     111    void *pvOutputRedirectInstance;
     112
     113    CRCreateInfo_t CreateInfo;
     114} CRMuralInfo;
    113115
    114116typedef struct {
     
    225227} CR_BLITTER, *PCR_BLITTER;
    226228
    227 int CrBltInit(PCR_BLITTER pBlitter, CRMuralInfo *pCurrentMural, GLint visualBits);
     229int CrBltInit(PCR_BLITTER pBlitter, CRMuralInfo *pCurrentMural);
    228230void CrBltTerm(PCR_BLITTER pBlitter);
    229231
     
    244246void CrBltBlitTexMural(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRects, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags);
    245247void CrBltBlitTexTex(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *pSrcRect, CR_BLITTER_TEXTURE *pDst, const RTRECT *pDstRect, uint32_t cRects, uint32_t fFlags);
     248void CrBltPresent(PCR_BLITTER pBlitter);
    246249/* */
    247250
     
    253256typedef FNCRDISPLAY_REGIONS_CHANGED *PFNCRDISPLAY_REGIONS_CHANGED;
    254257
    255 typedef DECLCALLBACK(int) FNCRDISPLAY_DRAW_ENTRY(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter);
     258typedef DECLCALLBACK(int) FNCRDISPLAY_DRAW_ENTRY(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter, bool *pfAllEntriesDrawn);
    256259typedef FNCRDISPLAY_DRAW_ENTRY *PFNCRDISPLAY_DRAW_ENTRY;
    257260
     
    265268    CR_BLITTER_TEXTURE Texture;
    266269    RTPOINT Pos;
     270    uint32_t cRects;
    267271    PRTRECT paSrcRects;
    268272    PRTRECT paDstRects;
    269     uint32_t cRects;
    270273} CR_PRESENTER_ENTRY, *PCR_PRESENTER_ENTRY;
    271274
     
    285288
    286289
    287 DECLCALLBACK(int) CrPtCbDrawEntrySingle(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter);
    288 DECLCALLBACK(int) CrPtCbDrawEntryAll(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter);
     290DECLCALLBACK(int) CrPtCbDrawEntrySingle(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter, bool *pfAllEntriesDrawn);
     291DECLCALLBACK(int) CrPtCbDrawEntryAll(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter, bool *pfAllEntriesDrawn);
    289292
    290293DECLINLINE(void) CrPtEntryInit(PCR_PRESENTER_ENTRY pEntry, PCR_BLITTER_TEXTURE pTextureData)
     
    298301    return VBoxVrCompositorEntryIsInList(&pEntry->Ce);
    299302}
    300 int CrPtEntryPresent(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, PCR_BLITTER pBlitter);
     303int CrPtPresent(PCR_PRESENTER pPresenter, PCR_BLITTER pBlitter);
     304int CrPtPresentEntry(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry, PCR_BLITTER pBlitter);
     305int CrPtEntryRegionsAdd(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
     306int CrPtEntryRegionsSet(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
    301307int CrPtEntryRemove(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry);
    302308int CrPtInit(PCR_PRESENTER pPresenter, PFNCRDISPLAY_REGIONS_CHANGED pfnRegionsChanged, PFNCRDISPLAY_DRAW_ENTRY pfnDrawEntry, PFNCRDISPLAY_DRAW_TEXTURE pfnDrawTexture);
     
    318324    CR_PRESENTER Presenter;
    319325    CRMuralInfo Mural;
    320     CRCreateInfo_t MuralCreateInfo;
    321326    PCR_BLITTER pBlitter;
    322327} CR_DISPLAY, *PCR_DISPLAY;
     
    328333    pDisplay->pBlitter = pBlitter;
    329334}
    330 bool CrDpBlitterTest(PCR_DISPLAY pDisplay, PCR_BLITTER pBlitter);
     335int CrDpBlitterTestWithMural(PCR_BLITTER pBlitter, CRMuralInfo *pMural);
     336int CrDpBlitterTest(PCR_DISPLAY pDisplay, PCR_BLITTER pBlitter);
    331337void CrDpResize(PCR_DISPLAY pDisplay, uint32_t width, uint32_t height,
    332338        uint32_t stretchedWidth, uint32_t stretchedHeight);
    333339void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, PCR_BLITTER_TEXTURE pTextureData);
    334340void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
    335 int CrDpPresentTexture(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
     341int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
     342int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
     343int CrDpPresentEntry(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
    336344DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry)
    337345{
     
    343351    return &pDisplay->Mural;
    344352}
    345 
    346 DECLINLINE(CRCreateInfo_t*) CrDpGetMuralCreateInfo(PCR_DISPLAY pDisplay)
    347 {
    348     return &pDisplay->MuralCreateInfo;
    349 }
    350 
    351353
    352354typedef struct CR_DISPLAY_ENTRY_MAP
     
    387389
    388390    CRHashTable *muralTable;  /**< hash table where all murals are stored */
    389     CRHashTable *pWindowCreateInfoTable; /**< hash table with windows creation info */
    390391
    391392    int client_spu_id;
     
    467468
    468469    PFNCRSERVERPRESENTFBO pfnPresentFBO;
    469     GLboolean             bForceOffscreenRendering; /*Force server to render 3d data offscreen
     470    GLubyte               bForceOffscreenRendering; /*Force server to render 3d data offscreen
    470471                                                     *using callback above to update vbox framebuffers*/
     472    GLubyte               bOffscreenRenderingDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/
    471473    GLboolean             bUsePBOForReadback;       /*Use PBO's for data readback*/
    472474
     
    476478    GLboolean             bUseMultipleContexts;
    477479
    478     uint8_t               fPresentBlitterInited;
     480    /* @todo: should we use just one blitter?
     481     * we use two currently because the drawable attribs can differ*/
     482    int8_t                fPresentBlitterInited;
     483    int8_t                fFBOModeBlitterInited;
    479484    CR_DISPLAY_ENTRY_MAP  PresentTexturepMap;
    480485    CR_BLITTER            PresentBlitter;
     486    CR_BLITTER            FBOModeBlitter;
    481487    uint32_t              DisplaysInitMap[(CR_MAX_GUEST_MONITORS + 31)/32];
    482488    CR_DISPLAY            aDispplays[CR_MAX_GUEST_MONITORS];
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