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_client.c

    r78190 r78375  
    1919    }
    2020#endif
    21     crStateFogCoordPointerEXT( type, stride, pointer );
     21    crStateFogCoordPointerEXT(&pack_spu.StateTracker, type, stride, pointer );
    2222}
    2323
     
    3030    }
    3131#endif
    32     crStateColorPointer( size, type, stride, pointer );
     32    crStateColorPointer(&pack_spu.StateTracker, size, type, stride, pointer );
    3333}
    3434
     
    4141    }
    4242#endif
    43     crStateSecondaryColorPointerEXT( size, type, stride, pointer );
     43    crStateSecondaryColorPointerEXT(&pack_spu.StateTracker, size, type, stride, pointer );
    4444}
    4545
     
    5353    }
    5454#endif
    55     crStateVertexPointer( size, type, stride, pointer );
     55    crStateVertexPointer(&pack_spu.StateTracker, size, type, stride, pointer );
    5656}
    5757
     
    6464    }
    6565#endif
    66     crStateTexCoordPointer( size, type, stride, pointer );
     66    crStateTexCoordPointer(&pack_spu.StateTracker, size, type, stride, pointer );
    6767}
    6868
     
    7575    }
    7676#endif
    77     crStateNormalPointer( type, stride, pointer );
     77    crStateNormalPointer(&pack_spu.StateTracker, type, stride, pointer );
    7878}
    7979
     
    8686    }
    8787#endif
    88     crStateEdgeFlagPointer( stride, pointer );
     88    crStateEdgeFlagPointer(&pack_spu.StateTracker, stride, pointer );
    8989}
    9090
     
    9797    }
    9898#endif
    99     crStateVertexAttribPointerARB( index, size, type, normalized, stride, pointer );
     99    crStateVertexAttribPointerARB(&pack_spu.StateTracker, index, size, type, normalized, stride, pointer );
    100100}
    101101
     
    108108    }
    109109#endif
    110     crStateVertexAttribPointerNV( index, size, type, stride, pointer );
     110    crStateVertexAttribPointerNV(&pack_spu.StateTracker, index, size, type, stride, pointer );
    111111}
    112112
     
    119119    }
    120120#endif
    121     crStateIndexPointer(type, stride, pointer);
     121    crStateIndexPointer(&pack_spu.StateTracker, type, stride, pointer);
    122122}
    123123
    124124void PACKSPU_APIENTRY packspu_GetPointerv( GLenum pname, GLvoid **params )
    125125{
    126     crStateGetPointerv( pname, params );
     126    crStateGetPointerv(&pack_spu.StateTracker, pname, params );
    127127}
    128128
     
    138138    /*crDebug("packspu_InterleavedArrays");*/
    139139
    140     crStateInterleavedArrays( format, stride, pointer );
     140    crStateInterleavedArrays(&pack_spu.StateTracker, format, stride, pointer );
    141141}
    142142
     
    219219#ifdef DEBUG
    220220    {
    221         CRContext *pCurState = crStateGetCurrent();
     221        CRContext *pCurState = crStateGetCurrent(&pack_spu.StateTracker);
    222222
    223223        Assert(g == pCurState);
     
    282282    {
    283283        CRContext *g = pRestoreCtx->pCtx->clientState;
    284         CRContext *pCurState = crStateGetCurrent();
     284        CRContext *pCurState = crStateGetCurrent(&pack_spu.StateTracker);
    285285
    286286        Assert(g == pCurState);
     
    319319        if (ctx->clientState->extensions.ARB_vertex_buffer_object)
    320320        {
    321             serverArrays = crStateUseServerArrays();
     321            serverArrays = crStateUseServerArrays(&pack_spu.StateTracker);
    322322            if (ctx->fCheckZerroVertAttr)
    323323                cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     
    395395    {
    396396        GET_CONTEXT(ctx);
    397         elementsBuffer = crStateGetCurrent()->bufferobject.elementsBuffer;
     397        elementsBuffer = crStateGetCurrent(&pack_spu.StateTracker)->bufferobject.elementsBuffer;
    398398        /*crDebug("DrawElements count=%d, indices=%p", count, indices);*/
    399399        if (ctx->clientState->extensions.ARB_vertex_buffer_object)
    400400        {
    401             serverArrays = crStateUseServerArrays();
     401            serverArrays = crStateUseServerArrays(&pack_spu.StateTracker);
    402402            if (ctx->fCheckZerroVertAttr)
    403403                cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     
    452452        if ((max-min)<(GLuint)(2*count))
    453453        {
    454             crStateLockArraysEXT(min, max-min+1);
     454            crStateLockArraysEXT(&pack_spu.StateTracker, min, max-min+1);
    455455
    456456            serverArrays = crStateUseServerArrays();
     
    461461            else
    462462            {
    463                 crStateUnlockArraysEXT();
     463                crStateUnlockArraysEXT(&pack_spu.StateTracker);
    464464            }
    465465        }
     
    539539        if (ctx->clientState->extensions.ARB_vertex_buffer_object)
    540540        {
    541              serverArrays = crStateUseServerArrays();
     541             serverArrays = crStateUseServerArrays(&pack_spu.StateTracker);
    542542             if (ctx->fCheckZerroVertAttr)
    543543                 cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     
    608608        if (ctx->clientState->extensions.ARB_vertex_buffer_object)
    609609        {
    610              serverArrays = crStateUseServerArrays();
     610             serverArrays = crStateUseServerArrays(&pack_spu.StateTracker);
    611611             if (ctx->fCheckZerroVertAttr)
    612612                 cZvaValues = crStateNeedDummyZeroVertexArray(thread->currentContext->clientState, &thread->packer->current, aAttrib);
     
    617617    if (!serverArrays && !ctx->clientState->client.array.locked && (count>3))
    618618    {
    619         crStateLockArraysEXT(first, count);
    620         serverArrays = crStateUseServerArrays();
     619        crStateLockArraysEXT(&pack_spu.StateTracker, first, count);
     620        serverArrays = crStateUseServerArrays(&pack_spu.StateTracker);
    621621        if (serverArrays)
    622622        {
     
    625625        else
    626626        {
    627             crStateUnlockArraysEXT();
     627            crStateUnlockArraysEXT(&pack_spu.StateTracker);
    628628        }
    629629    }
     
    714714void PACKSPU_APIENTRY packspu_EnableClientState( GLenum array )
    715715{
    716     crStateEnableClientState(array);
     716    crStateEnableClientState(&pack_spu.StateTracker, array);
    717717    crPackEnableClientState(array);
    718718}
     
    720720void PACKSPU_APIENTRY packspu_DisableClientState( GLenum array )
    721721{
    722     crStateDisableClientState(array);
     722    crStateDisableClientState(&pack_spu.StateTracker, array);
    723723    crPackDisableClientState(array);
    724724}
     
    726726void PACKSPU_APIENTRY packspu_ClientActiveTextureARB( GLenum texUnit )
    727727{
    728     crStateClientActiveTextureARB(texUnit);
     728    crStateClientActiveTextureARB(&pack_spu.StateTracker, texUnit);
    729729    crPackClientActiveTextureARB(texUnit);
    730730}
     
    732732void PACKSPU_APIENTRY packspu_EnableVertexAttribArrayARB(GLuint index)
    733733{
    734     crStateEnableVertexAttribArrayARB(index);
     734    crStateEnableVertexAttribArrayARB(&pack_spu.StateTracker, index);
    735735    crPackEnableVertexAttribArrayARB(index);
    736736}
     
    739739void PACKSPU_APIENTRY packspu_DisableVertexAttribArrayARB(GLuint index)
    740740{
    741     crStateDisableVertexAttribArrayARB(index);
     741    crStateDisableVertexAttribArrayARB(&pack_spu.StateTracker, index);
    742742    crPackDisableVertexAttribArrayARB(index);
    743743}
     
    747747    if (cap!=GL_LIGHT_MODEL_TWO_SIDE)
    748748    {
    749         crStateEnable(cap);
     749        crStateEnable(&pack_spu.StateTracker, cap);
    750750        crPackEnable(cap);
    751751    }
     
    758758            g_glmts1_warn=1;
    759759        }
    760         crStateLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
     760        crStateLightModeli(&pack_spu.StateTracker, GL_LIGHT_MODEL_TWO_SIDE, 1);
    761761        crPackLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
    762762    }
     
    768768    if (cap!=GL_LIGHT_MODEL_TWO_SIDE)
    769769    {
    770         crStateDisable(cap);
     770        crStateDisable(&pack_spu.StateTracker, cap);
    771771        crPackDisable(cap);
    772772    }
     
    779779            g_glmts0_warn=1;
    780780        }
    781         crStateLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
     781        crStateLightModeli(&pack_spu.StateTracker, GL_LIGHT_MODEL_TWO_SIDE, 0);
    782782        crPackLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
    783783    }
     
    786786GLboolean PACKSPU_APIENTRY packspu_IsEnabled(GLenum cap)
    787787{
    788     GLboolean res = crStateIsEnabled(cap);
     788    GLboolean res = crStateIsEnabled(&pack_spu.StateTracker, cap);
    789789#ifdef DEBUG
    790790    {
     
    804804void PACKSPU_APIENTRY packspu_PushClientAttrib( GLbitfield mask )
    805805{
    806     crStatePushClientAttrib(mask);
     806    crStatePushClientAttrib(&pack_spu.StateTracker, mask);
    807807    crPackPushClientAttrib(mask);
    808808}
     
    810810void PACKSPU_APIENTRY packspu_PopClientAttrib( void )
    811811{
    812     crStatePopClientAttrib();
     812    crStatePopClientAttrib(&pack_spu.StateTracker);
    813813    crPackPopClientAttrib();
    814814}
     
    818818    if (first>=0 && count>0)
    819819    {
    820         crStateLockArraysEXT(first, count);
     820        crStateLockArraysEXT(&pack_spu.StateTracker, first, count);
    821821        /*Note: this is a workaround for quake3 based apps.
    822822          It's modifying vertex data between glLockArraysEXT and glDrawElements calls,
     
    838838    }
    839839
    840     crStateUnlockArraysEXT();
    841 }
     840    crStateUnlockArraysEXT(&pack_spu.StateTracker);
     841}
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