- Timestamp:
- May 11, 2012 4:39:12 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r41128 r41258 105 105 char *pszDpyName; 106 106 GLint visualBits; 107 int32_t internalID;107 int32_t externalID; 108 108 } CRCreateInfo_t; 109 109 … … 183 183 GLboolean bIsInLoadingState; /* Indicates if we're in process of loading VM snapshot */ 184 184 GLboolean bIsInSavingState; /* Indicates if we're in process of saving VM snapshot */ 185 GLboolean bForceMakeCurrentOnClientSwitch; 185 186 CRContextInfo *currentCtxInfo; 186 187 GLint currentWindow; -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_framebuffer.c
r41160 r41258 804 804 crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idFBO) 805 805 { 806 GL boolean fAdjustDrawReadBuffers = GL_FALSE;806 GLuint idReadBuffer = 0, idDrawBuffer = 0; 807 807 808 808 if ((fromCtx->framebufferobject.drawFB) /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ … … 810 810 { 811 811 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, toCtx->framebufferobject.drawFB->hwid); 812 fAdjustDrawReadBuffers = GL_TRUE;812 idDrawBuffer = toCtx->framebufferobject.drawFB->drawbuffer[0]; 813 813 } 814 814 else if (idFBO && !toCtx->framebufferobject.drawFB) 815 815 { 816 816 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, idFBO); 817 fAdjustDrawReadBuffers = GL_TRUE;817 idDrawBuffer = GL_COLOR_ATTACHMENT0; 818 818 } 819 819 … … 822 822 { 823 823 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, toCtx->framebufferobject.readFB->hwid); 824 fAdjustDrawReadBuffers = GL_TRUE;824 idReadBuffer = toCtx->framebufferobject.readFB->readbuffer; 825 825 } 826 826 else if (idFBO && !toCtx->framebufferobject.readFB) 827 827 { 828 828 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, idFBO); 829 fAdjustDrawReadBuffers = GL_TRUE; 830 } 831 832 if (fAdjustDrawReadBuffers) 833 { 834 diff_api.DrawBuffer(toCtx->framebufferobject.drawFB?toCtx->framebufferobject.drawFB->drawbuffer[0]:toCtx->buffer.drawBuffer); 835 diff_api.ReadBuffer(toCtx->framebufferobject.readFB?toCtx->framebufferobject.readFB->readbuffer:toCtx->buffer.readBuffer); 836 } 829 idReadBuffer = GL_COLOR_ATTACHMENT0; 830 } 831 832 if (idDrawBuffer) 833 diff_api.DrawBuffer(idDrawBuffer); 834 if (idReadBuffer) 835 diff_api.ReadBuffer(idReadBuffer); 837 836 838 837 if (fromCtx->framebufferobject.renderbuffer /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r41160 r41258 123 123 pContextInfo->pContext = newCtx; 124 124 pContextInfo->CreateInfo.visualBits = visualBits; 125 pContextInfo->CreateInfo. internalID = newCtx->id;125 pContextInfo->CreateInfo.externalID = retVal; 126 126 pContextInfo->CreateInfo.pszDpyName = dpyName ? crStrdup(dpyName) : NULL; 127 127 crHashtableAdd(cr_server.contextTable, retVal, pContextInfo); … … 268 268 } 269 269 270 271 270 void SERVER_DISPATCH_APIENTRY 272 271 crServerDispatchMakeCurrent( GLint window, GLint nativeWindow, GLint context ) … … 292 291 } 293 292 else { 293 #if 0 294 294 oldMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, cr_server.currentWindow); 295 295 if (oldMural && oldMural->bUseFBO && crServerSupportRedirMuralFBO()) … … 308 308 window = -1; 309 309 mural = NULL; 310 #endif 311 cr_server.bForceMakeCurrentOnClientSwitch = GL_TRUE; 310 312 return; 311 313 } 314 315 cr_server.bForceMakeCurrentOnClientSwitch = GL_FALSE; 312 316 313 317 ctx = ctxInfo->pContext; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r41128 r41258 288 288 cr_server.firstCallCreateContext = GL_TRUE; 289 289 cr_server.firstCallMakeCurrent = GL_TRUE; 290 cr_server.bForceMakeCurrentOnClientSwitch = GL_FALSE; 290 291 291 292 /* … … 360 361 cr_server.bIsInLoadingState = GL_FALSE; 361 362 cr_server.bIsInSavingState = GL_FALSE; 362 363 cr_server.bForceMakeCurrentOnClientSwitch = GL_FALSE; 363 364 364 365 cr_server.pCleanupClient = NULL; … … 728 729 { 729 730 CRContextInfo *pContextInfo = (CRContextInfo *)data1; 730 CRCreateInfo_t *pCreateInfo = &pContextInfo->CreateInfo; 731 crVBoxServerSaveCreateInfoCB(key, pCreateInfo, data2); 731 CRCreateInfo_t CreateInfo = pContextInfo->CreateInfo; 732 /* saved state contains internal id */ 733 CreateInfo.externalID = pContextInfo->pContext->id; 734 crVBoxServerSaveCreateInfoCB(key, &CreateInfo, data2); 732 735 } 733 736 … … 966 969 } 967 970 968 ctxID = crServerDispatchCreateContextEx(createInfo.pszDpyName, createInfo.visualBits, 0, key, createInfo. internalID);971 ctxID = crServerDispatchCreateContextEx(createInfo.pszDpyName, createInfo.visualBits, 0, key, createInfo.externalID /* <-saved state stores internal id here*/); 969 972 CRASSERT((int64_t)ctxID == (int64_t)key); 970 973 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r41109 r41258 284 284 #endif 285 285 286 # ifdef DEBUG_misha 287 # define CR_CHECK_BLITS 288 # include <iprt/assert.h> 289 # undef CRASSERT /* iprt assert's int3 are inlined that is why are more convenient to use since they can be easily disabled individually */ 290 # define CRASSERT Assert 291 # endif 292 293 286 294 void SERVER_DISPATCH_APIENTRY 287 295 crServerDispatchCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) … … 508 516 } 509 517 518 #ifdef CR_CHECK_BLITS 519 void crDbgFree(void *pvData) 520 { 521 crFree(pvData); 522 } 523 524 void crDbgGetTexImage2D(GLint texTarget, GLint texName, GLvoid **ppvImage, GLint *pw, GLint *ph) 525 { 526 SPUDispatchTable *gl = &cr_server.head_spu->dispatch_table; 527 GLint ppb, pub, dstw, dsth, otex; 528 GLint pa, pr, psp, psr, ua, ur, usp, usr; 529 GLvoid *pvImage; 530 GLint rfb, dfb, rb, db; 531 532 gl->GetIntegerv(GL_READ_FRAMEBUFFER_BINDING_EXT, &rfb); 533 gl->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT, &dfb); 534 gl->GetIntegerv(GL_READ_BUFFER, &rb); 535 gl->GetIntegerv(GL_DRAW_BUFFER, &db); 536 537 gl->BindFramebufferEXT(GL_READ_FRAMEBUFFER_BINDING_EXT, 0); 538 gl->BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_BINDING_EXT, 0); 539 gl->ReadBuffer(GL_BACK); 540 gl->DrawBuffer(GL_BACK); 541 542 gl->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &ppb); 543 gl->GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &pub); 544 gl->GetIntegerv(GL_TEXTURE_BINDING_2D, &otex); 545 546 gl->GetIntegerv(GL_PACK_ROW_LENGTH, &pr); 547 gl->GetIntegerv(GL_PACK_ALIGNMENT, &pa); 548 gl->GetIntegerv(GL_PACK_SKIP_PIXELS, &psp); 549 gl->GetIntegerv(GL_PACK_SKIP_ROWS, &psr); 550 551 gl->GetIntegerv(GL_UNPACK_ROW_LENGTH, &ur); 552 gl->GetIntegerv(GL_UNPACK_ALIGNMENT, &ua); 553 gl->GetIntegerv(GL_UNPACK_SKIP_PIXELS, &usp); 554 gl->GetIntegerv(GL_UNPACK_SKIP_ROWS, &usr); 555 556 gl->BindTexture(texTarget, texName); 557 gl->GetTexLevelParameteriv(texTarget, 0, GL_TEXTURE_WIDTH, &dstw); 558 gl->GetTexLevelParameteriv(texTarget, 0, GL_TEXTURE_HEIGHT, &dsth); 559 560 gl->PixelStorei(GL_PACK_ROW_LENGTH, 0); 561 gl->PixelStorei(GL_PACK_ALIGNMENT, 1); 562 gl->PixelStorei(GL_PACK_SKIP_PIXELS, 0); 563 gl->PixelStorei(GL_PACK_SKIP_ROWS, 0); 564 565 gl->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); 566 gl->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 567 gl->PixelStorei(GL_UNPACK_SKIP_PIXELS, 0); 568 gl->PixelStorei(GL_UNPACK_SKIP_ROWS, 0); 569 570 gl->BindBufferARB(GL_PIXEL_PACK_BUFFER, 0); 571 gl->BindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0); 572 573 pvImage = crAlloc(4*dstw*dsth); 574 gl->GetTexImage(texTarget, 0, GL_BGRA, GL_UNSIGNED_BYTE, pvImage); 575 576 gl->BindTexture(texTarget, otex); 577 578 gl->PixelStorei(GL_PACK_ROW_LENGTH, pr); 579 gl->PixelStorei(GL_PACK_ALIGNMENT, pa); 580 gl->PixelStorei(GL_PACK_SKIP_PIXELS, psp); 581 gl->PixelStorei(GL_PACK_SKIP_ROWS, psr); 582 583 gl->PixelStorei(GL_UNPACK_ROW_LENGTH, ur); 584 gl->PixelStorei(GL_UNPACK_ALIGNMENT, ua); 585 gl->PixelStorei(GL_UNPACK_SKIP_PIXELS, usp); 586 gl->PixelStorei(GL_UNPACK_SKIP_ROWS, usr); 587 588 gl->BindBufferARB(GL_PIXEL_PACK_BUFFER, ppb); 589 gl->BindBufferARB(GL_PIXEL_UNPACK_BUFFER, pub); 590 591 gl->BindFramebufferEXT(GL_READ_FRAMEBUFFER_BINDING_EXT, rfb); 592 gl->BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_BINDING_EXT, dfb); 593 gl->ReadBuffer(rb); 594 gl->DrawBuffer(db); 595 596 *ppvImage = pvImage; 597 *pw = dstw; 598 *ph = dsth; 599 } 600 601 DECLEXPORT(void) crDbgPrint(const char *format, ... ) 602 { 603 va_list args; 604 static char txt[8092]; 605 606 va_start( args, format ); 607 vsprintf( txt, format, args ); 608 609 OutputDebugString(txt); 610 } 611 612 void crDbgDumpImage2D(const char* pszDesc, const void *pvData, uint32_t width, uint32_t height, uint32_t bpp, uint32_t pitch) 613 { 614 crDbgPrint("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">%s</exec>, ( !vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d )\n", 615 pvData, width, height, bpp, pitch, 616 pszDesc, 617 pvData, width, height, bpp, pitch); 618 } 619 620 void crDbgDumpTexImage2D(const char* pszDesc, GLint texTarget, GLint texName, GLboolean fBreak) 621 { 622 GLvoid *pvImage; 623 GLint w, h; 624 crDbgGetTexImage2D(texTarget, texName, &pvImage, &w, &h); 625 crDbgPrint("%s target(%d), name(%d), width(%d), height(%d)", pszDesc, texTarget, texName, w, h); 626 crDbgDumpImage2D("texture data", pvImage, w, h, 32, (32 * w)/8); 627 if (fBreak) 628 { 629 CRASSERT(0); 630 } 631 crDbgFree(pvImage); 632 } 633 #endif 634 510 635 void SERVER_DISPATCH_APIENTRY 511 636 crServerDispatchBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, … … 513 638 GLbitfield mask, GLenum filter) 514 639 { 640 #ifdef CR_CHECK_BLITS 641 // { 642 SPUDispatchTable *gl = &cr_server.head_spu->dispatch_table; 643 GLint rfb=0, dfb=0, dtex=0, dlev=-1, rtex=0, rlev=-1, rb=0, db=0, ppb=0, pub=0, vp[4], otex, dstw, dsth; 644 GLint sdtex=0, srtex=0; 645 GLenum dStatus, rStatus; 646 CRContext *ctx = crStateGetCurrent(); 647 648 CRTextureObj *tobj = 0; 649 CRTextureLevel *tl = 0; 650 GLint id, tuId, pbufId, pbufIdHw, ubufId, ubufIdHw, width, height, depth; 651 652 crDebug("===StateTracker==="); 653 crDebug("Current TU: %i", ctx->texture.curTextureUnit); 654 655 tobj = ctx->texture.unit[ctx->texture.curTextureUnit].currentTexture2D; 656 CRASSERT(tobj); 657 tl = &tobj->level[0][0]; 658 crDebug("Texture %i(hw %i), w=%i, h=%i", tobj->id, tobj->hwid, tl->width, tl->height, tl->depth); 659 660 if (crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB)) 661 { 662 pbufId = ctx->bufferobject.packBuffer->hwid; 663 } 664 else 665 { 666 pbufId = 0; 667 } 668 crDebug("Pack BufferId %i", pbufId); 669 670 if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 671 { 672 ubufId = ctx->bufferobject.unpackBuffer->hwid; 673 } 674 else 675 { 676 ubufId = 0; 677 } 678 crDebug("Unpack BufferId %i", ubufId); 679 680 crDebug("===GPU==="); 681 cr_server.head_spu->dispatch_table.GetIntegerv(GL_ACTIVE_TEXTURE, &tuId); 682 crDebug("Current TU: %i", tuId - GL_TEXTURE0_ARB); 683 CRASSERT(tuId - GL_TEXTURE0_ARB == ctx->texture.curTextureUnit); 684 685 cr_server.head_spu->dispatch_table.GetIntegerv(GL_TEXTURE_BINDING_2D, &id); 686 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); 687 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); 688 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_DEPTH, &depth); 689 crDebug("Texture: %i, w=%i, h=%i, d=%i", id, width, height, depth); 690 CRASSERT(id == tobj->hwid); 691 CRASSERT(width == tl->width); 692 CRASSERT(height == tl->height); 693 CRASSERT(depth == tl->depth); 694 695 cr_server.head_spu->dispatch_table.GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &pbufIdHw); 696 crDebug("Hw Pack BufferId %i", pbufIdHw); 697 CRASSERT(pbufIdHw == pbufId); 698 699 cr_server.head_spu->dispatch_table.GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &ubufIdHw); 700 crDebug("Hw Unpack BufferId %i", ubufIdHw); 701 CRASSERT(ubufIdHw == ubufId); 702 703 gl->GetIntegerv(GL_READ_FRAMEBUFFER_BINDING_EXT, &rfb); 704 gl->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT, &dfb); 705 gl->GetIntegerv(GL_READ_BUFFER, &rb); 706 gl->GetIntegerv(GL_DRAW_BUFFER, &db); 707 708 gl->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &ppb); 709 gl->GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &pub); 710 711 gl->GetIntegerv(GL_VIEWPORT, &vp[0]); 712 713 gl->GetIntegerv(GL_TEXTURE_BINDING_2D, &otex); 714 715 gl->GetFramebufferAttachmentParameterivEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT, &dtex); 716 gl->GetFramebufferAttachmentParameterivEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT, &dlev); 717 dStatus = gl->CheckFramebufferStatusEXT(GL_DRAW_FRAMEBUFFER_EXT); 718 719 gl->GetFramebufferAttachmentParameterivEXT(GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT, &rtex); 720 gl->GetFramebufferAttachmentParameterivEXT(GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT, &rlev); 721 rStatus = gl->CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER_EXT); 722 723 if (dtex) 724 { 725 CRASSERT(!dlev); 726 } 727 728 if (rtex) 729 { 730 CRASSERT(!rlev); 731 } 732 733 if (ctx->framebufferobject.drawFB) 734 { 735 CRASSERT(dfb); 736 CRASSERT(ctx->framebufferobject.drawFB->hwid == dfb); 737 CRASSERT(ctx->framebufferobject.drawFB->drawbuffer[0] == db); 738 739 CRASSERT(dStatus==GL_FRAMEBUFFER_COMPLETE_EXT); 740 CRASSERT(db==GL_COLOR_ATTACHMENT0_EXT); 741 742 CRASSERT(ctx->framebufferobject.drawFB->color[0].type == GL_TEXTURE); 743 CRASSERT(ctx->framebufferobject.drawFB->color[0].level == 0); 744 sdtex = ctx->framebufferobject.drawFB->color[0].name; 745 sdtex = crStateGetTextureHWID(sdtex); 746 747 CRASSERT(sdtex); 748 } 749 else 750 { 751 CRASSERT(!dfb); 752 } 753 754 if (ctx->framebufferobject.readFB) 755 { 756 CRASSERT(rfb); 757 CRASSERT(ctx->framebufferobject.readFB->hwid == rfb); 758 CRASSERT(ctx->framebufferobject.readFB->readbuffer == rb); 759 760 CRASSERT(rStatus==GL_FRAMEBUFFER_COMPLETE_EXT); 761 CRASSERT(rb==GL_COLOR_ATTACHMENT0_EXT); 762 763 CRASSERT(ctx->framebufferobject.readFB->color[0].type == GL_TEXTURE); 764 CRASSERT(ctx->framebufferobject.readFB->color[0].level == 0); 765 srtex = ctx->framebufferobject.readFB->color[0].name; 766 srtex = crStateGetTextureHWID(srtex); 767 768 CRASSERT(srtex); 769 } 770 else 771 { 772 CRASSERT(!rfb); 773 } 774 775 CRASSERT(sdtex == dtex); 776 CRASSERT(srtex == rtex); 777 778 // crDbgDumpTexImage2D("==> src tex:", GL_TEXTURE_2D, rtex, true); 779 // crDbgDumpTexImage2D("==> dst tex:", GL_TEXTURE_2D, dtex, true); 780 781 // } 782 #endif 515 783 #ifdef CR_DUMP_BLITS 516 784 SPUDispatchTable *gl = &cr_server.head_spu->dispatch_table; … … 586 854 mask, filter); 587 855 856 //#ifdef CR_CHECK_BLITS 857 // crDbgDumpTexImage2D("<== src tex:", GL_TEXTURE_2D, rtex, true); 858 // crDbgDumpTexImage2D("<== dst tex:", GL_TEXTURE_2D, dtex, true); 859 //#endif 588 860 #ifdef CR_DUMP_BLITS 589 861 gl->BindTexture(GL_TEXTURE_2D, dtex); … … 595 867 #endif 596 868 } 869 870 void SERVER_DISPATCH_APIENTRY crServerDispatchDrawBuffer( GLenum mode ) 871 { 872 crStateDrawBuffer( mode ); 873 874 if (cr_server.curClient->currentMural->bUseFBO && crServerIsRedirectedToFBO() 875 && cr_server.curClient->currentMural->idFBO 876 && !crStateGetCurrent()->framebufferobject.drawFB) 877 { 878 switch (mode) 879 { 880 case GL_BACK: 881 case GL_BACK_LEFT: 882 mode = GL_COLOR_ATTACHMENT0; 883 break; 884 case GL_FRONT: 885 case GL_FRONT_LEFT: 886 crWarning("GL_FRONT not supported for FBO mode! (0x%x)", mode); 887 mode = GL_COLOR_ATTACHMENT0; 888 break; 889 default: 890 crWarning("unexpected mode! 0x%x", mode); 891 break; 892 } 893 } 894 895 #ifdef DEBUG_misha 896 cr_server.head_spu->dispatch_table.GetError(); 897 #endif 898 cr_server.head_spu->dispatch_table.DrawBuffer( mode ); 899 #ifdef DEBUG_misha 900 { 901 GLint db = 0; 902 GLenum err = cr_server.head_spu->dispatch_table.GetError(); 903 cr_server.head_spu->dispatch_table.GetIntegerv(GL_DRAW_BUFFER, &db); 904 Assert(db == mode); 905 } 906 #endif 907 } 908 909 void SERVER_DISPATCH_APIENTRY crServerDispatchReadBuffer( GLenum mode ) 910 { 911 crStateReadBuffer( mode ); 912 913 if (cr_server.curClient->currentMural->bUseFBO && crServerIsRedirectedToFBO() 914 && cr_server.curClient->currentMural->idFBO 915 && !crStateGetCurrent()->framebufferobject.readFB) 916 { 917 switch (mode) 918 { 919 case GL_BACK: 920 case GL_BACK_LEFT: 921 mode = GL_COLOR_ATTACHMENT0; 922 break; 923 case GL_FRONT: 924 case GL_FRONT_LEFT: 925 crWarning("GL_FRONT not supported for FBO mode!"); 926 mode = GL_COLOR_ATTACHMENT0; 927 break; 928 default: 929 crWarning("unexpected mode! 0x%x", mode); 930 break; 931 } 932 } 933 #ifdef DEBUG_misha 934 cr_server.head_spu->dispatch_table.GetError(); 935 #endif 936 cr_server.head_spu->dispatch_table.ReadBuffer( mode ); 937 #ifdef DEBUG_misha 938 { 939 GLint rb = 0; 940 GLenum err = cr_server.head_spu->dispatch_table.GetError(); 941 cr_server.head_spu->dispatch_table.GetIntegerv(GL_READ_BUFFER, &rb); 942 Assert(rb == mode); 943 } 944 #endif 945 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
r41160 r41258 167 167 else 168 168 { 169 if (!mural->bUseFBO) 170 { 171 crServerRedirMuralFBO(mural, GL_TRUE); 172 } 169 if (mural->spuWindow) 170 { 171 if (!mural->bUseFBO) 172 { 173 crServerRedirMuralFBO(mural, GL_TRUE); 174 } 175 else 176 { 177 if (mural->width!=mural->fboWidth 178 || mural->height!=mural->height) 179 { 180 crServerRedirMuralFBO(mural, GL_FALSE); 181 crServerDeleteMuralFBO(mural); 182 crServerRedirMuralFBO(mural, GL_TRUE); 183 } 184 } 185 } 186 #ifdef DEBUG_misha 173 187 else 174 188 { 175 if (mural->width!=mural->fboWidth 176 || mural->height!=mural->height) 177 { 178 crServerRedirMuralFBO(mural, GL_FALSE); 179 crServerDeleteMuralFBO(mural); 180 crServerRedirMuralFBO(mural, GL_TRUE); 181 } 182 } 189 Assert(!mural->bUseFBO); 190 } 191 #endif 183 192 184 193 if (!mural->bUseFBO) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py
r38142 r41258 76 76 CRASSERT(tablesize/sizeof(%s)==1); 77 77 fboid = crStateFBOHWIDtoID((GLuint) *get_values); 78 if (crServerIsRedirectedToFBO() 78 if (cr_server.curClient->currentMural->bUseFBO 79 && crServerIsRedirectedToFBO() 79 80 && fboid==cr_server.curClient->currentMural->idFBO) 80 81 { … … 82 83 } 83 84 *get_values = (%s) fboid; 85 } 86 else if (GL_READ_BUFFER==pname) 87 { 88 if (cr_server.curClient->currentMural->bUseFBO && crServerIsRedirectedToFBO() 89 && cr_server.curClient->currentMural->idFBO 90 && !crStateGetCurrent()->framebufferobject.readFB) 91 { 92 *get_values = (%s) crStateGetCurrent()->buffer.readBuffer; 93 } 94 } 95 else if (GL_DRAW_BUFFER==pname) 96 { 97 if (cr_server.curClient->currentMural->bUseFBO && crServerIsRedirectedToFBO() 98 && cr_server.curClient->currentMural->idFBO 99 && !crStateGetCurrent()->framebufferobject.drawFB) 100 { 101 *get_values = (%s) crStateGetCurrent()->buffer.drawBuffer; 102 } 84 103 } 85 104 else if (GL_RENDERBUFFER_BINDING_EXT==pname) … … 114 133 } 115 134 } 116 """ % (types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index] )135 """ % (types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index]) 117 136 print '\tcrServerReturnValue( get_values, tablesize );' 118 137 print '\tcrFree(get_values);' -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special
r34725 r41258 247 247 BlitFramebufferEXT 248 248 EndList 249 DrawBuffer 250 ReadBuffer -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c
r41253 r41258 546 546 CRContextInfo *clientCtxInfo = cr_server.curClient->currentCtxInfo; 547 547 if (clientCtxInfo != cr_server.currentCtxInfo 548 || clientWindow != cr_server.currentWindow) { 548 || clientWindow != cr_server.currentWindow 549 || cr_server.bForceMakeCurrentOnClientSwitch) { 549 550 crServerDispatchMakeCurrent(clientWindow, 0, clientContext); 550 551 /* -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r41139 r41258 274 274 275 275 cr_server.head_spu->dispatch_table.WindowSize(mural->spuWindow, width, height); 276 277 /* Work-around Intel driver bug */ 278 CRASSERT(cr_server.curClient->currentMural == mural); 279 if (cr_server.curClient->currentMural == mural) 280 { 281 CRContextInfo * ctxInfo = cr_server.currentCtxInfo; 282 CRASSERT(ctxInfo); 283 crServerDispatchMakeCurrent(mural->spuWindow, 0, ctxInfo->CreateInfo.externalID); 284 } 276 285 } 277 286
Note:
See TracChangeset
for help on using the changeset viewer.