Changeset 48491 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Sep 16, 2013 3:31:03 PM (11 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r46966 r48491 52 52 #include <iprt/cdefs.h> 53 53 54 #ifndef IN_GUEST55 54 # include <VBox/vmm/ssm.h> 56 55 # include <iprt/asm.h> … … 64 63 # define CR_STATE_SHAREDOBJ_USAGE_GET_FIRST_USED_IDX(_pObj) (ASMBitFirstSet((_pObj)->ctxUsage, sizeof ((_pObj)->ctxUsage)<<3)) 65 64 # define CR_STATE_SHAREDOBJ_USAGE_GET_NEXT_USED_IDX(_pObj, _i) (ASMBitNextSet((_pObj)->ctxUsage, sizeof ((_pObj)->ctxUsage)<<3, (_i))) 66 #else 67 # define CR_STATE_SHAREDOBJ_USAGE_INIT(_pObj) do {} while (0) 68 # define CR_STATE_SHAREDOBJ_USAGE_SET(_pObj, _pCtx) do {} while (0) 69 # define CR_STATE_SHAREDOBJ_USAGE_IS_SET(_pObj, _pCtx) (false) 70 # define CR_STATE_SHAREDOBJ_USAGE_CLEAR_IDX(_pObj, _i) do {} while (0) 71 # define CR_STATE_SHAREDOBJ_USAGE_CLEAR(_pObj, _pCtx) do {} while (0) 72 # define CR_STATE_SHAREDOBJ_USAGE_IS_USED(_pObj) (GL_FALSE) 73 # define CR_STATE_SHAREDOBJ_USAGE_GET_FIRST_USED_IDX(_pObj) (-1) 74 # define CR_STATE_SHAREDOBJ_USAGE_GET_NEXT_USED_IDX(_pObj, _i) (-1) 75 #endif 65 76 66 # define CR_STATE_SHAREDOBJ_USAGE_FOREACH_USED_IDX(_pObj, _i) for ((_i) = CR_STATE_SHAREDOBJ_USAGE_GET_FIRST_USED_IDX(_pObj); ((int)(_i)) >= 0; (_i) = CR_STATE_SHAREDOBJ_USAGE_GET_NEXT_USED_IDX((_pObj), ((int)(_i)))) 77 67 -
trunk/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
r44290 r48491 42 42 CRbitvalue dirty[CR_MAX_BITARRAY]; /* dirty data or state */ 43 43 GLintptrARB dirtyStart, dirtyLength; /* dirty region */ 44 #ifndef IN_GUEST45 44 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */ 46 45 CRbitvalue ctxUsage[CR_MAX_BITARRAY]; 47 #endif48 46 } CRBufferObject; 49 47 -
trunk/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h
r44529 r48491 49 49 #ifdef IN_GUEST 50 50 GLenum status; 51 #e lse51 #endif 52 52 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */ 53 53 CRbitvalue ctxUsage[CR_MAX_BITARRAY]; 54 #endif55 54 } CRFramebufferObject; 56 55 … … 60 59 GLenum internalformat; 61 60 GLuint redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits; 62 #ifndef IN_GUEST63 61 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */ 64 62 CRbitvalue ctxUsage[CR_MAX_BITARRAY]; 65 #endif66 63 } CRRenderbufferObject; 67 64 -
trunk/src/VBox/GuestHost/OpenGL/include/state/cr_texture.h
r46174 r48491 97 97 CRbitvalue imageBit[CR_MAX_BITARRAY]; 98 98 CRbitvalue paramsBit[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY]; 99 #ifndef IN_GUEST100 99 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */ 101 100 CRbitvalue ctxUsage[CR_MAX_BITARRAY]; 102 #endif103 101 } CRTextureObj; 104 102 -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_bufferobject.c
r44290 r48491 23 23 b->access = GL_READ_WRITE_ARB; 24 24 b->bResyncOnRead = GL_FALSE; 25 #ifndef IN_GUEST26 25 CR_STATE_SHAREDOBJ_USAGE_INIT(b); 27 #endif28 26 } 29 27 return b; … … 232 230 } 233 231 234 #ifndef IN_GUEST235 232 CR_STATE_SHAREDOBJ_USAGE_SET(newObj, g); 236 #endif237 233 } 238 234 … … 347 343 #endif 348 344 349 #ifndef IN_GUEST350 345 CR_STATE_SHAREDOBJ_USAGE_CLEAR(obj, ctx); 351 #endif352 346 } 353 347 -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_framebuffer.c
r44947 r48491 80 80 crStateInitFrameBuffer(buffer); 81 81 crHashtableAdd(ctx->shared->fbTable, name, buffer); 82 #ifndef IN_GUEST83 82 CR_STATE_SHAREDOBJ_USAGE_INIT(buffer); 84 #endif85 83 86 84 return buffer; … … 107 105 buffer->internalformat = GL_RGBA; 108 106 crHashtableAdd(ctx->shared->rbTable, name, buffer); 109 #ifndef IN_GUEST110 107 CR_STATE_SHAREDOBJ_USAGE_INIT(buffer); 111 #endif112 108 113 109 return buffer; … … 169 165 fbo->renderbuffer = crStateRenderbufferAllocate(g, renderbuffer); 170 166 } 171 #ifndef IN_GUEST172 167 CR_STATE_SHAREDOBJ_USAGE_SET(fbo->renderbuffer, g); 173 #endif174 175 168 } 176 169 else fbo->renderbuffer = NULL; … … 228 221 crStateCheckFBOAttachments(fbo->drawFB, fboId, GL_DRAW_FRAMEBUFFER); 229 222 230 #ifndef IN_GUEST231 223 CR_STATE_SHAREDOBJ_USAGE_CLEAR(rbo, g); 232 #endif233 224 } 234 225 … … 251 242 if (rbo) 252 243 { 253 #ifndef IN_GUEST254 244 int j; 255 #endif 245 256 246 ctStateRenderbufferRefsCleanup(g, renderbuffers[i], rbo); 257 #ifndef IN_GUEST258 247 CR_STATE_SHAREDOBJ_USAGE_FOREACH_USED_IDX(rbo, j) 259 248 { … … 276 265 CR_STATE_SHAREDOBJ_USAGE_CLEAR_IDX(rbo, j); 277 266 } 278 #endif279 267 crHashtableDelete(g->shared->rbTable, renderbuffers[i], crStateFreeRBO); 280 268 } … … 402 390 } 403 391 404 #ifndef IN_GUEST 392 405 393 CR_STATE_SHAREDOBJ_USAGE_SET(pFBO, g); 406 #endif407 394 } 408 395 … … 459 446 if (fb) 460 447 { 461 #ifndef IN_GUEST462 448 int j; 463 #endif 449 464 450 ctStateFramebufferRefsCleanup(g, fb); 465 #ifndef IN_GUEST 451 466 452 CR_STATE_SHAREDOBJ_USAGE_FOREACH_USED_IDX(fb, j) 467 453 { … … 487 473 CR_STATE_SHAREDOBJ_USAGE_CLEAR_IDX(fb, j); 488 474 } 489 #endif490 475 crHashtableDelete(g->shared->fbTable, framebuffers[i], crStateFreeFBO); 491 476 } … … 656 641 CRSTATE_CHECKERR(textarget!=GL_TEXTURE_1D, GL_INVALID_OPERATION, "textarget"); 657 642 658 #ifndef IN_GUEST659 643 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, g); 660 #endif661 644 662 645 for (i = 0; i < cap; ++i) … … 692 675 CRSTATE_CHECKERR(GL_TEXTURE_1D==textarget || GL_TEXTURE_3D==textarget, GL_INVALID_OPERATION, "textarget"); 693 676 694 #ifndef IN_GUEST695 677 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, g); 696 #endif697 678 698 679 for (i = 0; i < cap; ++i) … … 733 714 CRSTATE_CHECKERR(textarget!=GL_TEXTURE_3D, GL_INVALID_OPERATION, "textarget"); 734 715 735 #ifndef IN_GUEST736 716 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, g); 737 #endif738 717 739 718 for (i = 0; i < cap; ++i) … … 794 773 } 795 774 796 #ifndef IN_GUEST797 775 CR_STATE_SHAREDOBJ_USAGE_SET(rb, g); 798 #endif799 776 800 777 for (i = 0; i < cFBOs; ++i) -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
r47972 r48491 62 62 } 63 63 64 #ifndef IN_GUEST65 64 typedef struct CR_STATE_RELEASEOBJ 66 65 { … … 104 103 crHashtableDelete(pData->s->rbTable, key, crStateFreeRBO); 105 104 } 106 #endif 105 107 106 /** 108 107 * Decrement shared state's refcount and delete when it hits zero. … … 125 124 crFree(s); 126 125 } 127 #ifndef IN_GUEST128 126 else if (pContext) 129 127 { … … 137 135 crHashtableWalk(s->rbTable, ReleaseRBOCallback, &CbData); 138 136 } 139 #endif140 137 } 141 138 … … 465 462 /* Reset diff_api */ 466 463 crMemZero(&diff_api, sizeof(SPUDispatchTable)); 464 465 Assert(!gSharedState); 466 gSharedState = NULL; 467 467 468 468 /* Allocate the default/NULL context */ … … 624 624 #ifdef CHROMIUM_THREADSAFE 625 625 VBoxTlsRefMarkDestroy(ctx); 626 # ifdef IN_GUEST 627 if (VBoxTlsRefCountGet(ctx) > 1 && ctx->shared == gSharedState) 628 { 629 /* we always need to free the global shared state to prevent the situation when guest thinks the shared objects are still valid, while host destroys them */ 630 crStateFreeShared(ctx, ctx->shared); 631 ctx->shared = crStateAllocShared(); 632 } 633 # endif 626 634 VBoxTlsRefRelease(ctx); 627 635 #else -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_program.c
r37304 r48491 268 268 CRContext *g = GetCurrentContext(); 269 269 CRProgramState *p = &(g->program); 270 GLint start, i; 271 272 if (g->current.inBeginEnd) { 273 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, 274 "glGenProgramsNV called in Begin/End"); 275 return; 276 } 277 278 if (n < 0) { 279 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, "glGenProgramsNV(n)"); 280 return; 281 } 282 283 start = crHashtableAllocKeys(p->programHash , n); 284 for (i = 0; i < n; i++) 285 ids[i] = (GLuint) (start + i); 286 } 287 270 271 crStateGenNames(g, p->programHash, n, ids); 272 } 288 273 289 274 void STATE_APIENTRY crStateGenProgramsARB(GLsizei n, GLuint *ids) -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c
r46607 r48491 251 251 } 252 252 253 #ifndef IN_GUEST254 253 CR_STATE_SHAREDOBJ_USAGE_INIT(tobj); 255 254 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, ctx); 256 #endif257 255 } 258 256 … … 1016 1014 } 1017 1015 1018 #ifndef IN_GUEST1019 1016 CR_STATE_SHAREDOBJ_USAGE_SET(tobj, g); 1020 #endif1021 1017 1022 1018 /* Check the targets */
Note:
See TracChangeset
for help on using the changeset viewer.