VirtualBox

Ignore:
Timestamp:
Aug 20, 2010 9:40:40 AM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: resource sharing between contexts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c

    r16969 r31808  
    185185                activeUnit = i;
    186186            }
    187             if (from->unit[i].currentTexture1D->name != to->unit[i].currentTexture1D->name)
    188             {
    189                 diff_api.BindTexture(GL_TEXTURE_1D, to->unit[i].currentTexture1D->name);
     187            if (from->unit[i].currentTexture1D->id != to->unit[i].currentTexture1D->id)
     188            {
     189                diff_api.BindTexture(GL_TEXTURE_1D, crStateGetTextureObjHWID(to->unit[i].currentTexture1D));
    190190                FILLDIRTY(tb->current[i]);
    191191                FILLDIRTY(tb->dirty);
    192192            }
    193             if (from->unit[i].currentTexture2D->name != to->unit[i].currentTexture2D->name)
    194             {
    195                 diff_api.BindTexture(GL_TEXTURE_2D, to->unit[i].currentTexture2D->name);
     193            if (from->unit[i].currentTexture2D->id != to->unit[i].currentTexture2D->id)
     194            {
     195                diff_api.BindTexture(GL_TEXTURE_2D, crStateGetTextureObjHWID(to->unit[i].currentTexture2D));
    196196                FILLDIRTY(tb->current[i]);
    197197                FILLDIRTY(tb->dirty);
    198198            }
    199199#ifdef CR_OPENGL_VERSION_1_2
    200             if (from->unit[i].currentTexture3D->name != to->unit[i].currentTexture3D->name) {
    201                 diff_api.BindTexture(GL_TEXTURE_3D, to->unit[i].currentTexture3D->name);
     200            if (from->unit[i].currentTexture3D->id != to->unit[i].currentTexture3D->id) {
     201                diff_api.BindTexture(GL_TEXTURE_3D, crStateGetTextureObjHWID(to->unit[i].currentTexture3D));
    202202                FILLDIRTY(tb->current[i]);
    203203                FILLDIRTY(tb->dirty);
     
    206206#ifdef CR_ARB_texture_cube_map
    207207            if (fromCtx->extensions.ARB_texture_cube_map &&
    208                 from->unit[i].currentTextureCubeMap->name != to->unit[i].currentTextureCubeMap->name) {
    209                 diff_api.BindTexture(GL_TEXTURE_CUBE_MAP_ARB, to->unit[i].currentTextureCubeMap->name);
     208                from->unit[i].currentTextureCubeMap->id != to->unit[i].currentTextureCubeMap->id) {
     209                diff_api.BindTexture(GL_TEXTURE_CUBE_MAP_ARB, crStateGetTextureObjHWID(to->unit[i].currentTextureCubeMap));
    210210                FILLDIRTY(tb->current[i]);
    211211                FILLDIRTY(tb->dirty);
     
    214214#ifdef CR_NV_texture_rectangle
    215215            if (fromCtx->extensions.NV_texture_rectangle &&
    216                 from->unit[i].currentTextureRect->name != to->unit[i].currentTextureRect->name) {
    217                 diff_api.BindTexture(GL_TEXTURE_RECTANGLE_NV, to->unit[i].currentTextureRect->name);
     216                from->unit[i].currentTextureRect->id != to->unit[i].currentTextureRect->id) {
     217                diff_api.BindTexture(GL_TEXTURE_RECTANGLE_NV, crStateGetTextureObjHWID(to->unit[i].currentTextureRect));
    218218                FILLDIRTY(tb->current[i]);
    219219                FILLDIRTY(tb->dirty);
     
    616616#endif
    617617
    618     diff_api.BindTexture( tobj->target, tobj->name );
     618    diff_api.BindTexture(tobj->target, crStateGetTextureObjHWID(tobj));
    619619
    620620    if (alwaysDirty || CHECKDIRTY(tobj->paramsBit[u], bitID))
     
    13041304                if (*fromBinding != tobj)
    13051305                {
    1306                     diff_api.BindTexture(tobj->target, tobj->name);
     1306                    diff_api.BindTexture(tobj->target, crStateGetTextureObjHWID(tobj));
    13071307                    *fromBinding = tobj;
    13081308                }
     
    13891389    /* save current texture bindings */
    13901390    origUnit = g->texture.curTextureUnit;
    1391     orig1D = g->texture.unit[0].currentTexture1D->name;
    1392     orig2D = g->texture.unit[0].currentTexture2D->name;
    1393     orig3D = g->texture.unit[0].currentTexture3D->name;
     1391    orig1D = crStateGetTextureObjHWID(g->texture.unit[0].currentTexture1D);
     1392    orig2D = crStateGetTextureObjHWID(g->texture.unit[0].currentTexture2D);
     1393    orig3D = crStateGetTextureObjHWID(g->texture.unit[0].currentTexture3D);
    13941394#ifdef CR_ARB_texture_cube_map
    1395     origCube = g->texture.unit[0].currentTextureCubeMap->name;
     1395    origCube = crStateGetTextureObjHWID(g->texture.unit[0].currentTextureCubeMap);
    13961396#endif
    13971397#ifdef CR_NV_texture_rectangle
    1398     origRect = g->texture.unit[0].currentTextureRect->name;
     1398    origRect = crStateGetTextureObjHWID(g->texture.unit[0].currentTextureRect);
    13991399#endif
    14001400
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