Changeset 45009 in vbox
- Timestamp:
- Mar 12, 2013 5:27:04 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84241
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h
r44997 r45009 57 57 typedef FNCRBLT_BLITTER *PFNCRBLT_BLITTER; 58 58 59 #define CRBLT_F_LINEAR 0x00000001 59 #define CRBLT_F_LINEAR 0x00000001 60 #define CRBLT_F_OFFSCREEN 0x00000002 60 61 61 62 typedef struct CR_BLITTER_SPUITEM -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r44886 r45009 124 124 GLuint fboWidth, fboHeight; 125 125 GLuint idPBO; 126 GLboolean fCompositorPresented; 126 127 127 128 VBOXVR_SCR_COMPOSITOR_ENTRY CEntry; -
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r44775 r45009 80 80 } 81 81 82 DECLINLINE(bool) VBoxRectIsZero(const RTRECT *pRect) 83 { 84 return pRect->xLeft == pRect->xRight || pRect->yTop == pRect->yBottom; 85 } 86 82 87 DECLINLINE(bool) VBoxRectIsIntersect(const RTRECT * pRect1, const RTRECT * pRect2) 83 88 { -
trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
r44997 r45009 92 92 const RTRECT * pSrcRect = &paSrcRect[i]; 93 93 const RTRECT * pDstRect = &paDstRect[i]; 94 pBlitter->pDispatch->BlitFramebufferEXT( 95 pSrcRect->xLeft, pSrcRect->yTop, pSrcRect->xRight, pSrcRect->yBottom, 96 pDstRect->xLeft, pDstRect->yTop, pDstRect->xRight, pDstRect->yBottom, 97 GL_COLOR_BUFFER_BIT, filter); 94 if (CRBLT_F_OFFSCREEN & fFlags) 95 { 96 pBlitter->pDispatch->BlitFramebufferEXT( 97 pSrcRect->xLeft, pSrcRect->yTop, pSrcRect->xRight, pSrcRect->yBottom, 98 pDstRect->xLeft, pDstRect->yTop, pDstRect->xRight, pDstRect->yBottom, 99 GL_COLOR_BUFFER_BIT, filter); 100 } 101 else 102 { 103 pBlitter->pDispatch->BlitFramebufferEXT( 104 pSrcRect->xLeft, pSrc->height - pSrcRect->yTop, pSrcRect->xRight, pSrc->height - pSrcRect->yBottom, 105 pDstRect->xLeft, pDstSize->cy - pDstRect->yTop, pDstRect->xRight, pDstSize->cy - pDstRect->yBottom, 106 GL_COLOR_BUFFER_BIT, filter); 107 } 98 108 } 99 109 … … 488 498 crBltCheckSetupViewport(pBlitter, pDstSize, enmDstBuff == GL_DRAW_FRAMEBUFFER); 489 499 490 pBlitter->pfnBlt(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags );500 pBlitter->pfnBlt(pBlitter, pSrc, paSrcRects, pDstSize, paDstRects, cRects, fFlags & CRBLT_F_OFFSCREEN); 491 501 } 492 502 … … 497 507 pBlitter->pDispatch->BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, 0); 498 508 499 crBltBlitTexBuf(pBlitter, pSrc, paSrcRects, GL_BACK, &DstSize, paDstRects, cRects, fFlags );509 crBltBlitTexBuf(pBlitter, pSrc, paSrcRects, GL_BACK, &DstSize, paDstRects, cRects, fFlags & (~CRBLT_F_OFFSCREEN)); 500 510 } 501 511 -
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r44766 r45009 130 130 RTListForEach(&pList->ListHead, pReg1, VBOXVR_REG, ListEntry) 131 131 { 132 Assert(!VBoxRectIsZero(&pReg1->Rect)); 132 133 for (RTLISTNODE *pEntry2 = pReg1->ListEntry.pNext; pEntry2 != &pList->ListHead; pEntry2 = pEntry2->pNext) 133 134 { … … 217 218 vboxVrDbgListVerify(pList1); 218 219 #endif 220 Assert(!VBoxRectIsZero(pRect2)); 219 221 220 222 RTListInit(&List); … … 306 308 { 307 309 const RTRECT *pRect2 = &aRects[i]; 310 if (VBoxRectIsZero(pRect2)) 311 continue; 308 312 if (pReg1->Rect.yBottom <= pRect2->yTop) 309 313 continue; … … 650 654 for (uint32_t i = 0; i < cRects; ++i) 651 655 { 656 if (VBoxRectIsZero(&aRects[i])) 657 { 658 cCovered++; 659 continue; 660 } 661 652 662 for (PRTLISTNODE pEntry1 = pList->ListHead.pNext; pEntry1 != &pList->ListHead; pEntry1 = pEntry1->pNext) 653 663 { 654 664 PVBOXVR_REG pReg1 = PVBOXVR_REG_FROM_ENTRY(pEntry1); 665 655 666 if (VBoxRectIsCoveres(&pReg1->Rect, &aRects[i])) 656 667 { … … 679 690 for (uint32_t i = 0; i < cRects; ++i) 680 691 { 692 if (VBoxRectIsZero(&aRects[i])) 693 continue; 694 681 695 PVBOXVR_REG pReg = vboxVrRegCreate(); 682 696 if (!pReg) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r44740 r45009 142 142 void crServerMuralFBOSwapBuffers(CRMuralInfo *mural); 143 143 144 void crServerVBoxCompositionReenable(CRMuralInfo *mural); 145 void crServerVBoxCompositionDisable(CRMuralInfo *mural); 146 void crServerVBoxCompositionPresent(CRMuralInfo *mural); 147 144 148 #define CR_SERVER_FBO_BB_IDX(_mural) ((_mural)->iBbBuffer) 145 149 #define CR_SERVER_FBO_FB_IDX(_mural) (((_mural)->iBbBuffer + 1) % ((_mural)->cBuffers)) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r44860 r45009 287 287 CRASSERT(ctx); 288 288 289 oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow);289 oldMural = cr_server.currentMural; 290 290 291 291 /* Ubuntu 11.04 hosts misbehave if context window switch is -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r44951 r45009 265 265 } 266 266 267 if ( !crStateGetCurrent()->framebufferobject.drawFB)268 { 269 cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, mural->aidFBOs[mural->iCurDrawBuffer]);270 }271 if (!crStateGetCurrent()->framebufferobject.readFB)272 {273 cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_READ_FRAMEBUFFER, mural->aidFBOs[mural->iCurReadBuffer]);274 }275 276 if (cr_server.curClient && cr_server.curClient->currentMural == mural)277 { 267 if (cr_server.currentMural == mural) 268 { 269 if (!crStateGetCurrent()->framebufferobject.drawFB) 270 { 271 cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, mural->aidFBOs[mural->iCurDrawBuffer]); 272 } 273 if (!crStateGetCurrent()->framebufferobject.readFB) 274 { 275 cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_READ_FRAMEBUFFER, mural->aidFBOs[mural->iCurReadBuffer]); 276 } 277 278 278 crStateGetCurrent()->buffer.width = 0; 279 279 crStateGetCurrent()->buffer.height = 0; … … 286 286 /* tell renderspu we do not want compositor presentation anymore 287 287 * renderspu will ensure its redraw thread is done with using the compositor, etc. */ 288 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, NULL, NULL);288 crServerVBoxCompositionDisable(mural); 289 289 } 290 290 … … 292 292 cr_server.head_spu->dispatch_table.WindowShow(mural->spuWindow, mural->bVisible); 293 293 294 if ( mural->fUseFBO && crServerSupportRedirMuralFBO())294 if (cr_server.currentMural == mural) 295 295 { 296 296 if (!crStateGetCurrent()->framebufferobject.drawFB) … … 302 302 cr_server.head_spu->dispatch_table.BindFramebufferEXT(GL_READ_FRAMEBUFFER, 0); 303 303 } 304 } 305 306 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 307 { 304 308 305 crStateGetCurrent()->buffer.width = mural->width; 309 306 crStateGetCurrent()->buffer.height = mural->height; … … 512 509 } 513 510 511 void crServerVBoxCompositionPresent(CRMuralInfo *mural) 512 { 513 CRMuralInfo *currentMural = cr_server.currentMural; 514 CRContextInfo *curCtxInfo = cr_server.currentCtxInfo; 515 GLuint idDrawFBO, idReadFBO; 516 CRContext *curCtx = curCtxInfo->pContext; 517 518 CRASSERT(curCtx == crStateGetCurrent()); 519 520 if (!mural->bVisible) 521 { 522 return; 523 } 524 525 if (!mural->width || !mural->height) 526 { 527 return; 528 } 529 530 if (!CrVrScrCompositorEntryIsInList(&mural->CEntry)) 531 return; 532 533 if (currentMural) 534 { 535 idDrawFBO = currentMural->aidFBOs[currentMural->iCurDrawBuffer]; 536 idReadFBO = currentMural->aidFBOs[currentMural->iCurReadBuffer]; 537 } 538 else 539 { 540 idDrawFBO = 0; 541 idReadFBO = 0; 542 } 543 544 crStateSwitchPrepare(NULL, curCtx, idDrawFBO, idReadFBO); 545 546 cr_server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry); 547 548 crStateSwitchPostprocess(curCtx, NULL, idDrawFBO, idReadFBO); 549 550 mural->fCompositorPresented = GL_TRUE; 551 } 552 553 void crServerVBoxCompositionReenable(CRMuralInfo *mural) 554 { 555 if (!mural->fCompositorPresented) 556 return; 557 558 crServerVBoxCompositionPresent(mural); 559 } 560 561 void crServerVBoxCompositionDisable(CRMuralInfo *mural) 562 { 563 cr_server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, NULL, NULL); 564 } 565 514 566 void crServerPresentFBO(CRMuralInfo *mural) 515 567 { … … 539 591 if (mural->fUseFBO == CR_SERVER_REDIR_FBO_BLT) 540 592 { 541 GLuint idDrawFBO, idReadFBO; 542 543 idDrawFBO = mural->aidFBOs[mural->iCurDrawBuffer]; 544 idReadFBO = mural->aidFBOs[mural->iCurReadBuffer]; 545 546 crStateSwitchPrepare(NULL, ctx, idDrawFBO, idReadFBO); 547 548 cr_server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry); 549 550 crStateSwitchPostprocess(ctx, NULL, idDrawFBO, idReadFBO); 551 593 crServerVBoxCompositionPresent(mural); 552 594 return; 553 595 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r44951 r45009 31 31 return -1; 32 32 } 33 34 mural->fCompositorPresented = GL_FALSE; 33 35 34 36 /* … … 339 341 340 342 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 341 cr_server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, NULL, NULL); 342 } 343 crServerVBoxCompositionDisable(mural); 344 } 345 346 mural->fCompositorPresented = GL_FALSE; 343 347 344 348 /* 2. do necessary modifications (see above comment) */ … … 359 363 mural->height = height; 360 364 361 if (cr_server.cur Client && cr_server.curClient->currentMural == mural)365 if (cr_server.currentMural == mural) 362 366 { 363 367 crStateGetCurrent()->buffer.width = mural->width; … … 370 374 371 375 /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */ 372 /* 376 /* uncomment when needed */ 377 /* NOTE: !!! we have mural->fCompositorPresented set to GL_FALSE above, so crServerVBoxCompositionReenable will have no effect in any way 373 378 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 374 379 { 375 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry);380 crServerVBoxCompositionReenable(mural); 376 381 } 377 382 */ … … 395 400 crServerMuralSize(mural, width, height); 396 401 397 /* Work-around Intel driver bug */ 398 CRASSERT(!cr_server.curClient 399 || !cr_server.curClient->currentMural 400 || cr_server.curClient->currentMural == mural); 401 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 402 { 403 CRContextInfo * ctxInfo = cr_server.currentCtxInfo; 404 CRASSERT(ctxInfo); 405 crServerDispatchMakeCurrent(window, 0, ctxInfo->CreateInfo.externalID); 402 if (cr_server.currentMural == mural) 403 { 404 crServerPerformMakeCurrent( mural, cr_server.currentCtxInfo ); 406 405 } 407 406 } … … 433 432 434 433 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 435 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, NULL, NULL);434 crServerVBoxCompositionDisable(mural); 436 435 } 437 436 … … 443 442 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 444 443 /* CrVrScrCompositorLock(&mural->Compositor); */ 445 CrVrScrCompositorEntryPosSet(&mural->Compositor, &mural->CEntry, &Pos); 444 /* no need to set position because the position is relative to window */ 445 /*CrVrScrCompositorEntryPosSet(&mural->Compositor, &mural->CEntry, &Pos);*/ 446 446 /*CrVrScrCompositorUnlock(&mural->Compositor);*/ 447 447 … … 454 454 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 455 455 { 456 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry);456 crServerVBoxCompositionReenable(mural); 457 457 } 458 458 } … … 481 481 482 482 /* 1. tell renderspu to stop using the current compositor (see above comment) */ 483 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, NULL, NULL);483 crServerVBoxCompositionDisable(mural); 484 484 } 485 485 … … 521 521 if (mural->fUseFBO != CR_SERVER_REDIR_NONE) 522 522 { 523 cr _server.head_spu->dispatch_table.VBoxPresentComposition(mural->spuWindow, &mural->Compositor, &mural->CEntry);523 crServerVBoxCompositionReenable(mural); 524 524 } 525 525 }
Note:
See TracChangeset
for help on using the changeset viewer.