- Timestamp:
- Jan 29, 2014 8:23:21 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r50217 r50277 92 92 } CRCreateInfo_t; 93 93 94 typedef struct { 95 char *pszDpyName; 96 int32_t externalID; 97 GLint requestedVisualBits; 98 GLint realVisualBits; 99 } CRCreateInfoEx_t; 94 100 95 101 /* VRAM->RAM worker thread */ … … 242 248 void *pvReserved; 243 249 244 CRCreateInfo _t CreateInfo;250 CRCreateInfoEx_t CreateInfo; 245 251 246 252 /* to avoid saved state breakage we need to keep RT_OFFSETOF(CRMuralInfo, CreateInfo) intact … … 274 280 CRContext *pContext; 275 281 int SpuContext; 276 CRCreateInfo _t CreateInfo;282 CRCreateInfoEx_t CreateInfo; 277 283 CRMuralInfo * currentMural; 278 284 } CRContextInfo; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50276 r50277 177 177 { 178 178 win->Base.id = mural->spuWindow; 179 win->Base.visualBits = mural->CreateInfo. visualBits;179 win->Base.visualBits = mural->CreateInfo.realVisualBits; 180 180 win->width = mural->width; 181 181 win->height = mural->height; … … 187 187 if (ctx->Base.id < 0) 188 188 ctx->Base.id = cr_server.MainContextInfo.SpuContext; 189 ctx->Base.visualBits = cr_server.curClient->currentCtxInfo->CreateInfo. visualBits;189 ctx->Base.visualBits = cr_server.curClient->currentCtxInfo->CreateInfo.realVisualBits; 190 190 } 191 191 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r50095 r50277 29 29 30 30 dpyName = ""; 31 if (cr_server.fVisualBitsDefault)32 visualBits = cr_server.fVisualBitsDefault;33 31 34 32 if (shareCtx > 0) { … … 46 44 pContextInfo->currentMural = NULL; 47 45 48 pContextInfo->CreateInfo.visualBits = visualBits; 46 pContextInfo->CreateInfo.requestedVisualBits = visualBits; 47 48 if (cr_server.fVisualBitsDefault) 49 visualBits = cr_server.fVisualBitsDefault; 50 51 pContextInfo->CreateInfo.realVisualBits = visualBits; 49 52 50 53 /* Since the Cr server serialized all incoming clients/contexts into … … 53 56 */ 54 57 if (cr_server.firstCallCreateContext) { 55 cr_server.MainContextInfo.CreateInfo. visualBits = visualBits;58 cr_server.MainContextInfo.CreateInfo.realVisualBits = visualBits; 56 59 cr_server.MainContextInfo.SpuContext = cr_server.head_spu->dispatch_table. 57 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo. visualBits, shareCtx);60 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo.realVisualBits, shareCtx); 58 61 if (cr_server.MainContextInfo.SpuContext < 0) { 59 62 crWarning("crServerDispatchCreateContext() failed."); … … 70 73 else { 71 74 /* second or third or ... context */ 72 if (!cr_server.bUseMultipleContexts && ((visualBits & cr_server.MainContextInfo.CreateInfo. visualBits) != visualBits)) {75 if (!cr_server.bUseMultipleContexts && ((visualBits & cr_server.MainContextInfo.CreateInfo.realVisualBits) != visualBits)) { 73 76 int oldSpuContext; 74 77 /* should never be here */ 78 CRASSERT(0); 75 79 /* the new context needs new visual attributes */ 76 cr_server.MainContextInfo.CreateInfo. visualBits |= visualBits;80 cr_server.MainContextInfo.CreateInfo.realVisualBits |= visualBits; 77 81 crWarning("crServerDispatchCreateContext requires new visual (0x%x).", 78 cr_server.MainContextInfo.CreateInfo. visualBits);82 cr_server.MainContextInfo.CreateInfo.realVisualBits); 79 83 80 84 /* Here, we used to just destroy the old rendering context. … … 91 95 oldSpuContext = cr_server.MainContextInfo.SpuContext; 92 96 cr_server.MainContextInfo.SpuContext = cr_server.head_spu->dispatch_table. 93 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo. visualBits, cr_server.MainContextInfo.SpuContext);97 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo.realVisualBits, cr_server.MainContextInfo.SpuContext); 94 98 /* destroy old rendering context */ 95 99 cr_server.head_spu->dispatch_table.DestroyContext(oldSpuContext); … … 108 112 if (cr_server.bUseMultipleContexts) { 109 113 pContextInfo->SpuContext = cr_server.head_spu->dispatch_table. 110 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo. visualBits, cr_server.MainContextInfo.SpuContext);114 CreateContext(dpyName, cr_server.MainContextInfo.CreateInfo.realVisualBits, cr_server.MainContextInfo.SpuContext); 111 115 if (pContextInfo->SpuContext < 0) { 112 116 crWarning("crServerDispatchCreateContext() failed."); … … 136 140 137 141 pContextInfo->pContext = newCtx; 138 pContextInfo->CreateInfo.visualBits = visualBits;142 Assert(pContextInfo->CreateInfo.realVisualBits == visualBits); 139 143 pContextInfo->CreateInfo.externalID = retVal; 140 144 pContextInfo->CreateInfo.pszDpyName = dpyName ? crStrdup(dpyName) : NULL; … … 202 206 if (cr_server.currentCtxInfo == crCtxInfo) 203 207 { 204 CRMuralInfo *dummyMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);208 CRMuralInfo *dummyMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 205 209 crServerPerformMakeCurrent(dummyMural, &cr_server.MainContextInfo); 206 210 CRASSERT(cr_server.currentCtxInfo == &cr_server.MainContextInfo); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r50258 r50277 854 854 { 855 855 CRMuralInfo *pMural = (CRMuralInfo *)data1; 856 CRCreateInfo_t *pCreateInfo = &pMural->CreateInfo; 857 crVBoxServerSaveCreateInfoCB(key, pCreateInfo, data2); 856 CRCreateInfo_t CreateInfo; 857 CreateInfo.pszDpyName = pMural->CreateInfo.pszDpyName; 858 CreateInfo.visualBits = pMural->CreateInfo.requestedVisualBits; 859 CreateInfo.externalID = pMural->CreateInfo.externalID; 860 crVBoxServerSaveCreateInfoCB(key, &CreateInfo, data2); 858 861 } 859 862 … … 861 864 { 862 865 CRContextInfo *pContextInfo = (CRContextInfo *)data1; 863 CRCreateInfo_t CreateInfo = pContextInfo->CreateInfo; 866 CRCreateInfo_t CreateInfo; 867 CreateInfo.pszDpyName = pContextInfo->CreateInfo.pszDpyName; 868 CreateInfo.visualBits = pContextInfo->CreateInfo.requestedVisualBits; 864 869 /* saved state contains internal id */ 865 870 CreateInfo.externalID = pContextInfo->pContext->id; … … 920 925 Assert(!crHashtableGetDataKey(pData->pGlobal->contextMuralTable, pMural, NULL)); 921 926 922 if (cr_server.MainContextInfo.CreateInfo. visualBits == pMural->CreateInfo.visualBits)927 if (cr_server.MainContextInfo.CreateInfo.realVisualBits == pMural->CreateInfo.realVisualBits) 923 928 { 924 929 pContextInfo = &cr_server.MainContextInfo; … … 965 970 return; 966 971 967 CRASSERT(pMural->CreateInfo. visualBits == pData->pContextInfo->CreateInfo.visualBits);972 CRASSERT(pMural->CreateInfo.realVisualBits == pData->pContextInfo->CreateInfo.realVisualBits); 968 973 pData->pMural = pMural; 969 974 } … … 1033 1038 if (!pMural) 1034 1039 { 1035 pMural = crServerGetDummyMural(pContextInfo->CreateInfo. visualBits);1040 pMural = crServerGetDummyMural(pContextInfo->CreateInfo.realVisualBits); 1036 1041 if (!pMural) 1037 1042 { … … 1157 1162 /* there is a lot of code that assumes we have double buffering, just assert here to print a warning in the log 1158 1163 * so that we know that something irregular is going on */ 1159 CRASSERT(pCtxInfo->CreateInfo. visualBits & CR_DOUBLE_BIT);1160 if ((pCtxInfo->CreateInfo. visualBits & CR_DOUBLE_BIT)1164 CRASSERT(pCtxInfo->CreateInfo.requestedVisualBits & CR_DOUBLE_BIT); 1165 if ((pCtxInfo->CreateInfo.requestedVisualBits & CR_DOUBLE_BIT) 1161 1166 || version < SHCROGL_SSM_VERSION_WITH_SINGLE_DEPTH_STENCIL /* <- older version had a typo which lead to back always being used, 1162 1167 * no matter what the visual bits are */ … … 1189 1194 if (version < SHCROGL_SSM_VERSION_WITH_SINGLE_DEPTH_STENCIL) 1190 1195 { 1191 /* if (pCtxInfo->CreateInfo. visualBits & CR_DEPTH_BIT) */ /* <- older version had a typo which lead to back always being used,1196 /* if (pCtxInfo->CreateInfo.requestedVisualBits & CR_DEPTH_BIT) */ /* <- older version had a typo which lead to back always being used, 1192 1197 * no matter what the visual bits are */ 1193 1198 { … … 1220 1225 } 1221 1226 1222 /* if (pCtxInfo->CreateInfo. visualBits & CR_STENCIL_BIT) */ /* <- older version had a typo which lead to back always being used,1227 /* if (pCtxInfo->CreateInfo.requestedVisualBits & CR_STENCIL_BIT) */ /* <- older version had a typo which lead to back always being used, 1223 1228 * no matter what the visual bits are */ 1224 1229 { … … 1246 1251 } 1247 1252 1248 if ((pCtxInfo->CreateInfo. visualBits & CR_STENCIL_BIT)1249 || (pCtxInfo->CreateInfo. visualBits & CR_DEPTH_BIT))1253 if ((pCtxInfo->CreateInfo.requestedVisualBits & CR_STENCIL_BIT) 1254 || (pCtxInfo->CreateInfo.requestedVisualBits & CR_DEPTH_BIT)) 1250 1255 { 1251 1256 pEl = &pData->aElements[pData->cElements]; … … 2347 2352 CRASSERT(!cr_server.currentCtxInfo); 2348 2353 CRASSERT(!cr_server.currentMural); 2349 pMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);2354 pMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 2350 2355 CRASSERT(pMural); 2351 2356 crServerPerformMakeCurrent(pMural, &cr_server.MainContextInfo); … … 2381 2386 { 2382 2387 /* null winId means a dummy mural, get it */ 2383 pMural = crServerGetDummyMural(pContextInfo->CreateInfo. visualBits);2388 pMural = crServerGetDummyMural(pContextInfo->CreateInfo.realVisualBits); 2384 2389 CRASSERT(pMural); 2385 2390 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r50184 r50277 676 676 CRASSERT(cr_server.MainContextInfo.SpuContext); 677 677 Ctx.Base.id = cr_server.MainContextInfo.SpuContext; 678 Ctx.Base.visualBits = cr_server.MainContextInfo.CreateInfo. visualBits;678 Ctx.Base.visualBits = cr_server.MainContextInfo.CreateInfo.realVisualBits; 679 679 rc = CrBltInit(&cr_server.Blitter, &Ctx, true, true, NULL, &cr_server.TmpCtxDispatch); 680 680 if (RT_SUCCESS(rc)) … … 692 692 if (!CrBltMuralGetCurrentInfo(&cr_server.Blitter)->Base.id) 693 693 { 694 CRMuralInfo *dummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);694 CRMuralInfo *dummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 695 695 CR_BLITTER_WINDOW DummyInfo; 696 696 CRASSERT(dummy); … … 1378 1378 CRMuralInfo * pDummy; 1379 1379 Assert(!cr_server.currentCtxInfo); 1380 pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);1380 pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 1381 1381 context = cr_server.MainContextInfo.SpuContext; 1382 1382 window = pDummy->spuWindow; … … 1512 1512 if (!CrBltIsInitialized(&cr_server.RecorderBlitter)) 1513 1513 { 1514 pBlitterMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);1514 pBlitterMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 1515 1515 if (!pBlitterMural) 1516 1516 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.cpp
r50178 r50277 524 524 } 525 525 526 if (pMuralContextInfo->CreateInfo. visualBits != mural->CreateInfo.visualBits)526 if (pMuralContextInfo->CreateInfo.realVisualBits != mural->CreateInfo.realVisualBits) 527 527 { 528 528 WARN(("mural visual bits do not match with current context visual bits!")); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_rpw.cpp
r46343 r50277 351 351 if (RT_SUCCESS(rc)) 352 352 { 353 CRASSERT(cr_server.MainContextInfo.CreateInfo. visualBits);353 CRASSERT(cr_server.MainContextInfo.CreateInfo.realVisualBits); 354 354 CRASSERT(cr_server.MainContextInfo.SpuContext); 355 355 356 pWorker->ctxId = cr_server.head_spu->dispatch_table.CreateContext("", cr_server.MainContextInfo.CreateInfo. visualBits, cr_server.MainContextInfo.SpuContext);356 pWorker->ctxId = cr_server.head_spu->dispatch_table.CreateContext("", cr_server.MainContextInfo.CreateInfo.realVisualBits, cr_server.MainContextInfo.SpuContext); 357 357 if (pWorker->ctxId) 358 358 { 359 359 CRMuralInfo *pDummyMural; 360 pWorker->ctxVisBits = cr_server.MainContextInfo.CreateInfo. visualBits;360 pWorker->ctxVisBits = cr_server.MainContextInfo.CreateInfo.realVisualBits; 361 361 pDummyMural = crServerGetDummyMural(pWorker->ctxVisBits); 362 362 if (pDummyMural) … … 448 448 if (!cr_server.currentCtxInfo) 449 449 { 450 CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);450 CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 451 451 if (!pDummy) 452 452 { … … 536 536 if (!cr_server.currentCtxInfo) 537 537 { 538 CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);538 CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 539 539 if (!pDummy) 540 540 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r50274 r50277 26 26 GLint spuWindow; 27 27 int rc; 28 GLint realVisBits = visBits; 28 29 29 30 crMemset(mural, 0, sizeof (*mural)); 31 32 if (cr_server.fVisualBitsDefault) 33 realVisBits = cr_server.fVisualBitsDefault; 30 34 31 35 /* 32 36 * Have first SPU make a new window. 33 37 */ 34 spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, visBits );38 spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, realVisBits ); 35 39 if (spuWindow < 0) { 36 40 return spuWindow; … … 62 66 windowID = preloadWinID<0 ? (GLint)crHashtableAllocKeys( cr_server.muralTable, 1 ) : preloadWinID; 63 67 64 mural->CreateInfo.visualBits = visBits; 68 mural->CreateInfo.realVisualBits = realVisBits; 69 mural->CreateInfo.requestedVisualBits = visBits; 65 70 mural->CreateInfo.externalID = windowID; 66 71 mural->CreateInfo.pszDpyName = dpyName ? crStrdup(dpyName) : NULL; … … 77 82 78 83 dpyName = ""; 79 80 if (cr_server.fVisualBitsDefault)81 visBits = cr_server.fVisualBitsDefault;82 84 83 85 if (cr_server.sharedWindows) { … … 145 147 146 148 /* ensure we have a dummy mural created right away to avoid potential deadlocks on VM shutdown */ 147 crServerGetDummyMural(mural->CreateInfo. visualBits);149 crServerGetDummyMural(mural->CreateInfo.realVisualBits); 148 150 149 151 crServerReturnValue( &windowID, sizeof(windowID) ); … … 175 177 if (cr_server.currentMural == mural) 176 178 { 177 CRMuralInfo *dummyMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo. visualBits);179 CRMuralInfo *dummyMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits); 178 180 /* reset the current context to some dummy values to ensure render spu does not switch to a default "0" context, 179 181 * which might lead to muralFBO (offscreen rendering) gl entities being created in a scope of that context */ … … 193 195 if (pWindow && pWindow->Base.id == mural->spuWindow) 194 196 { 195 CRMuralInfo *dummy = crServerGetDummyMural(mural->CreateInfo. visualBits);197 CRMuralInfo *dummy = crServerGetDummyMural(mural->CreateInfo.realVisualBits); 196 198 CR_BLITTER_WINDOW DummyInfo; 197 199 CRASSERT(dummy);
Note:
See TracChangeset
for help on using the changeset viewer.