- Timestamp:
- Dec 21, 2012 12:02:47 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82932
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r44108 r44196 226 226 DECLEXPORT(GLboolean) crStateEnableDiffOnMakeCurrent(GLboolean fEnable); 227 227 228 void crStateSwichPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 229 void crStateSwichPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 228 void crStateSwitchPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 229 void crStateSwitchPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); 230 231 void crStateSyncHWErrorState(CRContext *ctx); 230 232 231 233 DECLEXPORT(void) crStateFlushFunc( CRStateFlushFunc ff ); -
trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h
r43349 r44196 9 9 10 10 #define SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS 28 11 /* version which might have context usage bits saved */ 12 #define SHCROGL_SSM_VERSION_WITH_SAVED_CTXUSAGE_BITS SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS 11 13 #define SHCROGL_SSM_VERSION_BEFORE_FRONT_DRAW_TRACKING 29 12 #define SHCROGL_SSM_VERSION 30 14 /* version that might have corrupted state data */ 15 #define SHCROGL_SSM_VERSION_WITH_CORUPTED_STATE 30 16 /* version with invalid glGetError state */ 17 #define SHCROGL_SSM_VERSION_WITH_INVALID_ERROR_STATE 30 18 #define SHCROGL_SSM_VERSION 31 13 19 14 20 /* These define the Chromium release number. -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_diff.c
r43980 r44196 346 346 } 347 347 348 void crStateSwichPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 349 { 348 void crStateSyncHWErrorState(CRContext *ctx) 349 { 350 GLenum err; 351 while ((err = diff_api.GetError()) != GL_NO_ERROR) 352 { 353 if (ctx->error != GL_NO_ERROR) 354 ctx->error = err; 355 } 356 } 357 358 void crStateSwitchPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 359 { 360 if (!fromCtx) 361 return; 362 363 if (g_bVBoxEnableDiffOnMakeCurrent && toCtx && toCtx != fromCtx) 364 crStateSyncHWErrorState(fromCtx); 365 350 366 #ifdef CR_EXT_framebuffer_object 351 if (fromCtx) 352 crStateFramebufferObjectDisableHW(fromCtx, idDrawFBO, idReadFBO); 353 #endif 354 } 355 356 void crStateSwichPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 357 { 358 if (!fromCtx || !toCtx) 367 crStateFramebufferObjectDisableHW(fromCtx, idDrawFBO, idReadFBO); 368 #endif 369 } 370 371 void crStateSwitchPostprocess(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO) 372 { 373 if (!toCtx) 359 374 return; 360 375 376 if (g_bVBoxEnableDiffOnMakeCurrent && fromCtx && toCtx != fromCtx) 377 { 378 GLenum err; 379 while ((err = diff_api.GetError()) != GL_NO_ERROR) 380 { 381 crWarning("gl error (0x%x) after context switch, ignoring..", err); 382 } 383 } 361 384 #ifdef CR_EXT_framebuffer_object 362 385 crStateFramebufferObjectReenableHW(fromCtx, toCtx, idDrawFBO, idReadFBO); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_error.c
r31487 r44196 19 19 va_list args; 20 20 21 g->error = error;21 CRASSERT(error != GL_NO_ERROR); 22 22 23 if (g->error == GL_NO_ERROR) 24 g->error = error; 25 26 #ifndef DEBUG_misha 23 27 if (crGetenv("CR_DEBUG")) 28 #endif 24 29 { 25 30 char *glerr; -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_framebuffer.c
r44125 r44196 1074 1074 { 1075 1075 GLuint idReadBuffer = 0, idDrawBuffer = 0; 1076 if (!fromCtx) 1077 fromCtx = toCtx; /* <- in case fromCtx is zero, set it to toCtx to ensure framebuffer state gets re-enabled correctly */ 1076 1078 1077 1079 if ((fromCtx->framebufferobject.drawFB) /* <- the FBO state was reset in crStateFramebufferObjectDisableHW */ -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_polygon.c
r27091 r44196 181 181 if (!p && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 182 182 { 183 crStateError(__LINE__, __FILE__, GL_NO_ERROR, 184 "Void pointer passed to PolygonStipple"); 183 crDebug("Void pointer passed to PolygonStipple"); 185 184 return; 186 185 } -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c
r44048 r44196 1322 1322 CRASSERT(VBoxTlsRefIsFunctional(pContext)); 1323 1323 1324 /* do not increment the saved state version due to VBOXTLSREFDATA addition to CRContext */ 1325 rc = SSMR3PutMem(pSSM, pContext, VBOXTLSREFDATA_OFFSET(CRContext)); 1326 AssertRCReturn(rc, rc); 1327 1328 /* now store bitid & neg_bitid */ 1329 rc = SSMR3PutMem(pSSM, pContext->bitid, sizeof (pContext->bitid) + sizeof (pContext->neg_bitid)); 1330 AssertRCReturn(rc, rc); 1331 1332 /* the pre-VBOXTLSREFDATA CRContext structure might have additional allignment bits before the CRContext::shared */ 1333 ui32 = VBOXTLSREFDATA_OFFSET(CRContext) + sizeof (pContext->bitid) + sizeof (pContext->neg_bitid); 1334 ui32 &= (sizeof (void*) - 1); 1335 if (ui32) 1336 { 1337 void* pTmp = NULL; 1338 rc = SSMR3PutMem(pSSM, &pTmp, ui32); 1339 AssertRCReturn(rc, rc); 1340 } 1341 1342 rc = SSMR3PutMem(pSSM, &pContext->shared, sizeof (CRContext) - RT_OFFSETOF(CRContext, shared)); 1324 /* make sure the gl error state is captured by our state mechanism to store the correct gl error value */ 1325 crStateSyncHWErrorState(pContext); 1326 1327 rc = SSMR3PutMem(pSSM, pContext, sizeof (*pContext)); 1343 1328 AssertRCReturn(rc, rc); 1344 1329 … … 1712 1697 unsigned long key; 1713 1698 GLboolean bLoadShared = GL_TRUE; 1714 union { 1715 CRbitvalue bitid[CR_MAX_BITARRAY]; 1716 struct { 1717 VBOXTLSREFDATA 1718 } tlsRef; 1719 } bitid; 1699 GLenum err; 1720 1700 1721 1701 CRASSERT(pContext && pSSM); … … 1728 1708 CRASSERT(VBoxTlsRefIsFunctional(pContext)); 1729 1709 1730 /* do not increment the saved state version due to VBOXTLSREFDATA addition to CRContext */ 1731 rc = SSMR3GetMem(pSSM, pTmpContext, VBOXTLSREFDATA_OFFSET(CRContext)); 1732 AssertRCReturn(rc, rc); 1733 1734 /* VBox 4.1.8 had a bug that VBOXTLSREFDATA was also stored in the snapshot, 1735 * thus the saved state data format was changed w/o changing the saved state version. 1736 * here we determine whether the saved state contains VBOXTLSREFDATA, and if so, treat it accordingly */ 1737 rc = SSMR3GetMem(pSSM, &bitid, sizeof (bitid)); 1738 AssertRCReturn(rc, rc); 1739 1740 /* the bitid array has one bit set only. this is why if bitid.tlsRef has both cTlsRefs 1741 * and enmTlsRefState non-zero - this is definitely NOT a bit id and is a VBOXTLSREFDATA */ 1742 if (bitid.tlsRef.enmTlsRefState == VBOXTLSREFDATA_STATE_INITIALIZED 1743 && bitid.tlsRef.cTlsRefs) 1744 { 1745 /* VBOXTLSREFDATA is stored, skip it */ 1746 crMemcpy(&pTmpContext->bitid, ((uint8_t*)&bitid) + VBOXTLSREFDATA_SIZE(), sizeof (bitid) - VBOXTLSREFDATA_SIZE()); 1747 rc = SSMR3GetMem(pSSM, ((uint8_t*)&pTmpContext->bitid) + sizeof (pTmpContext->bitid) - VBOXTLSREFDATA_SIZE(), sizeof (pTmpContext->neg_bitid) + VBOXTLSREFDATA_SIZE()); 1748 AssertRCReturn(rc, rc); 1749 1750 ui = VBOXTLSREFDATA_OFFSET(CRContext) + VBOXTLSREFDATA_SIZE() + sizeof (pTmpContext->bitid) + sizeof (pTmpContext->neg_bitid); 1751 ui = RT_OFFSETOF(CRContext, shared) - ui; 1710 if (u32Version <= SHCROGL_SSM_VERSION_WITH_INVALID_ERROR_STATE) 1711 { 1712 union { 1713 CRbitvalue bitid[CR_MAX_BITARRAY]; 1714 struct { 1715 VBOXTLSREFDATA 1716 } tlsRef; 1717 } bitid; 1718 1719 /* do not increment the saved state version due to VBOXTLSREFDATA addition to CRContext */ 1720 rc = SSMR3GetMem(pSSM, pTmpContext, VBOXTLSREFDATA_OFFSET(CRContext)); 1721 AssertRCReturn(rc, rc); 1722 1723 /* VBox 4.1.8 had a bug that VBOXTLSREFDATA was also stored in the snapshot, 1724 * thus the saved state data format was changed w/o changing the saved state version. 1725 * here we determine whether the saved state contains VBOXTLSREFDATA, and if so, treat it accordingly */ 1726 rc = SSMR3GetMem(pSSM, &bitid, sizeof (bitid)); 1727 AssertRCReturn(rc, rc); 1728 1729 /* the bitid array has one bit set only. this is why if bitid.tlsRef has both cTlsRefs 1730 * and enmTlsRefState non-zero - this is definitely NOT a bit id and is a VBOXTLSREFDATA */ 1731 if (bitid.tlsRef.enmTlsRefState == VBOXTLSREFDATA_STATE_INITIALIZED 1732 && bitid.tlsRef.cTlsRefs) 1733 { 1734 /* VBOXTLSREFDATA is stored, skip it */ 1735 crMemcpy(&pTmpContext->bitid, ((uint8_t*)&bitid) + VBOXTLSREFDATA_SIZE(), sizeof (bitid) - VBOXTLSREFDATA_SIZE()); 1736 rc = SSMR3GetMem(pSSM, ((uint8_t*)&pTmpContext->bitid) + sizeof (pTmpContext->bitid) - VBOXTLSREFDATA_SIZE(), sizeof (pTmpContext->neg_bitid) + VBOXTLSREFDATA_SIZE()); 1737 AssertRCReturn(rc, rc); 1738 1739 ui = VBOXTLSREFDATA_OFFSET(CRContext) + VBOXTLSREFDATA_SIZE() + sizeof (pTmpContext->bitid) + sizeof (pTmpContext->neg_bitid); 1740 ui = RT_OFFSETOF(CRContext, shared) - ui; 1741 } 1742 else 1743 { 1744 /* VBOXTLSREFDATA is NOT stored */ 1745 crMemcpy(&pTmpContext->bitid, &bitid, sizeof (bitid)); 1746 rc = SSMR3GetMem(pSSM, &pTmpContext->neg_bitid, sizeof (pTmpContext->neg_bitid)); 1747 AssertRCReturn(rc, rc); 1748 1749 /* the pre-VBOXTLSREFDATA CRContext structure might have additional allignment bits before the CRContext::shared */ 1750 ui = VBOXTLSREFDATA_OFFSET(CRContext) + sizeof (pTmpContext->bitid) + sizeof (pTmpContext->neg_bitid); 1751 1752 ui &= (sizeof (void*) - 1); 1753 } 1754 1755 if (ui) 1756 { 1757 void* pTmp = NULL; 1758 rc = SSMR3GetMem(pSSM, &pTmp, ui); 1759 AssertRCReturn(rc, rc); 1760 } 1761 1762 if (u32Version == SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS) 1763 { 1764 SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, shared, attrib); 1765 rc = crStateLoadAttribState_v_BEFORE_CTXUSAGE_BITS(&pTmpContext->attrib, pSSM); 1766 AssertRCReturn(rc, rc); 1767 SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, attrib, buffer); 1768 SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, texture); 1769 rc = crStateLoadTextureState_v_BEFORE_CTXUSAGE_BITS(&pTmpContext->texture, pSSM); 1770 AssertRCReturn(rc, rc); 1771 SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, texture, transform); 1772 SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, transform); 1773 } 1774 else 1775 { 1776 SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, shared); 1777 } 1778 1779 pTmpContext->error = GL_NO_ERROR; /* <- the error state contained some random error data here 1780 * treat as no error */ 1752 1781 } 1753 1782 else 1754 1783 { 1755 /* VBOXTLSREFDATA is NOT stored */ 1756 crMemcpy(&pTmpContext->bitid, &bitid, sizeof (bitid)); 1757 rc = SSMR3GetMem(pSSM, &pTmpContext->neg_bitid, sizeof (pTmpContext->neg_bitid)); 1758 AssertRCReturn(rc, rc); 1759 1760 /* the pre-VBOXTLSREFDATA CRContext structure might have additional allignment bits before the CRContext::shared */ 1761 ui = VBOXTLSREFDATA_OFFSET(CRContext) + sizeof (pTmpContext->bitid) + sizeof (pTmpContext->neg_bitid); 1762 1763 ui &= (sizeof (void*) - 1); 1764 } 1765 1766 if (ui) 1767 { 1768 void* pTmp = NULL; 1769 rc = SSMR3GetMem(pSSM, &pTmp, ui); 1770 AssertRCReturn(rc, rc); 1771 } 1784 rc = SSMR3GetMem(pSSM, pTmpContext, sizeof (*pTmpContext)); 1785 AssertRCReturn(rc, rc); 1786 } 1787 1788 /* preserve the error to restore it at the end of context creation, 1789 * it should not normally change, but just in case it it changed */ 1790 err = pTmpContext->error; 1772 1791 1773 1792 /* we will later do crMemcpy from entire pTmpContext to pContext, 1774 1793 * for simplicity store the VBOXTLSREFDATA from the pContext to pTmpContext */ 1775 1794 VBOXTLSREFDATA_COPY(pTmpContext, pContext); 1776 1777 if (u32Version == SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS)1778 {1779 SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, shared, attrib);1780 rc = crStateLoadAttribState_v_BEFORE_CTXUSAGE_BITS(&pTmpContext->attrib, pSSM);1781 AssertRCReturn(rc, rc);1782 SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, attrib, buffer);1783 SHCROGL_GET_STRUCT_PART(pTmpContext, CRContext, buffer, texture);1784 rc = crStateLoadTextureState_v_BEFORE_CTXUSAGE_BITS(&pTmpContext->texture, pSSM);1785 AssertRCReturn(rc, rc);1786 SHCROGL_CUT_FIELD_ALIGNMENT(CRContext, texture, transform);1787 SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, transform);1788 }1789 else1790 {1791 SHCROGL_GET_STRUCT_TAIL(pTmpContext, CRContext, shared);1792 }1793 1795 1794 1796 /* Deal with shared state */ … … 2261 2263 AssertRCReturn(rc, rc); 2262 2264 2265 Assert(key == pFBO->id); 2266 2263 2267 crHashtableAdd(pContext->shared->fbTable, key, pFBO); 2264 2268 } … … 2457 2461 } 2458 2462 2463 if (pContext->error != err) 2464 { 2465 crWarning("context error state changed on context restore, was 0x%x, but became 0x%x, resetting to its original value", 2466 err, pContext->error); 2467 pContext->error = err; 2468 } 2459 2469 2460 2470 /*Mark all as dirty to make sure we'd restore correct context state*/ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_blitter.cpp
r43980 r44196 407 407 pBlitter->pRestoreCtxInfo->SpuContext >= 0 408 408 ? pBlitter->pRestoreCtxInfo->SpuContext : cr_server.MainContextInfo.SpuContext); 409 crStateSwi chPostprocess(pBlitter->pRestoreCtxInfo->pContext, pBlitter->pRestoreCtxInfo->pContext, idDrawFBO, idReadFBO);409 crStateSwitchPostprocess(pBlitter->pRestoreCtxInfo->pContext, NULL, idDrawFBO, idReadFBO); 410 410 } 411 411 else … … 448 448 idReadFBO = 0; 449 449 } 450 crStateSwi chPrepare(NULL, pRestoreCtxInfo->pContext, idDrawFBO, idReadFBO);450 crStateSwitchPrepare(NULL, pRestoreCtxInfo->pContext, idDrawFBO, idReadFBO); 451 451 452 452 cr_server.head_spu->dispatch_table.Flush(); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r43980 r44196 140 140 } 141 141 142 {143 /* As we're using only one host context to serve all client contexts, newly created context will still144 * hold last error value from any previous failed opengl call. Proper solution would be to redirect any145 * client glGetError calls to our state tracker, but right now it's missing quite a lot of checks and doesn't146 * reflect host driver/gpu specific issues. Thus we just reset last opengl error at context creation.147 */148 GLint err;149 150 err = cr_server.head_spu->dispatch_table.GetError();151 if (err!=GL_NO_ERROR)152 {153 #ifdef DEBUG_misha154 crDebug("Cleared gl error %#x on context creation", err);155 #else156 crWarning("Cleared gl error %#x on context creation", err);157 #endif158 }159 }160 161 142 crServerReturnValue( &retVal, sizeof(retVal) ); 162 143 … … 330 311 /* Ubuntu 11.04 hosts misbehave if context window switch is 331 312 * done with non-default framebuffer object settings. 332 * crStateSwi chPrepare & crStateSwichPostprocess are supposed to work around this problem333 * crStateSwi chPrepare restores the FBO state to its default values before the context window switch,334 * while crStateSwi chPostprocess restores it back to the original values */313 * crStateSwitchPrepare & crStateSwitchPostprocess are supposed to work around this problem 314 * crStateSwitchPrepare restores the FBO state to its default values before the context window switch, 315 * while crStateSwitchPostprocess restores it back to the original values */ 335 316 oldCtx = crStateGetCurrent(); 336 317 if (oldMural && oldMural->fUseFBO && crServerSupportRedirMuralFBO()) … … 344 325 idReadFBO = 0; 345 326 } 346 crStateSwi chPrepare(cr_server.bUseMultipleContexts ? NULL : ctx, oldCtx, idDrawFBO, idReadFBO);327 crStateSwitchPrepare(cr_server.bUseMultipleContexts ? NULL : ctx, oldCtx, idDrawFBO, idReadFBO); 347 328 348 329 /* … … 431 412 idReadFBO = 0; 432 413 } 433 crStateSwi chPostprocess(ctx, cr_server.bUseMultipleContexts ? ctx: oldCtx, idDrawFBO, idReadFBO);414 crStateSwitchPostprocess(ctx, cr_server.bUseMultipleContexts ? NULL : oldCtx, idDrawFBO, idReadFBO); 434 415 435 416 if (!ctx->framebufferobject.drawFB -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r43999 r44196 761 761 762 762 #ifdef CR_STATE_NO_TEXTURE_IMAGE_STORE 763 CRASSERT(cr_server.curClient); 763 764 if (cr_server.curClient) 764 765 { 765 unsigned long id; 766 if (!crHashtableGetDataKey(cr_server.contextTable, pContextInfo, &id)) 767 { 768 crWarning("No client id for server ctx %d", pContext->id); 769 } 770 else 771 { 772 crServerDispatchMakeCurrent(cr_server.curClient->currentWindow, 0, id); 773 } 766 # ifdef DEBUG_misha 767 { 768 unsigned long id; 769 if (!crHashtableGetDataKey(cr_server.contextTable, pContextInfo, &id)) 770 crWarning("No client id for server ctx %d", pContext->id); 771 else 772 CRASSERT(id == key); 773 } 774 # endif 775 crServerDispatchMakeCurrent(cr_server.curClient->currentWindow, 0, key); 774 776 } 775 777 #endif … … 778 780 CRASSERT(rc == VINF_SUCCESS); 779 781 } 782 783 #if 0 784 typedef struct CR_SERVER_CHECK_BUFFERS 785 { 786 CRBufferObject *obj; 787 CRContext *ctx; 788 }CR_SERVER_CHECK_BUFFERS, *PCR_SERVER_CHECK_BUFFERS; 789 790 static void crVBoxServerCheckConsistencyContextBuffersCB(unsigned long key, void *data1, void *data2) 791 { 792 CRContextInfo* pContextInfo = (CRContextInfo*)data1; 793 CRContext *ctx = pContextInfo->pContext; 794 PCR_SERVER_CHECK_BUFFERS pBuffers = (PCR_SERVER_CHECK_BUFFERS)data2; 795 CRBufferObject *obj = pBuffers->obj; 796 CRBufferObjectState *b = &(ctx->bufferobject); 797 int j, k; 798 799 if (obj == b->arrayBuffer) 800 { 801 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 802 pBuffers->ctx = ctx; 803 } 804 if (obj == b->elementsBuffer) 805 { 806 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 807 pBuffers->ctx = ctx; 808 } 809 #ifdef CR_ARB_pixel_buffer_object 810 if (obj == b->packBuffer) 811 { 812 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 813 pBuffers->ctx = ctx; 814 } 815 if (obj == b->unpackBuffer) 816 { 817 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 818 pBuffers->ctx = ctx; 819 } 820 #endif 821 822 #ifdef CR_ARB_vertex_buffer_object 823 for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j) 824 { 825 CRClientPointer *cp = crStateGetClientPointerByIndex(j, &ctx->client.array); 826 if (obj == cp->buffer) 827 { 828 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 829 pBuffers->ctx = ctx; 830 } 831 } 832 833 for (k=0; k<ctx->client.vertexArrayStackDepth; ++k) 834 { 835 CRVertexArrays *pArray = &ctx->client.vertexArrayStack[k]; 836 for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j) 837 { 838 CRClientPointer *cp = crStateGetClientPointerByIndex(j, pArray); 839 if (obj == cp->buffer) 840 { 841 Assert(!pBuffers->ctx || pBuffers->ctx == ctx); 842 pBuffers->ctx = ctx; 843 } 844 } 845 } 846 #endif 847 } 848 849 static void crVBoxServerCheckConsistencyBuffersCB(unsigned long key, void *data1, void *data2) 850 { 851 CRBufferObject *obj = (CRBufferObject *)data1; 852 CR_SERVER_CHECK_BUFFERS Buffers = {0}; 853 Buffers.obj = obj; 854 crHashtableWalk(cr_server.contextTable, crVBoxServerCheckConsistencyContextBuffersCB, (void*)&Buffers); 855 } 856 857 //static void crVBoxServerCheckConsistency2CB(unsigned long key, void *data1, void *data2) 858 //{ 859 // CRContextInfo* pContextInfo1 = (CRContextInfo*)data1; 860 // CRContextInfo* pContextInfo2 = (CRContextInfo*)data2; 861 // 862 // CRASSERT(pContextInfo1->pContext); 863 // CRASSERT(pContextInfo2->pContext); 864 // 865 // if (pContextInfo1 == pContextInfo2) 866 // { 867 // CRASSERT(pContextInfo1->pContext == pContextInfo2->pContext); 868 // return; 869 // } 870 // 871 // CRASSERT(pContextInfo1->pContext != pContextInfo2->pContext); 872 // CRASSERT(pContextInfo1->pContext->shared); 873 // CRASSERT(pContextInfo2->pContext->shared); 874 // CRASSERT(pContextInfo1->pContext->shared == pContextInfo2->pContext->shared); 875 // if (pContextInfo1->pContext->shared != pContextInfo2->pContext->shared) 876 // return; 877 // 878 // crHashtableWalk(pContextInfo1->pContext->shared->buffersTable, crVBoxServerCheckConsistencyBuffersCB, pContextInfo2); 879 //} 880 static void crVBoxServerCheckSharedCB(unsigned long key, void *data1, void *data2) 881 { 882 CRContextInfo* pContextInfo = (CRContextInfo*)data1; 883 void **ppShared = (void**)data2; 884 if (!*ppShared) 885 *ppShared = pContextInfo->pContext->shared; 886 else 887 Assert(pContextInfo->pContext->shared == *ppShared); 888 } 889 890 static void crVBoxServerCheckConsistency() 891 { 892 CRSharedState *pShared = NULL; 893 crHashtableWalk(cr_server.contextTable, crVBoxServerCheckSharedCB, (void*)&pShared); 894 Assert(pShared); 895 if (pShared) 896 { 897 crHashtableWalk(pShared->buffersTable, crVBoxServerCheckConsistencyBuffersCB, NULL); 898 } 899 } 900 #endif 780 901 781 902 static uint32_t g_hackVBoxServerSaveLoadCallsLeft = 0; … … 787 908 GLboolean b; 788 909 unsigned long key; 910 GLenum err; 789 911 #ifdef CR_STATE_NO_TEXTURE_IMAGE_STORE 790 912 unsigned long ctxID=-1, winID=-1; 913 #endif 914 915 #if 0 916 crVBoxServerCheckConsistency(); 791 917 #endif 792 918 … … 904 1030 } 905 1031 1032 /* all context gl error states should have now be synced with chromium erro states, 1033 * reset the error if any */ 1034 while ((err = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) 1035 crWarning("crServer: glGetError %d after saving snapshot", err); 1036 906 1037 cr_server.bIsInSavingState = GL_FALSE; 907 1038 … … 922 1053 uint32_t ui, uiNumElems; 923 1054 unsigned long key; 1055 GLenum err; 924 1056 925 1057 if (!cr_server.bIsInLoadingState) … … 1200 1332 cr_server.curClient = NULL; 1201 1333 1202 { 1203 GLenum err = crServerDispatchGetError(); 1204 1205 if (err != GL_NO_ERROR) 1206 { 1207 crWarning("crServer: glGetError %d after loading snapshot", err); 1208 } 1209 } 1334 while ((err = cr_server.head_spu->dispatch_table.GetError()) != GL_NO_ERROR) 1335 crWarning("crServer: glGetError %d after loading snapshot", err); 1210 1336 1211 1337 cr_server.bIsInLoadingState = GL_FALSE; 1338 1339 #if 0 1340 crVBoxServerCheckConsistency(); 1341 #endif 1212 1342 1213 1343 return VINF_SUCCESS; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r43980 r44196 948 948 cr_server.head_spu->dispatch_table.ReadBuffer( mode ); 949 949 } 950 951 GLenum SERVER_DISPATCH_APIENTRY crServerDispatchGetError( void ) 952 { 953 GLenum retval, err; 954 CRContext *ctx = crStateGetCurrent(); 955 retval = ctx->error; 956 957 err = cr_server.head_spu->dispatch_table.GetError(); 958 if (retval == GL_NO_ERROR) 959 retval = err; 960 else 961 ctx->error = GL_NO_ERROR; 962 963 /* our impl has a single error flag, so we just loop here to reset all error flags to no_error */ 964 while (err != GL_NO_ERROR) 965 err = cr_server.head_spu->dispatch_table.GetError(); 966 967 crServerReturnValue( &retval, sizeof(retval) ); 968 return retval; /* WILL PROBABLY BE IGNORED */ 969 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special
r43888 r44196 250 250 ReadBuffer 251 251 TexPresent 252 GetError
Note:
See TracChangeset
for help on using the changeset viewer.