VirtualBox

Changeset 40481 in vbox for trunk


Ignore:
Timestamp:
Mar 15, 2012 2:18:38 PM (13 years ago)
Author:
vboxsync
Message:

wined3d: shared resource cleanup fixes

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c

    r40388 r40481  
    248248static HRESULT WINAPI IWineD3DCubeTextureImpl_SetShRcState(IWineD3DCubeTexture *iface, VBOXWINEEX_SHRC_STATE enmState) {
    249249    IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl*)iface;
     250    struct wined3d_context *context = NULL;
    250251    HRESULT hr = IWineD3DResourceImpl_SetShRcState((IWineD3DResource*)iface, enmState);
    251252    unsigned int i, j;
     
    266267    }
    267268
     269    if (!This->resource.device->isInDraw)
     270    {
     271        context = context_acquire(This->resource.device, NULL, CTXUSAGE_RESOURCELOAD);
     272        if (!context)
     273        {
     274            ERR("zero context!");
     275            return E_FAIL;
     276        }
     277
     278        if (!context->valid)
     279        {
     280            ERR("context invalid!");
     281            context_release(context);
     282            return E_FAIL;
     283        }
     284    }
     285
    268286    device_cleanup_durtify_texture_target(This->resource.device, ((IWineD3DSurfaceImpl*)This->surfaces[j][i])->texture_target);
     287
     288    if (context)
     289        context_release(context);
    269290
    270291    return WINED3D_OK;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c

    r40388 r40481  
    53535353    IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl*)iface;
    53545354    IWineD3DBaseTextureImpl *texture = NULL;
     5355    struct wined3d_context *context = NULL;
    53555356    HRESULT hr;
    53565357    unsigned int i;
     
    53925393
    53935394    if (!texture)
     5395    {
     5396        if (!This->resource.device->isInDraw)
     5397        {
     5398            context = context_acquire(This->resource.device, NULL, CTXUSAGE_RESOURCELOAD);
     5399            if (!context)
     5400            {
     5401                ERR("zero context!");
     5402                return E_FAIL;
     5403            }
     5404
     5405            if (!context->valid)
     5406            {
     5407                ERR("context invalid!");
     5408                context_release(context);
     5409                return E_FAIL;
     5410            }
     5411        }
     5412
    53945413        device_cleanup_durtify_texture_target(This->resource.device, This->texture_target);
     5414
     5415        if (context)
     5416            context_release(context);
     5417    }
    53955418
    53965419    return WINED3D_OK;
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c

    r40388 r40481  
    234234static HRESULT WINAPI IWineD3DTextureImpl_SetShRcState(IWineD3DTexture *iface, VBOXWINEEX_SHRC_STATE enmState) {
    235235    IWineD3DTextureImpl *This = (IWineD3DTextureImpl*)iface;
     236    struct wined3d_context *context = NULL;
    236237    HRESULT hr = IWineD3DResourceImpl_SetShRcState((IWineD3DResource*)iface, enmState);
    237238    unsigned int i;
     
    252253    }
    253254
     255    if (!This->resource.device->isInDraw)
     256    {
     257        context = context_acquire(This->resource.device, NULL, CTXUSAGE_RESOURCELOAD);
     258        if (!context)
     259        {
     260            ERR("zero context!");
     261            return E_FAIL;
     262        }
     263
     264        if (!context->valid)
     265        {
     266            ERR("context invalid!");
     267            context_release(context);
     268            return E_FAIL;
     269        }
     270    }
     271
    254272    device_cleanup_durtify_texture_target(This->resource.device, This->target);
     273
     274    if (context)
     275        context_release(context);
    255276
    256277    return WINED3D_OK;
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