VirtualBox

Changeset 40431 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Mar 12, 2012 3:41:16 PM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: more TLS data handling fixes

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

Legend:

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

    r33540 r40431  
    880880#endif
    881881}
     882
     883static void ARRAYSPU_APIENTRY
     884arrayspu_VBoxAttachThread()
     885{
     886    crStateVBoxAttachThread();
     887    array_spu.child.VBoxAttachThread();
     888}
     889
     890static void ARRAYSPU_APIENTRY
     891arrayspu_VBoxDetachThread()
     892{
     893    crStateVBoxDetachThread();
     894    array_spu.child.VBoxDetachThread();
     895}
     896
    882897
    883898SPUNamedFunctionTable _cr_array_table[] = {
     
    924939    { "DestroyContext", (SPUGenericFunction) arrayspu_DestroyContext},
    925940    { "UseProgram", (SPUGenericFunction) arrayspu_UseProgram},
     941    { "VBoxAttachThread", (SPUGenericFunction) arrayspu_VBoxAttachThread},
     942    { "VBoxDetachThread", (SPUGenericFunction) arrayspu_VBoxDetachThread},
    926943    { NULL, NULL }
    927944};
  • trunk/src/VBox/Additions/common/crOpenGL/array/arrayspu_init.c

    r39507 r40431  
    8585    return 1;
    8686}
    87 
    88 #ifdef RT_OS_WINDOWS
    89 #define WIN32_LEAN_AND_MEAN
    90 #include <windows.h>
    91 BOOL WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
    92 {
    93     (void) lpvReserved;
    94 
    95     switch (fdwReason)
    96     {
    97         case DLL_THREAD_ATTACH:
    98         {
    99             crStateOnThreadAttachDetach(GL_TRUE);
    100             break;
    101         }
    102 
    103         case DLL_THREAD_DETACH:
    104         {
    105             crStateOnThreadAttachDetach(GL_FALSE);
    106             break;
    107         }
    108 
    109         case DLL_PROCESS_ATTACH:
    110         case DLL_PROCESS_DETACH:
    111         default:
    112             break;
    113     }
    114 
    115     return TRUE;
    116 }
    117 #endif
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state_special

    r19099 r40431  
    6262MakeCurrent
    6363DestroyContext
     64VBoxAttachThread
     65VBoxDetachThread
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_init.c

    r39507 r40431  
    8585        return 1;
    8686}
    87 
    88 #ifdef RT_OS_WINDOWS
    89 #define WIN32_LEAN_AND_MEAN
    90 #include <windows.h>
    91 BOOL WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
    92 {
    93     (void) lpvReserved;
    94 
    95     switch (fdwReason)
    96     {
    97         case DLL_THREAD_ATTACH:
    98         {
    99             crStateOnThreadAttachDetach(GL_TRUE);
    100             break;
    101         }
    102 
    103         case DLL_THREAD_DETACH:
    104         {
    105             crStateOnThreadAttachDetach(GL_FALSE);
    106             break;
    107         }
    108 
    109         case DLL_PROCESS_ATTACH:
    110         case DLL_PROCESS_DETACH:
    111         default:
    112             break;
    113     }
    114 
    115     return TRUE;
    116 }
    117 #endif
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r40281 r40431  
    13391339 /* debugging: this is to be able to catch first-chance notifications
    13401340  * for exceptions other than EXCEPTION_BREAKPOINT in kernel debugger */
    1341 # define VDBG_VEHANDLER
     1341//# define VDBG_VEHANDLER
    13421342#endif
    13431343
     
    14261426    case DLL_PROCESS_DETACH:
    14271427    {
     1428        /* do exactly the same thing as for DLL_THREAD_DETACH since
     1429         * DLL_THREAD_DETACH is not called for the thread doing DLL_PROCESS_DETACH according to msdn docs */
     1430        stubSetCurrentContext(NULL);
     1431        if (stub_initialized)
     1432        {
     1433            CRASSERT(stub.spu);
     1434            stub.spu->dispatch_table.VBoxDetachThread();
     1435        }
     1436
    14281437        stubSPUSafeTearDown();
    14291438
     
    14401449    case DLL_THREAD_ATTACH:
    14411450    {
    1442 #if 0
    14431451        if (stub_initialized)
    14441452        {
    14451453            CRASSERT(stub.spu);
    1446             stub.spu->dispatch_table.VBoxPackAttachThread();
    1447         }
    1448 #endif
     1454            stub.spu->dispatch_table.VBoxAttachThread();
     1455        }
    14491456        break;
    14501457    }
     
    14531460    {
    14541461        stubSetCurrentContext(NULL);
    1455 #if 0
    14561462        if (stub_initialized)
    14571463        {
    14581464            CRASSERT(stub.spu);
    1459             stub.spu->dispatch_table.VBoxPackDetachThread();
    1460         }
    1461 #endif
     1465            stub.spu->dispatch_table.VBoxDetachThread();
     1466        }
    14621467        break;
    14631468    }
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r39507 r40431  
    479479}
    480480
    481 void PACKSPU_APIENTRY packspu_VBoxPackAttachThread()
     481void PACKSPU_APIENTRY packspu_VBoxAttachThread()
    482482{
    483483#if 0
     
    495495
    496496    crSetTSD(&_PackTSD, NULL);
    497 }
    498 
    499 void PACKSPU_APIENTRY packspu_VBoxPackDetachThread()
     497
     498    crStateVBoxAttachThread();
     499}
     500
     501void PACKSPU_APIENTRY packspu_VBoxDetachThread()
    500502{
    501503    int i;
     
    558560        crUnlockMutex(&_PackMutex);
    559561    }
     562
     563    crStateVBoxDetachThread();
    560564}
    561565
     
    583587
    584588        case DLL_THREAD_ATTACH:
    585         {
    586             packspu_VBoxPackAttachThread();
    587             crStateOnThreadAttachDetach(GL_TRUE);
    588             break;
    589         }
    590 
    591589        case DLL_THREAD_DETACH:
    592         {
    593             packspu_VBoxPackDetachThread();
    594             crStateOnThreadAttachDetach(GL_FALSE);
    595             break;
    596         }
    597 
    598590        default:
    599591            break;
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special

    r38772 r40431  
    105105VBoxPackGetInjectID
    106106VBoxPackSetInjectID
    107 VBoxPackAttachThread
    108 VBoxPackDetachThread
     107VBoxAttachThread
     108VBoxDetachThread
    109109ChromiumParameteriCR
    110110CompressedTexImage1DARB
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