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/HostServices/SharedOpenGL/crserverlib/server_glsl.cpp

    r78190 r78375  
    3232    GLenum err = cr_server.head_spu->dispatch_table.GetError();
    3333#endif
    34     cr_server.head_spu->dispatch_table.ShaderSource(crStateGetShaderHWID(shader), count, string, length);
     34    cr_server.head_spu->dispatch_table.ShaderSource(crStateGetShaderHWID(&cr_server.StateTracker, shader), count, string, length);
    3535#ifdef DEBUG_misha
    3636    err = cr_server.head_spu->dispatch_table.GetError();
     
    4545    GLint iCompileStatus = GL_FALSE;
    4646#endif
    47     crStateCompileShader(shader);
    48     cr_server.head_spu->dispatch_table.CompileShader(crStateGetShaderHWID(shader));
    49 #ifdef DEBUG_misha
    50     cr_server.head_spu->dispatch_table.GetShaderiv(crStateGetShaderHWID(shader), GL_COMPILE_STATUS, &iCompileStatus);
     47    crStateCompileShader(&cr_server.StateTracker, shader);
     48    cr_server.head_spu->dispatch_table.CompileShader(crStateGetShaderHWID(&cr_server.StateTracker, shader));
     49#ifdef DEBUG_misha
     50    cr_server.head_spu->dispatch_table.GetShaderiv(crStateGetShaderHWID(&cr_server.StateTracker, shader), GL_COMPILE_STATUS, &iCompileStatus);
    5151    Assert(iCompileStatus == GL_TRUE);
    5252#endif
     
    5656void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteShader(GLuint shader)
    5757{
    58     GLuint shaderHW = crStateGetShaderHWID(shader);
    59     crStateDeleteShader(shader);
     58    GLuint shaderHW = crStateGetShaderHWID(&cr_server.StateTracker, shader);
     59    crStateDeleteShader(&cr_server.StateTracker, shader);
    6060    if (shaderHW)
    6161        cr_server.head_spu->dispatch_table.DeleteShader(shaderHW);
     
    6666void SERVER_DISPATCH_APIENTRY crServerDispatchAttachShader(GLuint program, GLuint shader)
    6767{
    68     crStateAttachShader(program, shader);
    69     cr_server.head_spu->dispatch_table.AttachShader(crStateGetProgramHWID(program), crStateGetShaderHWID(shader));
     68    crStateAttachShader(&cr_server.StateTracker, program, shader);
     69    cr_server.head_spu->dispatch_table.AttachShader(crStateGetProgramHWID(&cr_server.StateTracker, program),
     70                                                    crStateGetShaderHWID(&cr_server.StateTracker, shader));
    7071}
    7172
    7273void SERVER_DISPATCH_APIENTRY crServerDispatchDetachShader(GLuint program, GLuint shader)
    7374{
    74     crStateDetachShader(program, shader);
    75     cr_server.head_spu->dispatch_table.DetachShader(crStateGetProgramHWID(program), crStateGetShaderHWID(shader));
     75    crStateDetachShader(&cr_server.StateTracker, program, shader);
     76    cr_server.head_spu->dispatch_table.DetachShader(crStateGetProgramHWID(&cr_server.StateTracker, program),
     77                                                    crStateGetShaderHWID(&cr_server.StateTracker, shader));
    7678}
    7779
    7880void SERVER_DISPATCH_APIENTRY crServerDispatchLinkProgram(GLuint program)
    7981{
    80     crStateLinkProgram(program);
    81     cr_server.head_spu->dispatch_table.LinkProgram(crStateGetProgramHWID(program));
     82    crStateLinkProgram(&cr_server.StateTracker, program);
     83    cr_server.head_spu->dispatch_table.LinkProgram(crStateGetProgramHWID(&cr_server.StateTracker, program));
    8284    CR_SERVER_DUMP_LINK_PROGRAM(program);
    8385}
     
    8587void SERVER_DISPATCH_APIENTRY crServerDispatchUseProgram(GLuint program)
    8688{
    87     crStateUseProgram(program);
    88     cr_server.head_spu->dispatch_table.UseProgram(crStateGetProgramHWID(program));
     89    crStateUseProgram(&cr_server.StateTracker, program);
     90    cr_server.head_spu->dispatch_table.UseProgram(crStateGetProgramHWID(&cr_server.StateTracker, program));
    8991}
    9092
    9193void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgram(GLuint program)
    9294{
    93     GLuint hwId = crStateGetProgramHWID(program);
    94     crStateDeleteProgram(program);
     95    GLuint hwId = crStateGetProgramHWID(&cr_server.StateTracker, program);
     96    crStateDeleteProgram(&cr_server.StateTracker, program);
    9597    if (hwId)
    9698        cr_server.head_spu->dispatch_table.DeleteProgram(hwId);
     
    101103void SERVER_DISPATCH_APIENTRY crServerDispatchValidateProgram(GLuint program)
    102104{
    103     crStateValidateProgram(program);
    104     cr_server.head_spu->dispatch_table.ValidateProgram(crStateGetProgramHWID(program));
     105    crStateValidateProgram(&cr_server.StateTracker, program);
     106    cr_server.head_spu->dispatch_table.ValidateProgram(crStateGetProgramHWID(&cr_server.StateTracker, program));
    105107}
    106108
    107109void SERVER_DISPATCH_APIENTRY crServerDispatchBindAttribLocation(GLuint program, GLuint index, const char * name)
    108110{
    109     crStateBindAttribLocation(program, index, name);
    110     cr_server.head_spu->dispatch_table.BindAttribLocation(crStateGetProgramHWID(program), index, name);
     111    crStateBindAttribLocation(&cr_server.StateTracker, program, index, name);
     112    cr_server.head_spu->dispatch_table.BindAttribLocation(crStateGetProgramHWID(&cr_server.StateTracker, program), index, name);
    111113}
    112114
    113115void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteObjectARB(VBoxGLhandleARB obj)
    114116{
    115     GLuint hwid =  crStateDeleteObjectARB(obj);
     117    GLuint hwid =  crStateDeleteObjectARB(&cr_server.StateTracker, obj);
    116118
    117119    if (hwid)
     
    124126{
    125127    GLint retval;
    126     retval = cr_server.head_spu->dispatch_table.GetAttribLocation(crStateGetProgramHWID(program), name );
     128    retval = cr_server.head_spu->dispatch_table.GetAttribLocation(crStateGetProgramHWID(&cr_server.StateTracker, program), name );
    127129    crServerReturnValue( &retval, sizeof(retval) );
    128130    return retval; /* WILL PROBABLY BE IGNORED */
     
    135137    if (pname==GL_PROGRAM_OBJECT_ARB)
    136138    {
    137         retval = crStateGLSLProgramHWIDtoID(retval);
     139        retval = crStateGLSLProgramHWIDtoID(&cr_server.StateTracker, retval);
    138140    }
    139141    crServerReturnValue( &retval, sizeof(retval) );
     
    144146{
    145147    GLint retval;
    146     retval = cr_server.head_spu->dispatch_table.GetUniformLocation(crStateGetProgramHWID(program), name);
     148    retval = cr_server.head_spu->dispatch_table.GetUniformLocation(crStateGetProgramHWID(&cr_server.StateTracker, program), name);
    147149    crServerReturnValue( &retval, sizeof(retval) );
    148150    return retval; /* WILL PROBABLY BE IGNORED */
     
    153155    GLint local_params[1] = {0};
    154156    (void) params;
    155     cr_server.head_spu->dispatch_table.GetProgramiv(crStateGetProgramHWID(program), pname, local_params);
     157    cr_server.head_spu->dispatch_table.GetProgramiv(crStateGetProgramHWID(&cr_server.StateTracker, program), pname, local_params);
    156158    crServerReturnValue( &(local_params[0]), 1*sizeof(GLint) );
    157159}
     
    161163    GLint local_params[1] = {0};
    162164    (void) params;
    163     cr_server.head_spu->dispatch_table.GetShaderiv( crStateGetShaderHWID(shader), pname, local_params );
     165    cr_server.head_spu->dispatch_table.GetShaderiv( crStateGetShaderHWID(&cr_server.StateTracker, shader), pname, local_params );
    164166    crServerReturnValue( &(local_params[0]), 1*sizeof(GLint) );
    165167}
     
    197199        pLocalProgs[i] = crServerTranslateProgramID(programs[i]);
    198200    }
    199     crStateDeleteProgramsARB(n, pLocalProgs);
     201    crStateDeleteProgramsARB(&cr_server.StateTracker, n, pLocalProgs);
    200202    cr_server.head_spu->dispatch_table.DeleteProgramsARB(n, pLocalProgs);
    201203    crFree(pLocalProgs);
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