VirtualBox

Changeset 39869 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jan 25, 2012 7:02:14 AM (13 years ago)
Author:
vboxsync
Message:

wine/d3d: proper habdling of context destruction and tls stuff

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

Legend:

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

    r39602 r39869  
    10821082{
    10831083    struct wined3d_context *ctx = vboxGetCurrentContext();
     1084    if (ctx && !VBoxTlsRefIsFunctional(ctx))
     1085    {
     1086        /* this is a destroyed context left in the tls of the current thread */
     1087        /* 1. this releases the context and clears the tls */
     1088        vboxSetCurrentContext(NULL);
     1089        /* return there is no context current */
     1090        return NULL;
     1091    }
    10841092    if (!adjustTid)
    10851093        return ctx;
     
    15051513{
    15061514    struct wined3d_context * context = (struct wined3d_context *)pvCtx;
    1507     context_destroy_gl_resources(context);
    15081515    HeapFree(GetProcessHeap(), 0, context);
    15091516}
     
    19932000        destroy = FALSE;
    19942001    }
     2002#else
     2003    context_destroy_gl_resources(context);
    19952004#endif
    19962005
     
    19982007    HeapFree(GetProcessHeap(), 0, context->pshader_const_dirty);
    19992008    device_context_remove(This, context);
    2000 #ifndef VBOX_WITH_WDDM
    2001     context->swapchain = NULL;
    2002 #endif
    20032009#if !defined(VBOX_WINE_WITH_SINGLE_CONTEXT) && !defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
    20042010    if (destroy) HeapFree(GetProcessHeap(), 0, context);
    20052011#else
     2012# ifndef VBOX_WITH_WDDM
     2013    context->swapchain = NULL;
     2014#else
     2015    context->currentSwapchain = NULL;
     2016    context->device = NULL;
     2017# endif
     2018    VBoxTlsRefMarkDestroy(context);
    20062019    VBoxTlsRefRelease(context);
    20072020#endif
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c

    r39602 r39869  
    139139        This->backBuffer = NULL;
    140140    }
    141 #if 0
     141#ifndef VBOX_WINE_WITH_SINGLE_CONTEXT
    142142    for (i = 0; i < This->num_contexts; ++i)
    143143    {
    144144        context_destroy(This->device, This->context[i]);
    145145    }
    146 #else
     146#endif
    147147
    148148#ifdef VBOX_WITH_WDDM
     
    158158    IWineD3DDevice_RemoveSwapChain((IWineD3DDevice*)This->device, (IWineD3DSwapChain*)This);
    159159    if (!This->device->NumberOfSwapChains)
    160 #endif
    161160    {
    162161        /* Restore the screen resolution if we rendered in fullscreen
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