VirtualBox

Changeset 55013 in vbox


Ignore:
Timestamp:
Mar 30, 2015 5:03:12 PM (9 years ago)
Author:
vboxsync
Message:

Host 3D: crServer: move things in place: texture-related stuff -> server_texture.c.

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_lists.c

    r54934 r55013  
    281281
    282282
    283 void SERVER_DISPATCH_APIENTRY crServerDispatchBindTexture( GLenum target, GLuint texture )
    284 {
    285     crStateBindTexture( target, texture );
    286     cr_server.head_spu->dispatch_table.BindTexture(target, crStateGetTextureHWID(texture));
    287 }
    288 
    289 void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteTextures( GLsizei n, const GLuint *textures)
    290 {
    291     GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));
    292     GLint i;
    293 
    294     if (!newTextures)
    295     {
    296         crError("crServerDispatchDeleteTextures: out of memory");
    297         return;
    298     }
    299 
    300     for (i = 0; i < n; i++)
    301     {
    302         newTextures[i] = crStateGetTextureHWID(textures[i]);
    303     }
    304 
    305 //    for (i = 0; i < n; ++i)
    306 //    {
    307 //        crDebug("DeleteTexture: %d, pid %d, ctx %d", textures[i], (uint32_t)cr_server.curClient->pid, cr_server.currentCtxInfo->pContext->id);
    308 //    }
    309 
    310 
    311     crStateDeleteTextures(n, textures);
    312     cr_server.head_spu->dispatch_table.DeleteTextures(n, newTextures);
    313     crFree(newTextures);
    314 }
    315 
    316 void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities )
    317 {
    318     GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));
    319     GLint i;
    320 
    321     if (!newTextures)
    322     {
    323         crError("crServerDispatchDeleteTextures: out of memory");
    324         return;
    325     }
    326 
    327     crStatePrioritizeTextures(n, textures, priorities);
    328 
    329     for (i = 0; i < n; i++)
    330     {
    331         newTextures[i] = crStateGetTextureHWID(textures[i]);
    332     }
    333 
    334     cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities);
    335     crFree(newTextures);
    336 }
    337 
    338283void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgramsARB(GLsizei n, const GLuint * programs)
    339284{
     
    352297}
    353298
    354 /*@todo will fail for textures loaded from snapshot */
    355 GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsTexture( GLuint texture )
    356 {
    357     GLboolean retval;
    358     retval = cr_server.head_spu->dispatch_table.IsTexture(crStateGetTextureHWID(texture));
    359     crServerReturnValue( &retval, sizeof(retval) );
    360     return retval; /* WILL PROBABLY BE IGNORED */
    361 }
    362 
    363299/*@todo will fail for progs loaded from snapshot */
    364300GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsProgramARB( GLuint program )
     
    368304    retval = cr_server.head_spu->dispatch_table.IsProgramARB( program );
    369305    crServerReturnValue( &retval, sizeof(retval) );
    370     return retval; /* WILL PROBABLY BE IGNORED */
    371 }
    372 
    373 GLboolean SERVER_DISPATCH_APIENTRY
    374 crServerDispatchAreTexturesResident(GLsizei n, const GLuint *textures,
    375                                     GLboolean *residences)
    376 {
    377     GLboolean retval;
    378     GLsizei i;
    379     GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
    380     GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint));
    381 
    382     (void) residences;
    383        
    384     for (i = 0; i < n; i++)
    385     {
    386         textures2[i] = crStateGetTextureHWID(textures[i]);
    387     }
    388     retval = cr_server.head_spu->dispatch_table.AreTexturesResident(n, textures2, res);
    389 
    390     crFree(textures2);
    391 
    392     crServerReturnValue(res, n * sizeof(GLboolean));
    393 
    394     crFree(res);
    395 
    396306    return retval; /* WILL PROBABLY BE IGNORED */
    397307}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_texture.c

    r50041 r55013  
    2121#include "server_dispatch.h"
    2222#include "server.h"
     23#include "cr_mem.h"
    2324
    2425#define CR_NOTHING()
     
    190191    crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLint) );
    191192}
     193
     194void SERVER_DISPATCH_APIENTRY crServerDispatchBindTexture( GLenum target, GLuint texture )
     195{
     196    crStateBindTexture( target, texture );
     197    cr_server.head_spu->dispatch_table.BindTexture(target, crStateGetTextureHWID(texture));
     198}
     199
     200
     201void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteTextures( GLsizei n, const GLuint *textures)
     202{
     203    GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));
     204    GLint i;
     205
     206    if (!newTextures)
     207    {
     208        crError("crServerDispatchDeleteTextures: out of memory");
     209        return;
     210    }
     211
     212    for (i = 0; i < n; i++)
     213    {
     214        newTextures[i] = crStateGetTextureHWID(textures[i]);
     215    }
     216
     217//    for (i = 0; i < n; ++i)
     218//    {
     219//        crDebug("DeleteTexture: %d, pid %d, ctx %d", textures[i], (uint32_t)cr_server.curClient->pid, cr_server.currentCtxInfo->pContext->id);
     220//    }
     221
     222
     223    crStateDeleteTextures(n, textures);
     224    cr_server.head_spu->dispatch_table.DeleteTextures(n, newTextures);
     225    crFree(newTextures);
     226}
     227
     228
     229void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities )
     230{
     231    GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));
     232    GLint i;
     233
     234    if (!newTextures)
     235    {
     236        crError("crServerDispatchDeleteTextures: out of memory");
     237        return;
     238    }
     239
     240    crStatePrioritizeTextures(n, textures, priorities);
     241
     242    for (i = 0; i < n; i++)
     243    {
     244        newTextures[i] = crStateGetTextureHWID(textures[i]);
     245    }
     246
     247    cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities);
     248    crFree(newTextures);
     249}
     250
     251
     252/*@todo will fail for textures loaded from snapshot */
     253GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsTexture( GLuint texture )
     254{
     255    GLboolean retval;
     256    retval = cr_server.head_spu->dispatch_table.IsTexture(crStateGetTextureHWID(texture));
     257    crServerReturnValue( &retval, sizeof(retval) );
     258    return retval; /* WILL PROBABLY BE IGNORED */
     259}
     260
     261
     262GLboolean SERVER_DISPATCH_APIENTRY
     263crServerDispatchAreTexturesResident(GLsizei n, const GLuint *textures,
     264                                    GLboolean *residences)
     265{
     266    GLboolean retval;
     267    GLsizei i;
     268    GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
     269    GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint));
     270
     271    (void) residences;
     272
     273    for (i = 0; i < n; i++)
     274    {
     275        textures2[i] = crStateGetTextureHWID(textures[i]);
     276    }
     277    retval = cr_server.head_spu->dispatch_table.AreTexturesResident(n, textures2, res);
     278
     279    crFree(textures2);
     280
     281    crServerReturnValue(res, n * sizeof(GLboolean));
     282
     283    crFree(res);
     284
     285    return retval; /* WILL PROBABLY BE IGNORED */
     286}
     287
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