- Timestamp:
- Jul 25, 2011 10:59:42 AM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h
r33988 r38143 42 42 CRContext *clientState; /* used to store client-side GL state */ 43 43 GLint serverCtx; /* context ID returned by server */ 44 GLboolean fAutoFlush; 45 ThreadInfo *currentThread; 44 46 GLubyte glVersion[100]; /* GL_VERSION string */ 45 47 GLubyte pszRealVendor[100]; -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
r33988 r38143 213 213 } 214 214 215 #define PACK_FORCED_SYNC 215 216 216 217 void PACKSPU_APIENTRY packspu_MakeCurrent( GLint window, GLint nativeWindow, GLint ctx ) … … 234 235 newCtx = &pack_spu.context[slot]; 235 236 CRASSERT(newCtx->clientState); /* verify valid */ 237 238 if (newCtx->fAutoFlush) 239 { 240 if (newCtx->currentThread && newCtx->currentThread != thread) 241 { 242 int writeback = 1; 243 crLockMutex(&_PackMutex); 244 /* do a flush for the previusly assigned thread 245 * to ensure all commands issued there are submitted */ 246 if (newCtx->currentThread 247 && newCtx->currentThread->inUse 248 && newCtx->currentThread->netServer.conn 249 && newCtx->currentThread->packer && newCtx->currentThread->packer->currentBuffer) 250 { 251 #ifdef PACK_FORCED_SYNC 252 CRPackContext *pc = newCtx->currentThread->packer; 253 unsigned char *data_ptr; 254 255 CR_GET_BUFFERED_POINTER( pc, 16 ); 256 WRITE_DATA( 0, GLint, 16 ); 257 WRITE_DATA( 4, GLenum, CR_WRITEBACK_EXTEND_OPCODE ); 258 WRITE_NETWORK_POINTER( 8, (void *) &writeback ); 259 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 260 CR_UNLOCK_PACKER_CONTEXT(pc); 261 #endif 262 packspuFlush((void *) newCtx->currentThread); 263 264 #ifdef PACK_FORCED_SYNC 265 while (writeback) 266 crNetRecv(); 267 #endif 268 } 269 crUnlockMutex(&_PackMutex); 270 } 271 newCtx->currentThread = thread; 272 } 236 273 237 274 thread->currentContext = newCtx; -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c
r37986 r38143 401 401 } 402 402 403 static void packspuFluchOnThreadSwitch(GLboolean fEnable) 404 { 405 GET_THREAD(thread); 406 if (thread->currentContext->fAutoFlush == fEnable) 407 return; 408 409 thread->currentContext->fAutoFlush = fEnable; 410 thread->currentContext->currentThread = fEnable ? thread : NULL; 411 } 412 403 413 void PACKSPU_APIENTRY packspu_ChromiumParameteriCR(GLenum target, GLint value) 404 414 { 415 if (GL_FLUSH_ON_THREAD_SWITCH_CR==target) 416 { 417 /* this is a pure packspu state, don't propagate it any further */ 418 packspuFluchOnThreadSwitch(value); 419 return; 420 } 405 421 if (GL_SHARE_CONTEXT_RESOURCES_CR==target) 406 422 { … … 555 571 } 556 572 573 for (i=0; i<CR_MAX_CONTEXTS; ++i) 574 { 575 ContextInfo *ctx = &pack_spu.context[i]; 576 if (ctx->currentThread == thread) 577 { 578 CRASSERT(ctx->fAutoFlush); 579 ctx->currentThread = NULL; 580 } 581 } 582 557 583 crUnlockMutex(&_PackMutex); 558 584 } -
trunk/src/VBox/GuestHost/OpenGL/include/chromium.h
r32060 r38143 688 688 /*Global resource ids sharing*/ 689 689 #define GL_SHARE_CONTEXT_RESOURCES_CR 0x8B27 690 #define GL_FLUSH_ON_THREAD_SWITCH_CR 0x8B28 690 691 691 692 /**********************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.