VirtualBox

Ignore:
Timestamp:
Dec 14, 2011 11:12:17 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75376
Message:

wine/XPDM: 1. Additional swapchain creation fixes 2. De-libwine'ize wined3d 3. Single context per swapchain 4. wine & crOgl current context sync fixes 5. Proper Get/ReleaseDC handling

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/context.c

    r39568 r39602  
    397397
    398398#ifdef CHROMIUM_THREADSAFE
    399     crTSDRefInit(context, stubContextDtor);
     399    VBoxTlsRefInit(context, stubContextDtor);
    400400#endif
    401401
     
    11921192    }
    11931193
    1194     crTSDRefRelease(context);
     1194    VBoxTlsRefRelease(context);
    11951195#else
    11961196    stubDestroyContextLocked(context);
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r39568 r39602  
    2727# include <unistd.h>
    2828#endif
    29 #ifdef CHROMIUM_THREADSAFE
    30 #include "cr_threads.h"
    31 #endif
    3229
    3330#ifdef VBOX_WITH_WDDM
     
    6966Stub stub;
    7067#ifdef CHROMIUM_THREADSAFE
     68static bool g_stubIsCurrentContextTSDInited;
    7169CRtsd g_stubCurrentContextTSD;
    7270#endif
     
    510508    exit(0);  /* this causes stubExitHandler() to be called */
    511509}
     510
     511#ifndef RT_OS_WINDOWS
     512# ifdef CHROMIUM_THREADSAFE
     513static DECLCALLBACK(void) stubThreadTlsDtor(void *pvValue)
     514{
     515    ContextInfo *pCtx = (ContextInfo*)pvValue;
     516    VBoxTlsRefRelease(pCtx);
     517}
     518# endif
     519#endif
    512520
    513521
     
    547555#ifndef RT_OS_WINDOWS
    548556# ifdef CHROMIUM_THREADSAFE
    549     crInitTSD(&g_stubCurrentContextTSD);
     557    if (!g_stubIsCurrentContextTSDInited)
     558    {
     559        crInitTSDF(&g_stubCurrentContextTSD, stubThreadTlsDtor);
     560        g_stubIsCurrentContextTSDInited = true;
     561    }
    550562# endif
    551563#endif
     
    14111423        stubSPUSafeTearDown();
    14121424
     1425#ifdef CHROMIUM_THREADSAFE
     1426        crFreeTSD(&g_stubCurrentContextTSD);
     1427#endif
     1428
    14131429#ifdef VDBG_VEHANDLER
    14141430        vboxVDbgVEHandlerUnregister();
    14151431#endif
    1416 
    14171432        break;
    14181433    }
  • trunk/src/VBox/Additions/common/crOpenGL/stub.h

    r39568 r39602  
    5656#endif
    5757
     58#ifdef CHROMIUM_THREADSAFE
     59# include <cr_threads.h>
     60#endif
    5861/*#define VBOX_TEST_MEGOO*/
    5962
     
    113116
    114117#ifdef CHROMIUM_THREADSAFE
    115     CRTSDREFDATA
     118    VBOXTLSREFDATA
    116119#endif
    117120
     
    265268
    266269#ifdef CHROMIUM_THREADSAFE
    267 # define stubGetCurrentContext() crTSDRefGetCurrent(ContextInfo, &g_stubCurrentContextTSD)
    268 # define stubSetCurrentContext(_ctx) crTSDRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx)
    269 #else
    270 # define stubGetCurrentContext() (stub.currentContext)
    271 # define stubSetCurrentContext(_ctx) do { stub.currentContext = (_ctx); } while (0)
    272 #endif
    273 
    274 extern Stub stub;
    275 /* we place the __currentContextTSD outside the Stub data because Stub data is inited by the client's call,
    276  * while we need __currentContextTSD the __currentContextTSD to be valid at any time to be able to handle
     270/* we place the g_stubCurrentContextTLS outside the Stub data because Stub data is inited by the client's call,
     271 * while we need g_stubCurrentContextTLS the g_stubCurrentContextTLS to be valid at any time to be able to handle
    277272 * THREAD_DETACH cleanup on windows.
    278273 * Note that we can not do
     
    284279 * Note that GetModuleFileName acquires the loader lock.
    285280 * */
    286 #ifdef CHROMIUM_THREADSAFE
    287281extern CRtsd g_stubCurrentContextTSD;
    288 #endif
     282
     283# define stubGetCurrentContext() VBoxTlsRefGetCurrent(ContextInfo, &g_stubCurrentContextTSD)
     284# define stubSetCurrentContext(_ctx) VBoxTlsRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx)
     285#else
     286# define stubGetCurrentContext() (stub.currentContext)
     287# define stubSetCurrentContext(_ctx) do { stub.currentContext = (_ctx); } while (0)
     288#endif
     289
     290extern Stub stub;
     291
    289292extern DECLEXPORT(SPUDispatchTable) glim;
    290293extern SPUDispatchTable stubThreadsafeDispatch;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette