VirtualBox

Ignore:
Timestamp:
Oct 6, 2009 6:07:06 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53228
Message:

crOpenGL: update to wine 1.1.30

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d8/directx.c

    r22496 r23571  
    8181    if (ref == 0) {
    8282        TRACE("Releasing wined3d %p\n", This->WineD3D);
    83         EnterCriticalSection(&d3d8_cs);
     83
     84        wined3d_mutex_lock();
    8485        IWineD3D_Release(This->WineD3D);
    85         LeaveCriticalSection(&d3d8_cs);
     86        wined3d_mutex_unlock();
     87
    8688        HeapFree(GetProcessHeap(), 0, This);
    8789    }
     
    9698    TRACE("(%p)->(%p)\n", This, pInitializeFunction);
    9799
    98     EnterCriticalSection(&d3d8_cs);
     100    wined3d_mutex_lock();
    99101    hr = IWineD3D_RegisterSoftwareDevice(This->WineD3D, pInitializeFunction);
    100     LeaveCriticalSection(&d3d8_cs);
     102    wined3d_mutex_unlock();
     103
    101104    return hr;
    102105}
     
    107110    TRACE("(%p)\n", This);
    108111
    109     EnterCriticalSection(&d3d8_cs);
     112    wined3d_mutex_lock();
    110113    hr = IWineD3D_GetAdapterCount(This->WineD3D);
    111     LeaveCriticalSection(&d3d8_cs);
     114    wined3d_mutex_unlock();
     115
    112116    return hr;
    113117}
     
    129133    adapter_id.device_name_size = 0; /* d3d9 only */
    130134
    131     EnterCriticalSection(&d3d8_cs);
     135    wined3d_mutex_lock();
    132136    hr = IWineD3D_GetAdapterIdentifier(This->WineD3D, Adapter, Flags, &adapter_id);
    133     LeaveCriticalSection(&d3d8_cs);
     137    wined3d_mutex_unlock();
    134138
    135139    pIdentifier->DriverVersion = adapter_id.driver_version;
     
    149153    TRACE("(%p)->(%d)\n", This, Adapter);
    150154
    151     EnterCriticalSection(&d3d8_cs);
     155    wined3d_mutex_lock();
    152156    hr = IWineD3D_GetAdapterModeCount(This->WineD3D, Adapter, 0 /* format */);
    153     LeaveCriticalSection(&d3d8_cs);
     157    wined3d_mutex_unlock();
     158
    154159    return hr;
    155160}
     
    160165    TRACE("(%p)->(%d, %d, %p)\n", This, Adapter, Mode, pMode);
    161166
    162     EnterCriticalSection(&d3d8_cs);
     167    wined3d_mutex_lock();
    163168    hr = IWineD3D_EnumAdapterModes(This->WineD3D, Adapter, WINED3DFMT_UNKNOWN, Mode, (WINED3DDISPLAYMODE *) pMode);
    164     LeaveCriticalSection(&d3d8_cs);
     169    wined3d_mutex_unlock();
    165170
    166171    if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
     
    174179    TRACE("(%p)->(%d,%p)\n", This, Adapter, pMode);
    175180
    176     EnterCriticalSection(&d3d8_cs);
     181    wined3d_mutex_lock();
    177182    hr = IWineD3D_GetAdapterDisplayMode(This->WineD3D, Adapter, (WINED3DDISPLAYMODE *) pMode);
    178     LeaveCriticalSection(&d3d8_cs);
     183    wined3d_mutex_unlock();
    179184
    180185    if (SUCCEEDED(hr)) pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
     
    190195    TRACE("(%p)->(%d, %d, %d, %d, %s)\n", This, Adapter, CheckType, DisplayFormat, BackBufferFormat, Windowed ? "true" : "false");
    191196
    192     EnterCriticalSection(&d3d8_cs);
     197    wined3d_mutex_lock();
    193198    hr = IWineD3D_CheckDeviceType(This->WineD3D, Adapter, CheckType, wined3dformat_from_d3dformat(DisplayFormat),
    194199            wined3dformat_from_d3dformat(BackBufferFormat), Windowed);
    195     LeaveCriticalSection(&d3d8_cs);
     200    wined3d_mutex_unlock();
     201
    196202    return hr;
    197203}
     
    224230    }
    225231
    226     EnterCriticalSection(&d3d8_cs);
     232    wined3d_mutex_lock();
    227233    hr = IWineD3D_CheckDeviceFormat(This->WineD3D, Adapter, DeviceType, wined3dformat_from_d3dformat(AdapterFormat),
    228234            Usage, WineD3DRType, wined3dformat_from_d3dformat(CheckFormat), SURFACE_OPENGL);
    229     LeaveCriticalSection(&d3d8_cs);
    230     return hr;
    231 }
    232 
    233 static HRESULT  WINAPI  IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface,
    234                                                            UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
    235                                                            BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType) {
     235    wined3d_mutex_unlock();
     236
     237    return hr;
     238}
     239
     240static HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(IDirect3D8 *iface, UINT Adapter,
     241        D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType)
     242{
    236243    IDirect3D8Impl *This = (IDirect3D8Impl *)iface;
    237244    HRESULT hr;
    238245    TRACE("(%p)-<(%d, %d, %d, %s, %d)\n", This, Adapter, DeviceType, SurfaceFormat, Windowed ? "true" : "false", MultiSampleType);
    239246
    240     EnterCriticalSection(&d3d8_cs);
     247    wined3d_mutex_lock();
    241248    hr = IWineD3D_CheckDeviceMultiSampleType(This->WineD3D, Adapter, DeviceType,
    242249            wined3dformat_from_d3dformat(SurfaceFormat), Windowed, (WINED3DMULTISAMPLE_TYPE) MultiSampleType, NULL);
    243     LeaveCriticalSection(&d3d8_cs);
    244     return hr;
    245 }
    246 
    247 static HRESULT  WINAPI  IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface,
    248                                                        UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
    249                                                        D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
     250    wined3d_mutex_unlock();
     251
     252    return hr;
     253}
     254
     255static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(IDirect3D8 *iface, UINT Adapter, D3DDEVTYPE DeviceType,
     256        D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat)
     257{
    250258    IDirect3D8Impl *This = (IDirect3D8Impl *)iface;
    251259    HRESULT hr;
    252260    TRACE("(%p)-<(%d, %d, %d, %d, %d)\n", This, Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
    253261
    254     EnterCriticalSection(&d3d8_cs);
     262    wined3d_mutex_lock();
    255263    hr = IWineD3D_CheckDepthStencilMatch(This->WineD3D, Adapter, DeviceType,
    256264            wined3dformat_from_d3dformat(AdapterFormat), wined3dformat_from_d3dformat(RenderTargetFormat),
    257265            wined3dformat_from_d3dformat(DepthStencilFormat));
    258     LeaveCriticalSection(&d3d8_cs);
     266    wined3d_mutex_unlock();
     267
    259268    return hr;
    260269}
     
    288297        return D3DERR_INVALIDCALL; /*well this is what MSDN says to return*/
    289298    }
    290     EnterCriticalSection(&d3d8_cs);
     299
     300    wined3d_mutex_lock();
    291301    hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
    292     LeaveCriticalSection(&d3d8_cs);
     302    wined3d_mutex_unlock();
     303
    293304    fixup_caps(pWineCaps);
    294305    WINECAPSTOD3D8CAPS(pCaps, pWineCaps)
     
    304315    TRACE("(%p)->(%d)\n", This, Adapter);
    305316
    306     EnterCriticalSection(&d3d8_cs);
     317    wined3d_mutex_lock();
    307318    ret = IWineD3D_GetAdapterMonitor(This->WineD3D, Adapter);
    308     LeaveCriticalSection(&d3d8_cs);
     319    wined3d_mutex_unlock();
     320
    309321    return ret;
    310 }
    311 
    312 ULONG WINAPI D3D8CB_DestroyRenderTarget(IWineD3DSurface *pSurface) {
    313     IDirect3DSurface8Impl* surfaceParent;
    314     TRACE("(%p) call back\n", pSurface);
    315 
    316     IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
    317     surfaceParent->isImplicit = FALSE;
    318     /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
    319     return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
    320322}
    321323
     
    327329    IUnknown_Release(swapChainParent);
    328330    return IUnknown_Release(swapChainParent);
    329 }
    330 
    331 ULONG WINAPI D3D8CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) {
    332     IDirect3DSurface8Impl* surfaceParent;
    333     TRACE("(%p) call back\n", pSurface);
    334 
    335     IWineD3DSurface_GetParent(pSurface, (IUnknown **) &surfaceParent);
    336     surfaceParent->isImplicit = FALSE;
    337     /* Surface had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */
    338     return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent);
    339331}
    340332
     
    372364
    373365    /* Allocate an associated WineD3DDevice object */
    374     EnterCriticalSection(&d3d8_cs);
     366    wined3d_mutex_lock();
    375367    hr = IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags,
    376368            (IUnknown *)object, (IWineD3DDeviceParent *)&object->device_parent_vtbl, &object->WineD3DDevice);
     
    379371        HeapFree(GetProcessHeap(), 0, object);
    380372        *ppReturnedDeviceInterface = NULL;
    381         LeaveCriticalSection(&d3d8_cs);
     373        wined3d_mutex_unlock();
     374
    382375        return hr;
    383376    }
     
    406399
    407400    hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters);
    408     LeaveCriticalSection(&d3d8_cs);
     401    wined3d_mutex_unlock();
    409402
    410403    pPresentationParameters->BackBufferWidth                    = localParameters.BackBufferWidth;
     
    432425    if(!object->decls) {
    433426        ERR("Out of memory\n");
    434         EnterCriticalSection(&d3d8_cs);
     427
     428        wined3d_mutex_lock();
    435429        IWineD3DDevice_Release(object->WineD3DDevice);
    436         LeaveCriticalSection(&d3d8_cs);
     430        wined3d_mutex_unlock();
     431
    437432        HeapFree(GetProcessHeap(), 0, object);
    438433        *ppReturnedDeviceInterface = NULL;
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