VirtualBox

儲存庫 vbox 的更動 55014


忽略:
時間撮記:
2015-3-30 下午05:35:12 (10 年 以前)
作者:
vboxsync
訊息:

Host 3D: crServer: move things in place: shader-related stuff from server_lists.c -> server_glsl.c.

位置:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c

    r50041 r55014  
    166166}
    167167#endif /* #ifdef CR_OPENGL_VERSION_2_0 */
     168
     169/* XXXX Note: shared/separate Program ID numbers aren't totally implemented! */
     170GLuint crServerTranslateProgramID( GLuint id )
     171{
     172    if (!cr_server.sharedPrograms && id) {
     173        int client = cr_server.curClient->number;
     174        return id + client * 100000;
     175    }
     176    return id;
     177}
     178
     179
     180void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgramsARB(GLsizei n, const GLuint * programs)
     181{
     182    GLuint *pLocalProgs = (GLuint *) crAlloc(n * sizeof(GLuint));
     183    GLint i;
     184    if (!pLocalProgs) {
     185        crError("crServerDispatchDeleteProgramsARB: out of memory");
     186        return;
     187    }
     188    for (i = 0; i < n; i++) {
     189        pLocalProgs[i] = crServerTranslateProgramID(programs[i]);
     190    }
     191    crStateDeleteProgramsARB(n, pLocalProgs);
     192    cr_server.head_spu->dispatch_table.DeleteProgramsARB(n, pLocalProgs);
     193    crFree(pLocalProgs);
     194}
     195
     196
     197/*@todo will fail for progs loaded from snapshot */
     198GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsProgramARB( GLuint program )
     199{
     200    GLboolean retval;
     201    program = crServerTranslateProgramID(program);
     202    retval = cr_server.head_spu->dispatch_table.IsProgramARB( program );
     203    crServerReturnValue( &retval, sizeof(retval) );
     204    return retval; /* WILL PROBABLY BE IGNORED */
     205}
     206
     207
     208GLboolean SERVER_DISPATCH_APIENTRY
     209crServerDispatchAreProgramsResidentNV(GLsizei n, const GLuint *programs,
     210                                                                            GLboolean *residences)
     211{
     212    GLboolean retval;
     213    GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
     214    GLsizei i;
     215
     216    (void) residences;
     217
     218    if (!cr_server.sharedTextureObjects) {
     219        GLuint *programs2 = (GLuint *) crAlloc(n * sizeof(GLuint));
     220        for (i = 0; i < n; i++)
     221            programs2[i] = crServerTranslateProgramID(programs[i]);
     222        retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs2, res);
     223        crFree(programs2);
     224    }
     225    else {
     226        retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs, res);
     227    }
     228
     229    crServerReturnValue(res, n * sizeof(GLboolean));
     230    crFree(res);
     231
     232    return retval; /* WILL PROBABLY BE IGNORED */
     233}
     234
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_lists.c

    r55013 r55014  
    4747}
    4848
    49 /* XXXX Note: shared/separate Program ID numbers aren't totally implemented! */
    50 GLuint crServerTranslateProgramID( GLuint id )
    51 {
    52     if (!cr_server.sharedPrograms && id) {
    53         int client = cr_server.curClient->number;
    54         return id + client * 100000;
    55     }
    56     return id;
    57 }
    5849
    5950GLuint SERVER_DISPATCH_APIENTRY crServerDispatchGenLists( GLsizei range )
     
    279270    cr_server.head_spu->dispatch_table.DeleteLists( list, range );
    280271}
    281 
    282 
    283 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgramsARB(GLsizei n, const GLuint * programs)
    284 {
    285     GLuint *pLocalProgs = (GLuint *) crAlloc(n * sizeof(GLuint));
    286     GLint i;
    287     if (!pLocalProgs) {
    288         crError("crServerDispatchDeleteProgramsARB: out of memory");
    289         return;
    290     }
    291     for (i = 0; i < n; i++) {
    292         pLocalProgs[i] = crServerTranslateProgramID(programs[i]);
    293     }
    294     crStateDeleteProgramsARB(n, pLocalProgs);
    295     cr_server.head_spu->dispatch_table.DeleteProgramsARB(n, pLocalProgs);
    296     crFree(pLocalProgs);
    297 }
    298 
    299 /*@todo will fail for progs loaded from snapshot */
    300 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsProgramARB( GLuint program )
    301 {
    302     GLboolean retval;
    303     program = crServerTranslateProgramID(program);
    304     retval = cr_server.head_spu->dispatch_table.IsProgramARB( program );
    305     crServerReturnValue( &retval, sizeof(retval) );
    306     return retval; /* WILL PROBABLY BE IGNORED */
    307 }
    308 
    309 
    310 GLboolean SERVER_DISPATCH_APIENTRY
    311 crServerDispatchAreProgramsResidentNV(GLsizei n, const GLuint *programs,
    312                                                                             GLboolean *residences)
    313 {
    314     GLboolean retval;
    315     GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
    316     GLsizei i;
    317 
    318     (void) residences;
    319 
    320     if (!cr_server.sharedTextureObjects) {
    321         GLuint *programs2 = (GLuint *) crAlloc(n * sizeof(GLuint));
    322         for (i = 0; i < n; i++)
    323             programs2[i] = crServerTranslateProgramID(programs[i]);
    324         retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs2, res);
    325         crFree(programs2);
    326     }
    327     else {
    328         retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs, res);
    329     }
    330 
    331     crServerReturnValue(res, n * sizeof(GLboolean));
    332     crFree(res);
    333 
    334     return retval; /* WILL PROBABLY BE IGNORED */
    335 }
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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