VirtualBox

Ignore:
Timestamp:
Jun 29, 2009 3:28:23 PM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: fix random texture corruption

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

Legend:

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

    r15532 r21033  
    310310}
    311311
     312void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities )
     313{
     314    if (!cr_server.sharedTextureObjects)
     315    {
     316        GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));
     317        GLint i;
     318        if (!newTextures) {
     319            crError("crServerDispatchDeleteTextures: out of memory");
     320            return;
     321        }
     322        for (i = 0; i < n; i++) {
     323            newTextures[i] = crServerTranslateTextureID( textures[i] );
     324        }
     325        crStatePrioritizeTextures(n, newTextures, priorities);
     326        cr_server.head_spu->dispatch_table.PrioritizeTextures(n, newTextures, priorities);
     327        crFree(newTextures);
     328    }
     329    else
     330    {
     331        crStatePrioritizeTextures(n, textures, priorities);
     332        cr_server.head_spu->dispatch_table.PrioritizeTextures(n, textures, priorities);
     333    }
     334}
     335
    312336void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteProgramsARB(GLsizei n, const GLuint * programs)
    313337{
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py

    r20916 r21033  
    5050    print '\tget_values = (%s *) crAlloc( tablesize );' % types[index]
    5151    print '\tcr_server.head_spu->dispatch_table.%s( pname, get_values );' % func_name
     52    print """
     53    if (GL_TEXTURE_BINDING_1D==pname
     54        || GL_TEXTURE_BINDING_2D==pname
     55        || GL_TEXTURE_BINDING_3D==pname
     56        || GL_TEXTURE_BINDING_RECTANGLE_ARB==pname
     57        || GL_TEXTURE_BINDING_CUBE_MAP_ARB==pname)
     58    {
     59        GLuint texid;
     60        CRASSERT(tablesize/sizeof(%s)==1);
     61        texid = (GLuint) *get_values;
     62        *get_values = (%s) crServerTranslateTextureID(texid);
     63    }
     64    """ % (types[index], types[index])
    5265    print '\tcrServerReturnValue( get_values, tablesize );'
    5366    print '\tcrFree(get_values);'
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special

    r20467 r21033  
    131131IsTexture
    132132AreTexturesResident
     133PrioritizeTextures
    133134AreProgramsResidentNV
    134135GenProgramsARB
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