Changeset 41160 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- May 4, 2012 9:55:53 AM (13 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r41128 r41160 219 219 DECLEXPORT(GLboolean) crStateEnableDiffOnMakeCurrent(GLboolean fEnable); 220 220 221 CRContext * crStateSwichPrepare(CRContext *toCtx );222 void crStateSwichPostprocess(CRContext *fromCtx );221 CRContext * crStateSwichPrepare(CRContext *toCtx, GLboolean fMultipleContexts, GLuint idFBO); 222 void crStateSwichPostprocess(CRContext *fromCtx, GLboolean fMultipleContexts, GLuint idFBO); 223 223 224 224 DECLEXPORT(void) crStateFlushFunc( CRStateFlushFunc ff ); -
trunk/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h
r41057 r41160 75 75 DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectSwitch(CRContext *from, CRContext *to); 76 76 77 DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDisableHW(CRContext *ctx );78 DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx );77 DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDisableHW(CRContext *ctx, GLuint idFBO); 78 DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idFBO); 79 79 80 80 DECLEXPORT(GLuint) STATE_APIENTRY crStateGetFramebufferHWID(GLuint id); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_diff.c
r39815 r41160 346 346 } 347 347 348 CRContext * crStateSwichPrepare(CRContext *toCtx )348 CRContext * crStateSwichPrepare(CRContext *toCtx, GLboolean fMultipleContexts, GLuint idFBO) 349 349 { 350 350 CRContext *fromCtx = GetCurrentContext(); 351 351 352 if (!fMultipleContexts) 353 { 352 354 #ifdef CR_EXT_framebuffer_object 353 if (fromCtx)354 crStateFramebufferObjectDisableHW(fromCtx);355 #endif 356 355 if (fromCtx) 356 crStateFramebufferObjectDisableHW(fromCtx, idFBO); 357 #endif 358 } 357 359 return fromCtx; 358 360 } 359 361 360 void crStateSwichPostprocess(CRContext *fromCtx )362 void crStateSwichPostprocess(CRContext *fromCtx, GLboolean fMultipleContexts, GLuint idFBO) 361 363 { 362 364 CRContext *toCtx = GetCurrentContext();; … … 364 366 return; 365 367 368 if (!fMultipleContexts) 369 { 366 370 #ifdef CR_EXT_framebuffer_object 367 crStateFramebufferObjectReenableHW(fromCtx, toCtx); 368 #endif 369 } 371 crStateFramebufferObjectReenableHW(fromCtx, toCtx, idFBO); 372 #endif 373 } 374 } -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_framebuffer.c
r41057 r41160 775 775 776 776 DECLEXPORT(void) STATE_APIENTRY 777 crStateFramebufferObjectDisableHW(CRContext *ctx )777 crStateFramebufferObjectDisableHW(CRContext *ctx, GLuint idFBO) 778 778 { 779 779 GLboolean fAdjustDrawReadBuffers = GL_FALSE; 780 780 781 if (ctx->framebufferobject.drawFB )781 if (ctx->framebufferobject.drawFB || idFBO) 782 782 { 783 783 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, 0); … … 785 785 } 786 786 787 if (ctx->framebufferobject.readFB )787 if (ctx->framebufferobject.readFB ||idFBO) 788 788 { 789 789 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, 0); … … 802 802 803 803 DECLEXPORT(void) STATE_APIENTRY 804 crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx )804 crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idFBO) 805 805 { 806 806 GLboolean fAdjustDrawReadBuffers = GL_FALSE; 807 807 808 if ( fromCtx->framebufferobject.drawFB/* <- the FBO state was reset in crStateFramebufferObjectDisableHW */809 && fromCtx->framebufferobject.drawFB == toCtx->framebufferobject.drawFB) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */808 if ((fromCtx->framebufferobject.drawFB) /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ 809 && fromCtx->framebufferobject.drawFB == toCtx->framebufferobject.drawFB) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */ 810 810 { 811 811 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, toCtx->framebufferobject.drawFB->hwid); 812 812 fAdjustDrawReadBuffers = GL_TRUE; 813 813 } 814 815 if (fromCtx->framebufferobject.readFB /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ 814 else if (idFBO && !toCtx->framebufferobject.drawFB) 815 { 816 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, idFBO); 817 fAdjustDrawReadBuffers = GL_TRUE; 818 } 819 820 if ((fromCtx->framebufferobject.readFB) /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ 816 821 && fromCtx->framebufferobject.readFB == toCtx->framebufferobject.readFB) /* .. and it was NOT restored properly in crStateFramebufferObjectSwitch */ 817 822 { 818 823 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, toCtx->framebufferobject.readFB->hwid); 824 fAdjustDrawReadBuffers = GL_TRUE; 825 } 826 else if (idFBO && !toCtx->framebufferobject.readFB) 827 { 828 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, idFBO); 819 829 fAdjustDrawReadBuffers = GL_TRUE; 820 830 }
Note:
See TracChangeset
for help on using the changeset viewer.