Changeset 45009 in vbox for trunk/src/VBox/HostServices/SharedOpenGL
- Timestamp:
- Mar 12, 2013 5:27:04 PM (12 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.