VirtualBox

Ignore:
Timestamp:
May 3, 2019 9:51:02 PM (6 years ago)
Author:
vboxsync
Message:

Additions/common/crOpengl,GuestHost/OpenGL,HostServices/SharedOpenGL: Eliminate all global variables from the state tracker library (state_tracker) in preparation of the SPU DLL merging, bugref:9435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r78341 r78375  
    9898    GLint buffer;
    9999
    100     crStateGetIntegerv(GL_DRAW_BUFFER, &buffer);
     100    crStateGetIntegerv(&pack_spu.StateTracker, GL_DRAW_BUFFER, &buffer);
    101101    /*Usually buffer==GL_BACK, so put this extra check to simplify boolean eval on runtime*/
    102102    return  (buffer != GL_BACK)
     
    116116    hadtoflush = packspuSyncOnFlushes();
    117117
    118     crStateDrawBuffer(mode);
     118    crStateDrawBuffer(&pack_spu.StateTracker, mode);
    119119    crPackDrawBuffer(mode);
    120120
     
    197197void PACKSPU_APIENTRY packspu_NewList(GLuint list, GLenum mode)
    198198{
    199     crStateNewList(list, mode);
     199    crStateNewList(&pack_spu.StateTracker, list, mode);
    200200    crPackNewList(list, mode);
    201201}
     
    203203void PACKSPU_APIENTRY packspu_EndList()
    204204{
    205     crStateEndList();
     205    crStateEndList(&pack_spu.StateTracker);
    206206    crPackEndList();
    207207}
     
    366366    crPackGetPolygonStipple( mask, &writeback );
    367367#ifdef CR_ARB_pixel_buffer_object
    368     if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB))
     368    if (!crStateIsBufferBound(&pack_spu.StateTracker, GL_PIXEL_PACK_BUFFER_ARB))
    369369#endif
    370370    {
     
    381381    crPackGetPixelMapfv( map, values, &writeback );
    382382#ifdef CR_ARB_pixel_buffer_object
    383     if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB))
     383    if (!crStateIsBufferBound(&pack_spu.StateTracker, GL_PIXEL_PACK_BUFFER_ARB))
    384384#endif
    385385    {
     
    397397
    398398#ifdef CR_ARB_pixel_buffer_object
    399     if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB))
     399    if (!crStateIsBufferBound(&pack_spu.StateTracker, GL_PIXEL_PACK_BUFFER_ARB))
    400400#endif
    401401    {
     
    412412    crPackGetPixelMapusv( map, values, &writeback );
    413413#ifdef CR_ARB_pixel_buffer_object
    414     if (!crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB))
     414    if (!crStateIsBufferBound(&pack_spu.StateTracker, GL_PIXEL_PACK_BUFFER_ARB))
    415415#endif
    416416    {
     
    449449            return;
    450450        case GL_SHARE_CONTEXT_RESOURCES_CR:
    451             crStateShareContext(value);
     451            crStateShareContext(&pack_spu.StateTracker, value);
    452452            break;
    453453        case GL_RCUSAGE_TEXTURE_SET_CR:
    454454        {
    455455            Assert(value);
    456             crStateSetTextureUsed(value, GL_TRUE);
     456            crStateSetTextureUsed(&pack_spu.StateTracker, value, GL_TRUE);
    457457            break;
    458458        }
     
    462462#ifdef DEBUG
    463463            {
    464                 CRContext *pCurState = crStateGetCurrent();
     464                CRContext *pCurState = crStateGetCurrent(&pack_spu.StateTracker);
    465465                CRTextureObj *tobj = (CRTextureObj*)crHashtableSearch(pCurState->shared->textureTable, value);
    466466                Assert(tobj);
    467467            }
    468468#endif
    469             crStateSetTextureUsed(value, GL_FALSE);
     469            crStateSetTextureUsed(&pack_spu.StateTracker, value, GL_FALSE);
    470470            break;
    471471        }
     
    481481    int writeback = 1;
    482482    GLenum return_val = (GLenum) 0;
    483     CRContext *pCurState = crStateGetCurrent();
     483    CRContext *pCurState = crStateGetCurrent(&pack_spu.StateTracker);
    484484    NOREF(pCurState); /* it's unused, but I don't know about side effects.. */
    485485
     
    620620    crSetTSD(&_PackTSD, NULL);
    621621
    622     crStateVBoxAttachThread();
     622    crStateVBoxAttachThread(&pack_spu.StateTracker);
    623623}
    624624
     
    701701    }
    702702
    703     crStateVBoxDetachThread();
     703    crStateVBoxDetachThread(&pack_spu.StateTracker);
    704704}
    705705
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette