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
  • TabularUnified trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.cpp

    r78263 r78375  
    5252    }
    5353
    54     cr_server.head_spu->dispatch_table.GetActiveAttrib(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);
     54    cr_server.head_spu->dispatch_table.GetActiveAttrib(crStateGetProgramHWID(&cr_server.StateTracker, program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);
    5555    crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t));
    5656    crFree(pLocal);
     
    7474    }
    7575
    76     cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);
     76    cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(&cr_server.StateTracker, program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]);
    7777    crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t));
    7878    crFree(pLocal);
     
    9696    /* initial (fallback )value */
    9797    *pLocal = 0;
    98     cr_server.head_spu->dispatch_table.GetAttachedShaders(crStateGetProgramHWID(program), maxCount, pLocal, (GLuint*)&pLocal[1]);
     98    cr_server.head_spu->dispatch_table.GetAttachedShaders(crStateGetProgramHWID(&cr_server.StateTracker, program), maxCount, pLocal, (GLuint*)&pLocal[1]);
    9999
    100100    {
     
    103103
    104104        for (i=0; i<*pLocal; ++i)
    105           ids[i] = crStateGLSLShaderHWIDtoID(ids[i]);
     105          ids[i] = crStateGLSLShaderHWIDtoID(&cr_server.StateTracker, ids[i]);
    106106    }
    107107
     
    127127    /* initial (fallback )value */
    128128    *pLocal = 0;
    129     cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(crStateGetProgramHWID(containerObj), maxCount, pLocal, (VBoxGLhandleARB*)&pLocal[1]);
     129    cr_server.head_spu->dispatch_table.GetAttachedObjectsARB(crStateGetProgramHWID(&cr_server.StateTracker, containerObj), maxCount, pLocal, (VBoxGLhandleARB*)&pLocal[1]);
    130130
    131131    {
     
    134134
    135135        for (i=0; i<*pLocal; ++i)
    136           ids[i] = crStateGLSLShaderHWIDtoID(ids[i]);
     136          ids[i] = crStateGLSLShaderHWIDtoID(&cr_server.StateTracker, ids[i]);
    137137    }
    138138
     
    162162    *pLocal = 0;
    163163    /** @todo recheck*/
    164     hwid = crStateGetProgramHWID(obj);
    165     if (!hwid) hwid = crStateGetShaderHWID(obj);
     164    hwid = crStateGetProgramHWID(&cr_server.StateTracker, obj);
     165    if (!hwid) hwid = crStateGetShaderHWID(&cr_server.StateTracker, obj);
    166166    cr_server.head_spu->dispatch_table.GetInfoLogARB(hwid, maxLength, pLocal, (char*)&pLocal[1]);
    167167    CRASSERT((*pLocal) <= maxLength);
     
    187187    /* initial (fallback )value */
    188188    *pLocal = 0;
    189     cr_server.head_spu->dispatch_table.GetShaderInfoLog(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
     189    cr_server.head_spu->dispatch_table.GetShaderInfoLog(crStateGetShaderHWID(&cr_server.StateTracker, shader), bufSize, pLocal, (char*)&pLocal[1]);
    190190    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    191191    crFree(pLocal);
     
    209209    /* initial (fallback )value */
    210210    *pLocal = 0;
    211     cr_server.head_spu->dispatch_table.GetProgramInfoLog(crStateGetProgramHWID(program), bufSize, pLocal, (char*)&pLocal[1]);
     211    cr_server.head_spu->dispatch_table.GetProgramInfoLog(crStateGetProgramHWID(&cr_server.StateTracker, program), bufSize, pLocal, (char*)&pLocal[1]);
    212212    CRASSERT(pLocal[0] <= bufSize);
    213213    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
     
    232232    /* initial (fallback )value */
    233233    *pLocal = 0;
    234     cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
     234    cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(&cr_server.StateTracker, shader), bufSize, pLocal, (char*)&pLocal[1]);
    235235    CRASSERT(pLocal[0] <= bufSize);
    236236    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
     
    258258    /* initial (fallback )value */
    259259    *pLocal = 0;
    260     crStateGLSLProgramCacheUniforms(program, maxcbData, pLocal, (char*)&pLocal[1]);
     260    crStateGLSLProgramCacheUniforms(&cr_server.StateTracker, program, maxcbData, pLocal, (char*)&pLocal[1]);
    261261
    262262    crServerReturnValue(pLocal, (*pLocal)+sizeof(GLsizei));
     
    284284    /* initial (fallback )value */
    285285    *pLocal = 0;
    286     crStateGLSLProgramCacheAttribs(program, maxcbData, pLocal, (char*)&pLocal[1]);
     286    crStateGLSLProgramCacheAttribs(&cr_server.StateTracker, program, maxcbData, pLocal, (char*)&pLocal[1]);
    287287
    288288    crServerReturnValue(pLocal, (*pLocal)+sizeof(GLsizei));
     
    296296
    297297    /** @todo check if index and location is the same*/
    298     cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(program), location, 0, NULL, &size, &type, NULL);
    299 
    300     return crStateGetUniformSize(type);
     298    cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(&cr_server.StateTracker, program), location, 0, NULL, &size, &type, NULL);
     299
     300    return crStateGetUniformSize(&cr_server.StateTracker, type);
    301301}
    302302
     
    316316    }
    317317
    318     cr_server.head_spu->dispatch_table.GetUniformfv(crStateGetProgramHWID(program), location, pLocal);
     318    cr_server.head_spu->dispatch_table.GetUniformfv(crStateGetProgramHWID(&cr_server.StateTracker, program), location, pLocal);
    319319
    320320    crServerReturnValue(pLocal, size);
     
    337337    }
    338338
    339     cr_server.head_spu->dispatch_table.GetUniformiv(crStateGetProgramHWID(program), location, pLocal);
     339    cr_server.head_spu->dispatch_table.GetUniformiv(crStateGetProgramHWID(&cr_server.StateTracker, program), location, pLocal);
    340340
    341341    crServerReturnValue(pLocal, size);
     
    347347    GLuint retval, hwVal;
    348348    hwVal = cr_server.head_spu->dispatch_table.CreateShader(type);
    349     retval = crStateCreateShader(hwVal, type);
     349    retval = crStateCreateShader(&cr_server.StateTracker, hwVal, type);
    350350    crServerReturnValue(&retval, sizeof(retval));
    351351    return retval; /* ignored */
     
    356356    GLuint retval, hwVal;
    357357    hwVal = cr_server.head_spu->dispatch_table.CreateProgram();
    358     retval = crStateCreateProgram(hwVal);
     358    retval = crStateCreateProgram(&cr_server.StateTracker, hwVal);
    359359    crServerReturnValue(&retval, sizeof(retval));
    360360    return retval; /* ignored */
     
    364364{
    365365    GLboolean retval;
    366     retval = cr_server.head_spu->dispatch_table.IsShader(crStateGetShaderHWID(shader));
     366    retval = cr_server.head_spu->dispatch_table.IsShader(crStateGetShaderHWID(&cr_server.StateTracker, shader));
    367367    crServerReturnValue(&retval, sizeof(retval));
    368368    return retval; /* ignored */
     
    372372{
    373373    GLboolean retval;
    374     retval = cr_server.head_spu->dispatch_table.IsProgram(crStateGetProgramHWID(program));
     374    retval = cr_server.head_spu->dispatch_table.IsProgram(crStateGetProgramHWID(&cr_server.StateTracker, program));
    375375    crServerReturnValue(&retval, sizeof(retval));
    376376    return retval; /* ignored */
     
    380380{
    381381    GLfloat local_params[1] = {0};
    382     GLuint hwid = crStateGetProgramHWID(obj);
     382    GLuint hwid = crStateGetProgramHWID(&cr_server.StateTracker, obj);
    383383    (void) params;
    384384
    385385    if (!hwid)
    386386    {
    387         hwid = crStateGetShaderHWID(obj);
     387        hwid = crStateGetShaderHWID(&cr_server.StateTracker, obj);
    388388        if (!hwid)
    389389        {
     
    399399{
    400400    GLint local_params[1] = {0};
    401     GLuint hwid = crStateGetProgramHWID(obj);
     401    GLuint hwid = crStateGetProgramHWID(&cr_server.StateTracker, obj);
    402402    if (!hwid)
    403403    {
    404         hwid = crStateGetShaderHWID(obj);
     404        hwid = crStateGetShaderHWID(&cr_server.StateTracker, obj);
    405405        if (!hwid)
    406406        {
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